/* Auth pages — login, forgot password (global, unscoped) */

/* ── Split-shell layout (login) ─────────────────────────────────────────── */

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    font-family: var(--font, "Inter", "Segoe UI", system-ui, sans-serif);
    background: var(--bg-page, #f8fafc);
}

.auth-shell--login {
    animation: authFadeIn 0.5s ease-out both;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hero panel */
.auth-hero {
    display: none;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #001e00 0%, #0a4a00 42%, #0d6b00 100%);
    color: #f8fafc;
    padding: clamp(2rem, 5vw, 3.5rem);
}

.auth-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: authOrbFloat 18s ease-in-out infinite alternate;
}

.auth-hero-orb--1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, #14a800 0%, transparent 70%);
    top: -120px;
    right: -80px;
}

.auth-hero-orb--2 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #3c8224 0%, transparent 70%);
    bottom: -60px;
    left: -40px;
    animation-delay: -6s;
}

.auth-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
}

@keyframes authOrbFloat {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(24px, -16px) scale(1.08);
    }
}

.auth-hero-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.75rem;
    animation: authSlideUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-hero-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    color: #86d275;
}

.auth-hero-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-hero-headline {
    margin: 0;
    font-size: clamp(1.75rem, 3.5vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #fff;
}

.auth-hero-lead {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.88);
    max-width: 42ch;
}

.auth-hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-hero-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.94rem;
    line-height: 1.5;
    color: rgba(241, 245, 249, 0.92);
}

.auth-hero-feature-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(20, 168, 0, 0.25);
    border: 1px solid rgba(120, 200, 120, 0.25);
    display: grid;
    place-items: center;
    color: #86d275;
}

.auth-hero-trust {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-hero-trust-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.auth-hero-trust-item strong {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #86d275;
}

.auth-hero-trust-item span {
    font-size: 0.86rem;
    color: rgba(203, 213, 225, 0.85);
}

.auth-hero-trust-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.12);
}

/* Form panel */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background:
        radial-gradient(ellipse 90% 60% at 50% -20%, rgba(20, 168, 0, 0.06) 0%, transparent 55%),
        var(--bg-page, #f8fafc);
}

.auth-panel-inner {
    width: 100%;
    max-width: 440px;
    animation: authSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.auth-panel-brand--mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #111827);
}

.auth-panel-brand--mobile .auth-brand-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 0;
}

.auth-panel-legal {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted, #9ca3af);
}

/* ── Legacy centered layout (forgot password) ─────────────────────────────── */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(20, 168, 0, 0.1) 0%, transparent 55%),
        var(--bg-page, #f8fafc);
    font-family: var(--font, "Inter", "Segoe UI", system-ui, sans-serif);
}

.auth-wrap {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--brand-primary-light, #e4f3df);
    color: var(--brand-primary, #14a800);
    display: grid;
    place-items: center;
    margin-bottom: 0.85rem;
    border: 1px solid #b6e0aa;
}

.auth-brand-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #111827);
}

.auth-brand-tagline {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.4;
}

/* ── Shared card & form ───────────────────────────────────────────────────── */

.auth-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-xl, 20px);
    padding: clamp(1.5rem, 4vw, 2rem);
    box-shadow: var(--shadow-md, 0 4px 24px rgba(15, 23, 42, 0.06));
}

.auth-card--elevated {
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 32px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.25s ease;
}

.auth-card-header {
    margin-bottom: 1.5rem;
}

.auth-card h2 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.35rem, 3vw, 1.55rem);
    font-weight: 700;
    color: var(--text-primary, #111827);
    letter-spacing: -0.03em;
}

.auth-card-subtitle {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
}

