/* Shared auth screens — aligned with dashboard palette */

:root {
    --auth-ink: #132536;
    --auth-muted: #5a6b7a;
    --auth-line: #d5dde5;
    --auth-surface: #f4f7fa;
    --auth-card: #ffffff;
    --auth-accent: #0a5f8c;
    --auth-accent-soft: #e6f2f8;
    --auth-nav: #1c2430;
    --auth-danger: #b42318;
}

* { box-sizing: border-box; }

html {
    height: 100%;
    overflow: hidden;
}

body.auth-body {
    font-family: 'DM Sans', sans-serif;
    color: var(--auth-ink);
    margin: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, #9ec9e6 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, #c5dcec 0%, transparent 50%),
        var(--auth-surface);
}

.auth-nav {
    background: var(--auth-nav);
    padding: 0.65rem 1.25rem;
    flex-shrink: 0;
    z-index: 1030;
}

.auth-nav .navbar-brand,
.auth-nav .nav-link,
.auth-nav .navbar-text {
    color: #f5f8fb !important;
}

.auth-nav .nav-link:hover {
    color: #9ed0ef !important;
}

.auth-nav .navbar-text {
    font-family: 'Sora', 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.auth-nav-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fff;
}

/* Full-width scroll shell so the bar sits on the viewport edge */
.auth-scroll {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-main {
    max-width: 440px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3rem;
    animation: authFadeIn 0.4s ease;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.auth-main--wide {
    max-width: 480px;
}

.auth-main--account {
    max-width: 760px;
}

/* Settings-style row: section title left, details right */
.account-row {
    display: grid;
    grid-template-columns: minmax(8.5rem, 30%) 1fr;
    gap: 0.75rem 1.5rem;
    align-items: start;
    margin-top: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--auth-line);
}

.account-row:first-of-type {
    margin-top: 0.15rem;
    padding-top: 0.85rem;
}

.account-row--last {
    padding-bottom: 0;
}

.account-row-title {
    font-family: 'Sora', 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0.15rem 0 0;
    color: var(--auth-ink);
    line-height: 1.35;
}

.account-row-body {
    min-width: 0;
}

.account-section-copy {
    margin: 0 0 0.55rem;
    font-size: 0.88rem;
    color: var(--auth-muted);
    line-height: 1.4;
}

.account-section-note {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--auth-muted);
    line-height: 1.4;
}

.account-close-form {
    position: relative;
    max-width: 22rem;
    margin-top: 0.35rem;
}

.account-close-form .form-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.account-close-form .btn-outline-danger {
    border-radius: 2px;
}

.account-autofill-trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.account-dl {
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.account-dl > div {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
}

.account-dl dt {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--auth-muted);
}

.account-dl dd {
    margin: 0;
    font-size: 0.92rem;
    color: var(--auth-ink);
    word-break: break-word;
}

.account-email-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
}

.account-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.account-badge--ok {
    background: #e8f6ef;
    color: #14532d;
    border-color: #c6e9d4;
}

.account-badge--warn {
    background: #fff8eb;
    color: #8a5a00;
    border-color: #f0dfb4;
}

.account-action {
    display: inline-block;
    width: auto;
    min-width: 10rem;
    padding: 0.45rem 0.95rem;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .account-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding: 0.9rem 0;
    }

    .account-row-title {
        margin-top: 0;
    }

    .account-dl > div {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
}

.auth-card {
    background: var(--auth-card);
    border: 1px solid var(--auth-line);
    border-radius: 14px;
    padding: 1.75rem 1.5rem 1.6rem;
    box-shadow: 0 1px 2px rgba(19, 37, 54, 0.04);
}

.auth-card h1,
.auth-card .auth-title {
    font-family: 'Sora', 'DM Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
    color: var(--auth-ink);
    text-align: center;
}

.auth-lead {
    margin: 0 0 1.25rem;
    color: var(--auth-muted);
    font-size: 0.95rem;
    line-height: 1.45;
    text-align: center;
}

.auth-card .form-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--auth-ink);
}

.auth-card .form-control {
    border-color: var(--auth-line);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: var(--auth-ink);
}

.auth-card .form-control:focus {
    border-color: #9db7ca;
    box-shadow: 0 0 0 3px rgba(10, 95, 140, 0.12);
}

.auth-card .form-text {
    color: var(--auth-muted);
    font-size: 0.8rem;
}

.auth-card .btn-primary {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
    border-radius: 8px;
    font-weight: 600;
    padding: 0.55rem 1rem;
}

.auth-card .btn-primary:hover,
.auth-card .btn-primary:focus {
    background: #084c70;
    border-color: #084c70;
}

.auth-links {
    margin-top: 1.15rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-links a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-flash {
    margin-bottom: 1rem;
}

.auth-flash .alert {
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.auth-flash .alert-success {
    background: #e8f6ef;
    color: #14532d;
    border-color: #c6e9d4;
}

.auth-flash .alert-danger,
.auth-flash .alert-warning {
    background: #fef2f1;
    color: var(--auth-danger);
    border-color: #f5c9c5;
}

.auth-flash .alert-warning {
    background: #fff8eb;
    color: #8a5a00;
    border-color: #f0dfb4;
}

.auth-flash a {
    color: inherit;
    font-weight: 600;
}

.auth-required {
    color: var(--auth-danger);
}

@media (max-width: 576px) {
    .auth-main {
        padding-top: 1.5rem;
    }
    .auth-card {
        padding: 1.35rem 1.15rem;
    }
}
