/**
 * Enterprise auth — login, logout, MFA
 */

.auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--mf-bg);
    color: var(--mf-text);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    background: var(--mf-bg);
}

/* —— Hero (brand plane) —— */
.auth-hero {
    position: relative;
    flex: 1 1 48%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 55%),
        linear-gradient(160deg, var(--mf-primary-dark) 0%, var(--mf-primary) 70%, #1e40af 100%);
    overflow: hidden;
    animation: auth-fade-in 0.45s ease-out;
}

.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 90%);
    pointer-events: none;
}

.auth-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 28rem;
}

.auth-platform-mark {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.auth-platform-mark--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.35rem;
    margin-bottom: 2rem;
}

.auth-platform-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.auth-platform-text {
    width: 100%;
}

.auth-platform-mark--stacked .auth-platform-logo {
    width: auto;
    height: clamp(4.75rem, 11vw, 7.25rem);
    max-width: min(340px, 78vw);
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.24));
}

.auth-platform-mark--stacked .auth-platform-icon {
    width: clamp(4.75rem, 11vw, 7.25rem);
    height: clamp(4.75rem, 11vw, 7.25rem);
    font-size: clamp(2rem, 5vw, 3rem);
}

.auth-platform-logo {
    width: auto;
    height: clamp(3.25rem, 7vw, 4.5rem);
    max-width: min(240px, 42vw);
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.22));
}

.auth-platform-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(3.25rem, 7vw, 4.5rem);
    height: clamp(3.25rem, 7vw, 4.5rem);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: clamp(1.5rem, 4vw, 2rem);
    flex-shrink: 0;
}

.auth-platform-eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.35rem;
}

.auth-platform-name {
    font-size: clamp(1.65rem, 3.5vw, 2.35rem);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0;
}

.auth-platform-tagline {
    margin: 0 0 1.75rem;
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    max-width: 24rem;
}

.auth-hero-trust {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.01em;
}

.auth-hero-trust i {
    color: #93c5fd;
    font-size: 0.95rem;
}

.auth-hero-footer {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

/* —— Form panel —— */
.auth-panel {
    flex: 1 1 52%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: #fff;
    animation: auth-slide-up 0.5s ease-out;
}

.auth-panel-inner {
    width: 100%;
    max-width: 24rem;
}

.auth-credentials-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--mf-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-credentials-brand--placeholder {
    background: var(--mf-bg);
    border-style: dashed;
}

.auth-credentials-brand--placeholder .auth-credentials-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mf-text-muted);
}

.auth-credentials-brand--placeholder .auth-credentials-tagline {
    font-size: 0.72rem;
}

.auth-credentials-logo {
    width: auto;
    height: 3.25rem;
    max-width: 140px;
    object-fit: contain;
    flex-shrink: 0;
}

.auth-credentials-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    flex-shrink: 0;
    background: var(--mf-primary-light);
    color: var(--mf-primary);
    font-size: 1.25rem;
}

.auth-credentials-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mf-text);
    margin: 0;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

.auth-credentials-tagline {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--mf-text-muted);
    line-height: 1.35;
}

.auth-institution-brand,
.auth-institution-fallback {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-institution-logo {
    width: auto;
    height: 3.25rem;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.auth-institution-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.85rem;
    margin-bottom: 0.75rem;
    background: var(--mf-primary-light);
    color: var(--mf-primary);
    font-size: 1.4rem;
}

.auth-institution-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mf-text);
    margin: 0;
    letter-spacing: -0.015em;
}

.auth-institution-tagline {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--mf-text-muted);
    line-height: 1.4;
}

.auth-institution-fallback .auth-institution-name {
    font-size: 1.15rem;
}

/* —— Card —— */
.auth-card {
    background: var(--mf-surface);
    border: 1px solid var(--mf-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.auth-card-header {
    padding: 1.35rem 1.35rem 0;
}

.auth-card-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--mf-text);
    letter-spacing: -0.01em;
}

.auth-card-header p {
    margin: 0.3rem 0 0;
    font-size: 0.825rem;
    color: var(--mf-text-muted);
    line-height: 1.45;
}

.auth-card-body {
    padding: 1.15rem 1.35rem 1.35rem;
}

.auth-card-status .auth-card-body {
    padding: 2rem 1.5rem 1.5rem;
}

/* —— Alerts —— */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    line-height: 1.4;
    border: 1px solid transparent;
}

.auth-alert i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-alert-danger,
.auth-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.auth-alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.auth-alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.auth-alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* —— Form —— */
.auth-form .auth-field {
    margin-bottom: 1rem;
}

.auth-form .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mf-text);
    margin-bottom: 0.35rem;
}

.auth-form .form-control {
    border-radius: 10px;
    border-color: var(--mf-border-input);
    padding: 0.65rem 0.85rem;
    font-size: 0.925rem;
    min-height: 2.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form .form-control:focus {
    border-color: var(--mf-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.auth-form .form-control::placeholder {
    color: #94a3b8;
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .form-control {
    padding-right: 2.75rem;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--mf-text-muted);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--mf-primary);
    background: var(--mf-bg);
    outline: none;
}

.auth-otp {
    letter-spacing: 0.35em;
    text-align: center;
    font-size: 1.25rem !important;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.auth-hint {
    margin: 0 0 1.15rem;
    font-size: 0.75rem;
    color: var(--mf-text-muted);
    line-height: 1.45;
}

.auth-hint a {
    color: var(--mf-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-hint a:hover {
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.925rem;
    border-radius: 10px;
    letter-spacing: 0.01em;
}

.auth-submit:focus-visible {
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.25);
}

/* —— Status (logout) —— */
.auth-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.auth-status-icon-success {
    background: #ecfdf5;
    color: var(--mf-success);
    border: 1px solid #a7f3d0;
}

.auth-status-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--mf-text);
    letter-spacing: -0.01em;
}

.auth-status-copy {
    margin: 0 0 1.35rem;
    font-size: 0.85rem;
    color: var(--mf-text-muted);
    line-height: 1.5;
}

/* —— Footer —— */
.auth-panel-footer {
    margin-top: 1.35rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--mf-text-muted);
}

.auth-panel-footer a {
    color: var(--mf-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-panel-footer a:hover {
    text-decoration: underline;
}

.auth-sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}

.auth-powered {
    opacity: 0.85;
}

/* —— Motion —— */
@keyframes auth-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes auth-slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-hero,
    .auth-panel {
        animation: none;
    }
}

/* —— Responsive —— */
@media (max-width: 991.98px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-hero {
        flex: none;
        padding: 1.5rem 1.35rem 1.25rem;
        min-height: auto;
    }

    .auth-platform-mark,
    .auth-platform-mark--stacked {
        margin-bottom: 0.85rem;
    }

    .auth-platform-mark--stacked {
        align-items: center;
        text-align: center;
    }

    .auth-platform-brand {
        justify-content: center;
    }

    .auth-platform-tagline {
        margin-bottom: 0.85rem;
        font-size: 0.9rem;
    }

    .auth-hero-trust {
        font-size: 0.7rem;
        padding: 0.45rem 0.7rem;
    }

    .auth-hero-footer {
        display: none;
    }

    .auth-panel {
        flex: 1;
        align-items: flex-start;
        padding: 1.35rem 1.25rem 2rem;
        background: linear-gradient(180deg, #fff 0%, var(--mf-bg) 100%);
    }
}

@media (max-width: 575.98px) {
    .auth-platform-mark {
        gap: 0.75rem;
    }

    .auth-institution-name {
        font-size: 1.1rem;
    }

    .auth-card-header,
    .auth-card-body {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }
}