/* Login details — colored form box */
.login-details-box {
    background: linear-gradient(160deg, #0a5200 0%, #14a800 52%, #108a00 100%);
    border-radius: 16px;
    padding: 1.35rem 1.25rem 1.25rem;
    border: 1px solid rgba(120, 200, 120, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 10px 28px rgba(20, 168, 0, 0.22);
}

.login-details-box-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.login-details-box-badge {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: grid;
    place-items: center;
    color: #d7efd0;
}

.login-details-box-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.login-details-box-hint {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: rgba(215, 239, 208, 0.88);
    line-height: 1.4;
}

.login-details-alert {
    margin-bottom: 1rem;
    background: #fff;
    border-color: #fecaca;
}

.login-details-form {
    gap: 1rem;
}

.login-details-box .auth-field label {
    color: #e4f3df;
    font-weight: 600;
}

.login-details-box .auth-input {
    background: #fff;
    border-color: rgba(255, 255, 255, 0.9);
    color: #0f172a;
}

.login-details-box .auth-input:hover {
    border-color: #b6e0aa;
}

.login-details-box .auth-input:focus {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.login-details-box .auth-input-icon {
    color: #64748b;
}

.login-details-box .auth-input-wrap:focus-within .auth-input-icon {
    color: #14a800;
}

.login-details-box .auth-remember {
    color: rgba(226, 232, 240, 0.95);
}

.login-details-box .auth-remember-box {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.12);
}

.login-details-box .auth-remember input:checked + .auth-remember-box {
    background: #fff;
    border-color: #fff;
}

.login-details-box .auth-remember input:checked + .auth-remember-box::after {
    border-color: #14a800;
}

.login-details-box .auth-link {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.login-details-box .auth-link:hover {
    color: #d7efd0;
}

.auth-submit--in-box {
    background: #fff;
    color: #108a00;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.auth-submit--in-box:hover {
    background: #f8fafc;
    color: #0d6b00;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    animation: authAlertIn 0.35s ease-out both;
}

@keyframes authAlertIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.auth-alert-error {
    background: var(--danger-bg, #fef2f2);
    color: var(--danger, #dc2626);
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background: var(--success-bg, #ecfdf5);
    color: var(--success, #059669);
    border: 1px solid #a7f3d0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.auth-field label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary, #334155);
    letter-spacing: 0.01em;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-muted, #94a3b8);
    display: flex;
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.72rem 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary, #111827);
    background: var(--bg-surface, #fff);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input--with-icon {
    padding-left: 2.65rem;
}

.auth-input--with-toggle {
    padding-right: 2.65rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.auth-password-toggle:hover {
    color: var(--brand-primary, #14a800);
    background: rgba(20, 168, 0, 0.08);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--brand-primary, #14a800);
    outline-offset: 2px;
}

.auth-password-icon {
    display: block;
}

.auth-password-icon--hide {
    display: none;
}

.auth-password-toggle.is-visible .auth-password-icon--show {
    display: none;
}

.auth-password-toggle.is-visible .auth-password-icon--hide {
    display: block;
}

.login-details-box .auth-password-toggle {
    color: #64748b;
}

.login-details-box .auth-password-toggle:hover {
    color: #14a800;
    background: rgba(255, 255, 255, 0.55);
}

.auth-input::placeholder {
    color: var(--text-muted, #94a3b8);
}

.auth-input:hover {
    border-color: #cbd5e1;
}

.auth-input:focus {
    outline: none;
    border-color: var(--brand-primary, #14a800);
    box-shadow: 0 0 0 4px rgba(20, 168, 0, 0.12);
    background: #fff;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--brand-primary, #14a800);
}

.auth-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.25rem;
}

.auth-row-split {
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.1rem;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.auth-remember input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    margin: 0;
}

.auth-remember-box {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}

.auth-remember-box::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    margin-top: -2px;
    transition: transform 0.15s ease;
}

.auth-remember input:checked + .auth-remember-box {
    background: var(--brand-primary, #14a800);
    border-color: var(--brand-primary, #14a800);
}

.auth-remember input:checked + .auth-remember-box::after {
    transform: rotate(45deg) scale(1);
}

.auth-remember input:focus-visible + .auth-remember-box {
    box-shadow: 0 0 0 3px rgba(20, 168, 0, 0.25);
}

.auth-link {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--brand-primary, #14a800);
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: var(--brand-primary-hover, #108a00);
    text-decoration: underline;
}

.auth-link:focus-visible {
    outline: 2px solid var(--brand-primary, #14a800);
    outline-offset: 3px;
    border-radius: 4px;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.82rem 1.15rem;
    font-size: 0.96rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(180deg, #14a800 0%, #108a00 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 82, 217, 0.2), 0 4px 14px rgba(20, 168, 0, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-submit-arrow {
    transition: transform 0.2s ease;
}

.auth-submit:hover {
    background: linear-gradient(180deg, #129500 0%, #0d6b00 100%);
    box-shadow: 0 2px 4px rgba(0, 82, 217, 0.25), 0 8px 20px rgba(20, 168, 0, 0.32);
    transform: translateY(-1px);
}

.auth-submit:hover .auth-submit-arrow {
    transform: translateX(3px);
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 82, 217, 0.2);
}

.auth-submit:focus-visible {
    outline: 2px solid var(--brand-primary, #14a800);
    outline-offset: 3px;
}

.auth-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light, #f1f5f9);
    text-align: center;
}

.auth-footer p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
}

.auth-footer-muted {
    color: var(--text-muted, #94a3b8);
}

.auth-footer a {
    font-weight: 600;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (min-width: 960px) {
    .auth-shell--login {
        grid-template-columns: minmax(380px, 1.05fr) minmax(420px, 0.95fr);
    }

    .auth-hero {
        display: flex;
        align-items: center;
    }

    .auth-panel-brand--mobile {
        display: none;
    }

    .auth-panel {
        padding: 2.5rem 3rem;
    }
}

@media (max-width: 959px) {
    .auth-panel {
        align-items: flex-start;
        padding-top: clamp(2rem, 8vh, 3.5rem);
    }
}

@media (max-width: 480px) {
    .auth-page {
        padding: 1.25rem 1rem;
        align-items: flex-start;
        padding-top: 2.5rem;
    }

    .auth-card {
        padding: 1.35rem 1.25rem 1.2rem;
        border-radius: 16px;
    }

    .auth-row-split {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell--login,
    .auth-hero-content,
    .auth-panel-inner,
    .auth-alert,
    .auth-hero-orb {
        animation: none;
    }

    .auth-submit,
    .auth-submit-arrow,
    .auth-input,
    .auth-card--elevated {
        transition: none;
    }
}
