/* Leader login — /login */

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
}

.login-page--signed-in {
    grid-template-columns: 1fr;
}

.login-right--full {
    min-height: 60vh;
}

/* ── Brand panel ── */
.login-left {
    background: linear-gradient(160deg, #1e3418 0%, #2d4d27 40%, #437037 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -50deg,
        rgba(255, 255, 255, 0.025) 0px,
        rgba(255, 255, 255, 0.025) 1px,
        transparent 1px,
        transparent 24px
    );
    pointer-events: none;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(106, 179, 86, 0.1);
    pointer-events: none;
}

.login-left .ll-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 340px;
}

.login-left .fdl-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    backdrop-filter: blur(6px);
}

.login-left h1 {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin: 0 0 6px;
}

.login-left .ll-sub {
    font-size: 0.78rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 40px;
}

.login-camp-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 18px 20px;
    text-align: left;
    width: 100%;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.login-camp-card .lcc-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(163, 232, 122, 0.85);
    margin-bottom: 6px;
}

.login-camp-card .lcc-date {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.login-camp-card .lcc-venue {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

.login-camp-mobile-line {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 4px;
    line-height: 1.35;
}

.login-legal {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
    text-align: left;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.login-legal strong {
    color: rgba(255, 255, 255, 0.55);
}

/* ── Form panel ── */
.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    background: #f7f9f7;
}

.login-form-wrap {
    width: 100%;
    max-width: 400px;
}

.login-form-error {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.45;
}

.login-form-error.is-visible {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.login-form-error i {
    flex-shrink: 0;
    margin-top: 1px;
}

.login-field.is-invalid .form-control {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

/* Step indicator */
.login-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 36px;
}

.login-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
}

.login-step .step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: all 0.3s;
}

.login-step.active .step-num {
    background: #437037;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(67, 112, 55, 0.15);
}

.login-step.done .step-num {
    background: #d1fae5;
    color: #065f46;
}

.login-step.inactive .step-num {
    background: #e9ede9;
    color: #aaa;
}

.login-step .step-label {
    font-size: 0.72rem;
    font-weight: 700;
    transition: color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-step.active .step-label { color: #437037; }
.login-step.done .step-label { color: #065f46; }
.login-step.inactive .step-label { color: #bbb; }

.login-step-connector {
    flex: 1 1 auto;
    width: auto;
    min-width: 48px;
    height: 2px;
    background: #e0e8e0;
    flex-shrink: 1;
    margin: 0 10px;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    align-self: center;
}

.login-step-connector .connector-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #437037;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 2px;
}

.login-step-connector.filled .connector-fill { width: 100%; }

.login-form-heading {
    margin-bottom: 28px;
}

.login-form-heading h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1a2e16;
    margin: 0 0 6px;
}

.login-form-heading p {
    font-size: 0.82rem;
    color: #8a9e85;
    margin: 0;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #3a4e36;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.login-field .form-control {
    background: #fff !important;
    border: 1.5px solid #d8e2d8;
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 0.92rem;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.login-field .form-control:focus {
    border-color: #437037;
    box-shadow: 0 0 0 3px rgba(67, 112, 55, 0.12);
    outline: none;
}

.otp-input {
    font-size: 2rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.3em !important;
    text-align: center !important;
    border: 2px solid #437037 !important;
    box-shadow: 0 0 0 4px rgba(67, 112, 55, 0.1) !important;
    padding: 16px !important;
    color: #2d4d27 !important;
}

.login-submit {
    width: 100%;
    background: linear-gradient(135deg, #437037 0%, #2d4d27 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(67, 112, 55, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.login-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #355a2c 0%, #243d1f 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(67, 112, 55, 0.38);
}

.login-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #8a9e85;
    text-decoration: none;
    margin-top: 16px;
    font-weight: 600;
    transition: color 0.15s;
}

.login-back:hover { color: #437037; }

.login-already-card {
    background: #fff;
    border: 1.5px solid #e5eae5;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    max-width: 420px;
    width: 100%;
}

.login-already-card .check-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(67, 112, 55, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #437037;
    margin-bottom: 18px;
}

.login-already-card h2 {
    font-weight: 900;
    font-size: 1.4rem;
    color: #1a2e16;
    margin-bottom: 8px;
}

.login-already-card p {
    color: #7a8f76;
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.tfa-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(67, 112, 55, 0.07);
    border: 1px solid rgba(67, 112, 55, 0.18);
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 0.78rem;
    color: #4a6644;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tfa-hint > span {
    flex: 1;
    min-width: 0;
}

.tfa-hint i {
    flex-shrink: 0;
    color: #437037;
    margin-top: 2px;
    font-size: 1rem;
    line-height: 1.4;
}

.login-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.login-auth-tab {
    flex: 1;
    border: 1.5px solid #d8e2d8;
    background: #fff;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #666;
    cursor: pointer;
}

.login-auth-tab.active {
    border-color: #437037;
    background: #f0fdf4;
    color: #2d4d27;
}

.login-passkey-panel { display: none; }
.login-passkey-panel.active { display: block; }
.login-code-panel.active { display: block; }
.login-code-panel { display: none; }

/* Mobile legal toggle (form area) */
.login-legal-mobile {
    margin-top: 20px;
    border-top: 1px solid #e0e8e0;
    padding-top: 16px;
}

.login-legal-toggle {
    width: 100%;
    background: #fff;
    border: 1.5px solid #d8e2d8;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5a6e56;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.login-legal-toggle i {
    transition: transform 0.2s;
}

.login-legal-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.login-legal-panel {
    margin-top: 10px;
    padding: 12px 14px;
    background: #f0f4f0;
    border-radius: 9px;
    font-size: 0.72rem;
    color: #5a6e56;
    line-height: 1.55;
}

.login-legal-panel[hidden] {
    display: none !important;
}

.login-legal-panel strong {
    color: #3a4e36;
}

/* ── Mobile ── */
@media (max-width: 767.98px) {
    .login-page {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
        min-height: 100dvh;
    }

    .login-left {
        padding: 20px 20px 18px;
        min-height: 0;
        flex-shrink: 0;
        justify-content: flex-start;
    }

    .login-left .ll-inner {
        max-width: none;
    }

    .login-left .fdl-ring {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }

    .login-left .fdl-ring img {
        width: 32px;
        height: auto;
    }

    .login-left h1 {
        font-size: 1.05rem;
        letter-spacing: 0.06em;
        margin-bottom: 4px;
    }

    .login-left .ll-sub {
        margin-bottom: 10px;
        font-size: 0.68rem;
    }

    .login-brand-desktop,
    .login-legal--desktop {
        display: none !important;
    }

    .login-right {
        padding: 22px 20px 28px;
        flex: 1;
        align-items: flex-start;
    }

    .login-form-wrap {
        max-width: none;
    }

    .login-steps {
        margin-bottom: 20px;
    }

    .login-step .step-label {
        font-size: 0.62rem;
    }

    .login-step-connector {
        min-width: 32px;
        margin: 0 8px;
    }

    .login-form-heading {
        margin-bottom: 20px;
    }

    .login-form-heading h2 {
        font-size: 1.25rem;
    }

    .login-submit {
        margin-top: 16px;
    }

    .login-page--signed-in .login-right {
        min-height: calc(100dvh - 52px);
        align-items: center;
    }
}

@media (min-width: 768px) {
    .login-camp-mobile-line,
    .login-legal-mobile {
        display: none !important;
    }
}

/* ── Dark mode ── */
html[data-theme="dark"] .login-page {
    background: var(--camp-bg-muted);
}

html[data-theme="dark"] .login-right {
    background: var(--camp-bg-muted);
}

/* Brand panel — leader portal & camp card */
html[data-theme="dark"] .login-left {
    background:
        radial-gradient(ellipse 85% 70% at 50% 0%, rgba(106, 179, 86, 0.1) 0%, transparent 55%),
        linear-gradient(168deg, #060906 0%, #0a0f0a 30%, #0f1410 55%, #141c14 80%, #1a2618 100%);
}

html[data-theme="dark"] .login-left::before {
    background-image: repeating-linear-gradient(
        -50deg,
        rgba(106, 179, 86, 0.035) 0px,
        rgba(106, 179, 86, 0.035) 1px,
        transparent 1px,
        transparent 24px
    );
}

html[data-theme="dark"] .login-left::after {
    background: rgba(106, 179, 86, 0.07);
}

html[data-theme="dark"] .login-left .fdl-ring {
    background: rgba(106, 179, 86, 0.1);
    border-color: rgba(106, 179, 86, 0.32);
    box-shadow:
        0 0 0 1px rgba(106, 179, 86, 0.1),
        0 8px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .login-left h1 {
    color: var(--camp-text);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .login-left .ll-sub {
    color: rgba(163, 217, 138, 0.65);
    opacity: 1;
}

html[data-theme="dark"] .login-camp-mobile-line {
    color: rgba(232, 236, 232, 0.9);
}

html[data-theme="dark"] .login-camp-card {
    background: rgba(8, 12, 7, 0.55);
    border-color: rgba(106, 179, 86, 0.28);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .login-camp-card .lcc-label {
    color: #a3d98a;
}

html[data-theme="dark"] .login-camp-card .lcc-name,
html[data-theme="dark"] .login-camp-card .lcc-date {
    color: var(--camp-text);
}

html[data-theme="dark"] .login-camp-card .lcc-venue {
    color: var(--camp-text-muted);
}

html[data-theme="dark"] .login-legal {
    color: rgba(156, 170, 160, 0.65);
    border-top-color: rgba(106, 179, 86, 0.18);
}

html[data-theme="dark"] .login-legal strong {
    color: rgba(197, 230, 184, 0.85);
}

html[data-theme="dark"] .login-form-heading h2,
html[data-theme="dark"] .login-already-card h2 {
    color: var(--camp-text);
}

html[data-theme="dark"] .login-form-heading p,
html[data-theme="dark"] .login-field label,
html[data-theme="dark"] .login-back,
html[data-theme="dark"] .login-already-card p {
    color: var(--camp-text-muted);
}

html[data-theme="dark"] .login-field .form-control,
html[data-theme="dark"] .login-already-card,
html[data-theme="dark"] .otp-input {
    background: var(--camp-input-bg);
    border-color: var(--camp-input-border);
    color: var(--camp-text);
}

html[data-theme="dark"] .login-auth-tab {
    background: var(--camp-input-bg);
    border-color: var(--camp-input-border);
    color: var(--camp-text-muted);
}

html[data-theme="dark"] .login-auth-tab.active {
    background: rgba(106, 179, 86, 0.15);
    border-color: rgba(106, 179, 86, 0.45);
    color: #c5e6b8;
}

html[data-theme="dark"] .login-step.inactive .step-label {
    color: var(--camp-text-muted);
}

html[data-theme="dark"] .login-step.active .step-label {
    color: #a3d98a;
}

html[data-theme="dark"] .login-step.done .step-num {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

html[data-theme="dark"] .login-step.inactive .step-num {
    background: var(--camp-surface-raised);
    color: var(--camp-text-muted);
}

html[data-theme="dark"] .login-step-connector {
    background: var(--camp-border);
}

html[data-theme="dark"] .tfa-hint {
    background: rgba(106, 179, 86, 0.1);
    border-color: rgba(106, 179, 86, 0.25);
    color: #c5d4c5;
}

html[data-theme="dark"] .login-form-error {
    background: rgba(127, 29, 29, 0.25);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

html[data-theme="dark"] .login-legal-toggle {
    background: var(--camp-input-bg);
    border-color: var(--camp-input-border);
    color: var(--camp-text-muted);
}

html[data-theme="dark"] .login-legal-panel {
    background: var(--camp-surface-raised);
    color: var(--camp-text-muted);
}

html[data-theme="dark"] .login-legal-panel strong {
    color: var(--camp-text);
}

html[data-theme="dark"] .login-step.active .step-num {
    background: #6ab356;
    color: #0f1410;
    box-shadow: 0 0 0 4px rgba(106, 179, 86, 0.2);
}

html[data-theme="dark"] .login-step.done .step-label {
    color: #6ee7b7;
}

html[data-theme="dark"] .login-step-connector .connector-fill {
    background: #6ab356;
}

html[data-theme="dark"] .login-field .form-control:focus {
    border-color: #6ab356;
    box-shadow: 0 0 0 3px rgba(106, 179, 86, 0.18);
}

html[data-theme="dark"] .login-field.is-invalid .form-control {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}

html[data-theme="dark"] .otp-input {
    border-color: #6ab356 !important;
    box-shadow: 0 0 0 4px rgba(106, 179, 86, 0.12) !important;
    color: var(--camp-text) !important;
}

html[data-theme="dark"] .login-back:hover {
    color: #a3d98a;
}

html[data-theme="dark"] .login-already-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .login-already-card .check-ring {
    background: rgba(106, 179, 86, 0.15);
    color: #a3d98a;
}

html[data-theme="dark"] .tfa-hint strong {
    color: var(--camp-text);
}

html[data-theme="dark"] .tfa-hint i {
    color: #a3d98a;
}

html[data-theme="dark"] .login-passkey-panel .text-muted {
    color: var(--camp-text-muted) !important;
}

html[data-theme="dark"] .login-legal-mobile {
    border-top-color: var(--camp-border);
}

html[data-theme="dark"] .login-form-heading p strong,
html[data-theme="dark"] .login-field label strong {
    color: var(--camp-text);
}
