/* TDS Toast notifications */
.tds-toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 24px));
    pointer-events: none;
}

.tds-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 14px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
    position: relative;
    overflow: hidden;
}

.tds-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.tds-toast.hide {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
}

.tds-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    overflow: hidden;
}

.tds-toast-icon svg,
.tds-toast-close svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: block;
    flex-shrink: 0;
}

.tds-toast--success .tds-toast-icon svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
}

.tds-toast-icon i,
.tds-toast-close i {
    display: none;
}

.tds-toast-body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.tds-toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.tds-toast-msg {
    font-size: 13px;
    line-height: 1.45;
    color: #475569;
    word-break: break-word;
}

.tds-toast-msg ul {
    margin: 4px 0 0;
    padding-left: 16px;
}

.tds-toast-msg li {
    margin-bottom: 2px;
}

.tds-toast-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tds-toast-close:hover {
    color: #64748b;
}

.tds-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    animation: tdsToastProgress linear forwards;
}

.tds-toast--success .tds-toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.tds-toast--success .tds-toast-progress {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.tds-toast--error .tds-toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.tds-toast--error .tds-toast-progress {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.tds-toast--warning .tds-toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.tds-toast--warning .tds-toast-progress {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

.tds-toast--info .tds-toast-icon {
    background: #ffedd5;
    color: #e86500;
}

.tds-toast--info .tds-toast-progress {
    background: linear-gradient(90deg, #e86500, #f59e0b);
}

@keyframes tdsToastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Field validation errors */
.tds-field-error,
.auth-field-error {
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 0.4rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.tds-field-error::before,
.auth-field-error::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-input-wrap.is-invalid,
.tds-input-wrap.is-invalid,
.contact-field.is-invalid input,
.contact-field.is-invalid select,
.contact-field.is-invalid textarea,
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.auth-input-wrap .form-control.is-invalid,
.tds-input-wrap .form-control.is-invalid {
    border: none !important;
    box-shadow: none !important;
    background-image: none !important;
    padding-right: 0 !important;
}

@media (max-width: 575.98px) {
    .tds-toast-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}
