/*
 * Shared chrome for unauthenticated pages — login.php,
 * forgot-password.php, reset-password.php. Pulled out so the three
 * pages stay visually identical and we have one place to tweak.
 *
 * login.php currently keeps an inline <style> block; the rules
 * here are a copy so future changes can live in one file. Keep them
 * in sync until login.php is migrated.
 */

body { overflow: hidden; }

.cs-login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f4f6f9;
}
[data-bs-theme="dark"] .cs-login-wrap { background: #0f1117; }

.cs-login-hero {
    position: relative;
    padding: 56px 48px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, #007bff 0%, #19143b 100%);
    overflow: hidden;
}
.cs-login-hero::before,
.cs-login-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}
.cs-login-hero::before {
    width: 500px; height: 500px;
    background: radial-gradient(#8b5cf6, transparent 70%);
    top: -100px; right: -100px;
    animation: blob-float 18s ease-in-out infinite;
}
.cs-login-hero::after {
    width: 400px; height: 400px;
    background: radial-gradient(#10b981, transparent 70%);
    bottom: -150px; left: -50px;
    animation: blob-float 22s ease-in-out infinite reverse;
}
@keyframes blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -40px) scale(1.1); }
    66%      { transform: translate(-20px, 30px) scale(0.95); }
}
.cs-login-hero > * { position: relative; z-index: 1; }

.cs-login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
}
.cs-login-brand img { height: 40px; }

.cs-login-tagline {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.5px;
    margin: 0 0 16px;
}
.cs-login-sub {
    font-size: 1rem;
    opacity: 0.85;
    max-width: 440px;
    line-height: 1.55;
    margin-bottom: 22px;
}

.cs-login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
}
.cs-login-form-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px rgba(15, 17, 23, 0.06), 0 2px 6px rgba(15, 17, 23, 0.04);
    border: 1px solid rgba(15, 17, 23, 0.04);
}
[data-bs-theme="dark"] .cs-login-form-box {
    background: #181b24;
    border-color: #2a2d38;
    box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.cs-login-form-box h3 {
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}
.cs-login-form-box .subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 24px;
}
[data-bs-theme="dark"] .cs-login-form-box .subtitle { color: #9ca3af; }

.cs-login-form-box .form-label {
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 6px;
}
.cs-login-form-box .input-group-text {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #6b7280;
}
[data-bs-theme="dark"] .cs-login-form-box .input-group-text {
    background: #20232d;
    border-color: #2a2d38;
    color: #9ca3af;
}
.cs-login-form-box .form-control {
    border-color: #e5e7eb;
    transition: border-color 0.15s, box-shadow 0.15s;
}
[data-bs-theme="dark"] .cs-login-form-box .form-control {
    background: #20232d;
    border-color: #2a2d38;
    color: #e6e9ef;
}
.cs-login-form-box .input-group:focus-within .input-group-text {
    border-color: #007bff;
    color: #007bff;
}
.cs-login-form-box .input-group:focus-within .form-control {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.cs-login-submit {
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 14px rgba(0, 123, 255, 0.25);
    transition: transform 0.12s, box-shadow 0.15s;
}
.cs-login-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.32);
}
.cs-login-submit:disabled { opacity: 0.85; }
.cs-login-submit .spinner-border {
    width: 1rem; height: 1rem;
    border-width: 0.15em;
    margin-right: 0.4rem;
    display: none;
}
.cs-login-submit.is-loading .cs-submit-default { display: none; }
.cs-login-submit.is-loading .spinner-border { display: inline-block; }

.cs-login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #9ca3af;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cs-login-divider::before,
.cs-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
[data-bs-theme="dark"] .cs-login-divider::before,
[data-bs-theme="dark"] .cs-login-divider::after { background: #2a2d38; }

/* Tablet — keep two columns visible but compress them so the hero
 * doesn't dominate the form. */
@media (max-width: 991.98px) and (min-width: 640px) {
    body { overflow: auto; }
    .cs-login-wrap { grid-template-columns: 5fr 6fr; }
    .cs-login-hero { padding: 36px 28px; }
    .cs-login-tagline { font-size: 1.7rem; }
    .cs-login-sub { font-size: 0.9rem; }
    .cs-login-form-side { padding: 32px 24px; }
}

/* Phone — single column, form box keeps a card on mobile (was being
 * stripped which made dark mode look like a hole). Hero shrinks to
 * a logo-only banner so the form is visible above the fold. */
@media (max-width: 639.98px) {
    html, body { overflow: auto; height: auto; }
    body { background: #f4f6f9; }
    [data-bs-theme="dark"] body { background: #0f1117; }

    .cs-login-wrap {
        display: block;
        min-height: 100vh;
    }
    .cs-login-hero {
        padding: 28px 24px;
        min-height: 0;
    }
    .cs-login-hero::before,
    .cs-login-hero::after { display: none; }
    /* Hide both the marketing tagline and the supporting copy on
     * phone — only the logo+brand line should show in the slim
     * banner so the form is visible above the fold. */
    .cs-login-tagline { display: none; }
    .cs-login-sub     { display: none; }
    .cs-login-brand { font-size: 1.1rem; }
    .cs-login-brand img { height: 32px; }

    .cs-login-form-side {
        padding: 20px 16px 32px;
    }
    .cs-login-form-box {
        max-width: 100%;
        padding: 28px 22px;
        /* Keep the card on phone — without it dark mode shows the
         * page bg through and the form looks broken. */
        background: #ffffff;
        border: 1px solid rgba(15, 17, 23, 0.06);
        box-shadow: 0 6px 24px rgba(15, 17, 23, 0.06);
    }
    [data-bs-theme="dark"] .cs-login-form-box {
        background: #181b24;
        border-color: #2a2d38;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    }
}
