/* ==========================================================================
   Katab Health V2 Authentication UI Styles (EHR-026-C / EHR-026-C1)
   Consumes EHR-024 / EHR-024-H0.1 semantic tokens from v2-workspace.css.
   Compact, balanced enterprise scale and density.
   ========================================================================== */

:root {
    --v2-auth-navy: #163b5d;
    --v2-auth-teal: #147d83;
    --v2-auth-blue: #467ea9;
    --v2-auth-dark-surface: #09263d;
    --v2-auth-mint-light: #a9e5dd;
    --v2-auth-mint-glow: #80d6d0;
    --v2-auth-powder-blue: #9cc6de;
}

/* Page Canvas */
.v2-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--v2-color-bg-app, #f8fafc);
    margin: 0;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--v2-color-text-primary, #1f2937);
}

/* Containers */
.v2-auth-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.v2-auth-container--split {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .v2-auth-container--split {
        max-width: 920px;
    }
}

.v2-auth-centered-box {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* Auth Cards */
.v2-auth-card {
    background-color: var(--v2-color-surface, #ffffff);
    border: 1px solid var(--v2-color-border-default, #e2e8f0);
    border-radius: 0.625rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    box-sizing: border-box;
    overflow: hidden;
}

.v2-auth-card--centered,
.v2-auth-card--form {
    padding: 2rem 1.875rem;
}

/* Two-Panel Split Layout (Desktop >= 992px) */
.v2-auth-card--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
}

@media (min-width: 992px) {
    .v2-auth-card--split {
        grid-template-columns: 400px minmax(0, 1fr);
        min-height: 480px;
    }
}

/* Left Institutional Brand Panel */
.v2-auth-brand-panel {
    display: none;
    background-color: var(--v2-auth-dark-surface, #09263d);
    color: #ffffff;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .v2-auth-brand-panel {
        display: flex;
        flex-direction: column;
    }
}

.v2-auth-brand-panel__inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 2.25rem 2rem;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.v2-auth-brand-panel__header {
    margin-bottom: 1.25rem;
}

.v2-auth-brand-panel__logo {
    display: block;
    max-width: 230px;
    height: auto;
    margin-bottom: 0.35rem;
}

.v2-auth-brand-panel__descriptor {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--v2-auth-mint-light, #a9e5dd);
    font-weight: 600;
    margin: 0;
}

.v2-auth-brand-panel__body {
    margin-top: auto;
    margin-bottom: auto;
    padding: 1rem 0;
}

.v2-auth-brand-panel__tagline {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    margin: 0 0 0.65rem 0;
}

.v2-auth-brand-panel__summary {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #cbd5e1;
    margin: 0 0 1.25rem 0;
}

.v2-auth-brand-panel__features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.v2-auth-brand-panel__feature {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.v2-auth-brand-panel__icon {
    flex-shrink: 0;
    color: var(--v2-auth-mint-glow, #80d6d0);
    width: 16px;
    height: 16px;
}

.v2-auth-brand-panel__footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.v2-auth-brand-panel__copyright {
    font-size: 0.7rem;
    color: #94a3b8;
    margin: 0;
}

/* Right Authentication Form Panel */
.v2-auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.25rem 2.25rem;
    box-sizing: border-box;
    background-color: var(--v2-color-surface, #ffffff);
}

@media (max-width: 991.98px) {
    .v2-auth-form-panel {
        padding: 1.75rem 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .v2-auth-form-panel {
        padding: 1.5rem 1.125rem;
    }
}

/* Brand Header in Form */
.v2-auth-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.v2-auth-brand__logo {
    display: inline-block;
    max-height: 36px;
    width: auto;
}

.v2-auth-brand__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--v2-auth-navy, #163b5d);
    margin: 0 0 0.25rem 0;
    line-height: 1.25;
}

.v2-auth-brand__subtitle {
    font-size: 0.8rem;
    color: var(--v2-color-text-muted, #64748b);
    margin: 0;
    line-height: 1.4;
}

/* Form Styles - Balanced Enterprise Density */
.v2-auth-form {
    margin-top: 0.25rem;
}

.v2-auth-form .form-group {
    margin-bottom: 0.875rem;
}

.v2-auth-form .form-label {
    display: block;
    font-size: 0.78125rem;
    font-weight: 600;
    color: var(--v2-color-text-secondary, #475569);
    margin-bottom: 0.25rem;
}

.v2-auth-form .form-control {
    display: block;
    width: 100%;
    padding: 0.45rem 0.75rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--v2-color-text-primary, #1f2937);
    background-color: var(--v2-color-surface, #ffffff);
    border: 1px solid var(--v2-color-border-control, #cbd5e1);
    border-radius: 0.375rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.v2-auth-form .form-control:focus {
    border-color: var(--v2-auth-teal, #147d83);
    box-shadow: 0 0 0 3px rgba(20, 125, 131, 0.18);
    outline: 0;
}

/* Password Reveal Toggle */
.v2-password-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.v2-password-group .form-control {
    padding-right: 2.5rem;
}

.v2-password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    background: transparent;
    border: none;
    color: var(--v2-color-text-muted, #64748b);
    cursor: pointer;
    padding: 0;
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    transition: color 0.15s ease-in-out;
}

.v2-password-toggle:hover {
    color: var(--v2-auth-navy, #163b5d);
}

.v2-password-toggle:focus-visible {
    outline: 2px solid var(--v2-auth-teal, #147d83);
    outline-offset: -2px;
}

.v2-password-icon {
    display: inline-block;
    vertical-align: middle;
}

/* Primary CTA Button */
.v2-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--v2-auth-navy, #163b5d);
    border: 1px solid var(--v2-auth-navy, #163b5d);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.v2-auth-submit:hover {
    background-color: #0f2b45;
    border-color: #0f2b45;
    color: #ffffff;
}

.v2-auth-submit:focus-visible {
    outline: 2px solid var(--v2-auth-teal, #147d83);
    outline-offset: 2px;
}

/* Feedback & Alerts */
.v2-auth-alert {
    padding: 0.6rem 0.85rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-size: 0.78125rem;
    background-color: var(--v2-color-danger-bg, #fef2f2);
    border: 1px solid var(--v2-color-danger-border, #fecaca);
    color: var(--v2-color-danger-text, #b42318);
}

.v2-auth-alert ul.form-errors {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.v2-auth-alert ul.form-errors li + li {
    margin-top: 0.25rem;
}

/* Footer Notice */
.v2-auth-footer,
.v2-auth-form-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--v2-color-border-subtle, #edf0f3);
    text-align: center;
    font-size: 0.71875rem;
    color: var(--v2-color-text-muted, #64748b);
    line-height: 1.4;
}

.v2-auth-footer p,
.v2-auth-form-footer p {
    margin: 0;
}

/* ==========================================================================
   Logout Screen Styles (Compact 48px Success Badge)
   ========================================================================== */
.v2-logout-badge-wrapper {
    display: flex;
    justify-content: center;
}

.v2-logout-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.v2-logout-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--v2-auth-navy, #163b5d);
    text-align: center;
    margin: 0.75rem 0 0.5rem 0;
}

.v2-logout-message {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--v2-color-text-secondary, #475569);
    text-align: center;
    margin: 0 auto;
    max-width: 360px;
}

.v2-logout-actions {
    display: flex;
    justify-content: center;
}

.v2-logout-actions .v2-auth-submit {
    max-width: 260px;
}

/* Responsive Overrides */
@media (max-width: 575.98px) {
    .v2-auth-page {
        padding: 1rem 0.75rem;
        align-items: flex-start;
    }
    .v2-auth-card {
        border-radius: 0.5rem;
        box-shadow: none;
        border-color: var(--v2-color-border-subtle, #edf0f3);
    }
}
