/* Auth screens — aligned with PMS / Tech One look */

.auth-body {
    min-height: 100vh;
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(ellipse 90% 60% at 0% 0%, rgba(37, 99, 235, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 100%, rgba(30, 64, 175, 0.1), transparent 50%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(147, 197, 253, 0.12), transparent 45%),
        var(--portal-bg, #f1f3f6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.auth-bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: auth-blob-float 18s ease-in-out infinite;
}

.auth-blob-1 {
    width: 420px;
    height: 420px;
    background: rgba(37, 99, 235, 0.18);
    top: -120px;
    left: -80px;
}

.auth-blob-2 {
    width: 320px;
    height: 320px;
    background: rgba(30, 64, 175, 0.14);
    bottom: -80px;
    right: -60px;
    animation-delay: -6s;
}

.auth-blob-3 {
    width: 240px;
    height: 240px;
    background: rgba(147, 197, 253, 0.22);
    top: 40%;
    right: 15%;
    animation-delay: -12s;
}

@keyframes auth-blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(24px, -18px) scale(1.04); }
    66% { transform: translate(-16px, 12px) scale(0.96); }
}

.auth-shell {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: auth-enter 0.55s ease-out both;
}

@keyframes auth-enter {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-brand-logo {
    height: 110px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(15, 23, 42, 0.08));
}

.auth-brand-tagline {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--portal-text-muted, #64748b);
}

.auth-card {
    background: var(--portal-surface, #fff);
    border: 1px solid var(--portal-border, #dbe3ef);
    border-radius: 16px;
    padding: 0;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 32px rgba(15, 23, 42, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    overflow: hidden;
}

.auth-card-accent {
    height: 4px;
    background: linear-gradient(90deg, #1e40af, var(--portal-primary, #2563eb), #60a5fa);
}

.auth-card-body {
    padding: 1.75rem 1.85rem 1.65rem;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--portal-primary-soft, #eff6ff);
    color: var(--portal-primary, #2563eb);
    font-size: 1.15rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.auth-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--portal-heading, #2c3e50);
}

.auth-card-sub {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--portal-text-muted, #64748b);
}

.auth-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.auth-error-banner:empty {
    display: none;
}

.auth-error-banner::before {
    content: "\f071";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 0.85rem;
}

.auth-warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    color: #92400e;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.auth-warning-banner::before {
    content: "\f06a";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 0.85rem;
    color: #d97706;
}

.auth-field {
    margin-bottom: 1.1rem;
}

.auth-field:last-of-type {
    margin-bottom: 1.35rem;
}

.auth-field .form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--portal-heading, #2c3e50);
    margin-bottom: 0.4rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.auth-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--portal-text-subtle, #94a3b8);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

.auth-input-wrap .form-control {
    width: 100%;
    padding: 0.72rem 0.85rem 0.72rem 2.5rem;
    border: 1.5px solid var(--portal-border, #dbe3ef);
    border-radius: 10px;
    font-size: 0.9375rem;
    background: var(--portal-surface-muted, #f8fafc);
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.auth-input-wrap .form-control:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.auth-input-wrap .form-control:focus {
    border-color: var(--portal-primary, #2563eb);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--portal-primary, #2563eb);
}

.auth-input-wrap .form-control.auth-input-with-toggle {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--portal-text-subtle, #94a3b8);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    z-index: 2;
}

.auth-password-toggle:hover {
    color: var(--portal-primary, #2563eb);
    background: var(--portal-primary-soft, #eff6ff);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--portal-primary, #2563eb);
    outline-offset: 1px;
}

.auth-field-error {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #dc2626;
}

.auth-submit-btn {
    position: relative;
    padding: 0.78rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
}

.auth-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit-btn:disabled {
    opacity: 0.85;
    cursor: wait;
}

.auth-submit-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-submit-loading[hidden],
.auth-submit-text[hidden] {
    display: none !important;
}

.auth-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-footer-note {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.35rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 28rem;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--portal-text-subtle, #94a3b8);
}

.auth-footer-note-th {
    font-size: 0.7rem;
    opacity: 0.95;
}

/* Legacy input-group support (ChangePassword, etc.) */
.auth-card .input-group-text {
    border-color: var(--portal-border, #dbe3ef);
    color: var(--portal-text-subtle, #94a3b8);
}

.auth-card .input-group .form-control {
    border-color: var(--portal-border, #dbe3ef);
}

.auth-card .input-group:focus-within .input-group-text,
.auth-card .input-group:focus-within .form-control {
    border-color: var(--portal-primary-border, #93c5fd);
}

.auth-alert {
    border-radius: 10px;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .auth-body {
        padding: 1rem;
        justify-content: flex-start;
        padding-top: 2rem;
    }

    .auth-brand-logo {
        height: 90px;
    }

    .auth-card-body {
        padding: 1.5rem 1.25rem 1.35rem;
    }

    .auth-card-title {
        font-size: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell,
    .auth-blob,
    .auth-spinner {
        animation: none;
    }

    .auth-submit-btn:hover:not(:disabled) {
        transform: none;
    }
}
