/**
 * Auth pages (login, register, forgot password) — mobile-first, calm layout.
 * Load Plus Jakarta Sans via a link tag in each page.
 */

.login-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    color: #0f172a;
    background: #eef2f7;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(12, 92, 140, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 50%, rgba(13, 148, 136, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, #f0f4f8 0%, #e8edf4 100%);
    -webkit-font-smoothing: antialiased;
}

.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.login-top {
    flex-shrink: 0;
    padding: 0.75rem 0 0.25rem;
    max-width: 36rem;
    margin: 0 auto;
    width: 100%;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    padding: 0.5rem 0.65rem;
    margin: -0.5rem;
    border-radius: 0.5rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.login-back:hover {
    color: #022b55;
    background: rgba(2, 43, 85, 0.06);
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 24px 48px -12px rgba(2, 43, 85, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: clamp(1.35rem, 4.5vw, 2rem);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    height: 3.25rem;
    width: auto;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.login-brand h1 {
    font-size: clamp(1.35rem, 4vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #022b55;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.login-tagline {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0;
}

.login-alert {
    border-radius: 0.75rem;
    border: none;
    font-size: 0.875rem;
    line-height: 1.45;
    padding: 0.75rem 1rem;
    margin-bottom: 1.1rem;
}

.login-alert.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.login-alert.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.login-form .form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.login-form .form-control {
    font-size: 1rem;
    padding: 0.8rem 1rem;
    min-height: 3rem;
    border-radius: 0.65rem;
    border: 1px solid #cbd5e1;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form .form-control:focus {
    border-color: #022b55;
    box-shadow: 0 0 0 3px rgba(2, 43, 85, 0.12);
}

.login-form .mb-field {
    margin-bottom: 1.1rem;
}

.login-submit {
    width: 100%;
    min-height: 3.1rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 0.65rem;
    border: none;
    background: linear-gradient(135deg, #022b55 0%, #0c4a6e 100%);
    color: #fff;
    margin-top: 0.25rem;
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 4px 14px rgba(2, 43, 85, 0.28);
}

.login-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 20px rgba(2, 43, 85, 0.32);
    color: #fff;
}

.login-submit:active {
    transform: scale(0.99);
}

a.login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

a.login-submit:hover {
    color: #fff;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.35rem 0 1rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #022b55;
    text-decoration: none;
    border-radius: 0.65rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.login-actions a:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #022b55;
}

.login-actions a.login-actions-primary {
    background: #fffbeb;
    border-color: rgba(245, 158, 11, 0.45);
    color: #92400e;
}

.login-actions a.login-actions-primary:hover {
    background: #fef3c7;
    border-color: rgba(245, 158, 11, 0.6);
    color: #78350f;
}

.login-meta {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid #f1f5f9;
}

.login-meta a {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
}

.login-meta a:hover {
    color: #022b55;
    text-decoration: underline;
}

.login-meta .dot {
    color: #cbd5e1;
    margin: 0 0.35rem;
}

.login-foot {
    text-align: center;
    margin-top: 0.85rem;
}

.login-foot a {
    font-size: 0.75rem;
    color: #94a3b8;
    text-decoration: none;
}

.login-foot a:hover {
    color: #64748b;
    text-decoration: underline;
}

.login-foot .dot {
    color: #e2e8f0;
    margin: 0 0.35rem;
}

@media (min-width: 400px) {
    .login-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .login-actions a {
        flex: 1;
        min-width: calc(50% - 0.18rem);
    }
}

/* Long forms (register): scroll comfortably on small phones */
.login-main.login-main--scroll {
    align-items: flex-start;
    padding-top: 0.5rem;
    padding-bottom: 2rem;
}

.login-card--wide {
    max-width: 32rem;
}

@media (min-width: 480px) {
    .login-card--wide {
        max-width: 36rem;
    }
}

.login-form .form-select {
    font-size: 1rem;
    padding: 0.8rem 1rem;
    min-height: 3rem;
    border-radius: 0.65rem;
    border: 1px solid #cbd5e1;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form .form-select:focus {
    border-color: #022b55;
    box-shadow: 0 0 0 3px rgba(2, 43, 85, 0.12);
}

.login-alert.alert-warning {
    background: #fffbeb;
    color: #92400e;
    word-break: break-word;
}

.login-alert.alert-warning a {
    color: #b45309;
    font-weight: 600;
    word-break: break-all;
}

.auth-intro {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 1.1rem;
}

.auth-otp-input {
    font-size: 1.35rem !important;
    letter-spacing: 0.2em;
    padding: 1rem 1rem !important;
    font-weight: 600;
}

.login-btn-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0;
    background: none;
    border: none;
    color: #022b55;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
}

.login-btn-link:hover {
    color: #0c4a6e;
}

.auth-start-over {
    font-size: 0.875rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.auth-start-over a {
    font-weight: 600;
    color: #022b55;
}

.reg-touch-check .form-check-input {
    width: 2.4rem;
    height: 2.4rem;
    margin-top: 0;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid #cbd5e1;
}

.reg-touch-check .form-check-input:checked {
    background-color: #022b55;
    border-color: #022b55;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='3'%3e%3cpath d='M6 10l3 3 6-6'/%3e%3c/svg%3e");
    background-position: center;
    background-size: 65% 65%;
    background-repeat: no-repeat;
}

.reg-touch-check .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(2, 43, 85, 0.2);
    border-color: #022b55;
}

.reg-touch-check .form-check-label {
    font-size: 0.9375rem;
    line-height: 1.45;
    padding: 0.35rem 0 0 0.25rem;
    cursor: pointer;
    color: #334155;
}

.reg-touch-check .form-check-label a {
    font-weight: 600;
    color: #022b55;
}

.reg-hint {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.login-already {
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 1.15rem;
    margin-bottom: 0;
}

.login-already a {
    font-weight: 700;
    color: #022b55;
    text-decoration: none;
}

.login-already a:hover {
    text-decoration: underline;
}
