/* ==========================================================================
   Green RF Cell — authentication pages (sign in, sign up, password reset)
   ========================================================================== */
:root {
    --brand: #22c55e;
    --brand-600: #16a34a;
    --brand-700: #15803d;
    --accent: #2f7cf6;
    --ink: #0b1220;
    --ink-2: #111a2e;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --bg: #f5f7fb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warn: #b45309;
    --warn-bg: #fffbeb;
    --ok: #15803d;
    --ok-bg: #f0fdf4;
    --info-bg: #eff6ff;
    --radius: 14px;
    --shadow: 0 20px 50px -20px rgba(15, 23, 42, .25), 0 2px 6px rgba(15, 23, 42, .05);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; font-weight: 500; }
a:hover { color: var(--brand-700); text-decoration: underline; }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Brand panel ---------- */
.brand-panel {
    position: relative;
    overflow: hidden;
    color: #e2e8f0;
    background:
        radial-gradient(1000px 600px at 10% -10%, rgba(34, 197, 94, .28), transparent 60%),
        radial-gradient(800px 500px at 110% 110%, rgba(47, 124, 246, .25), transparent 60%),
        linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.brand-panel canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; opacity: .9;
}
.brand-panel > *:not(canvas) { position: relative; z-index: 1; }

.brand-logo { display: inline-flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand-logo:hover { text-decoration: none; color: #fff; }
.brand-logo img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(34,197,94,.45)); }
.brand-logo span b { color: var(--brand); }

.brand-copy { max-width: 480px; margin: 40px 0; }
.brand-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
    color: #86efac; background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .3); padding: 6px 12px; border-radius: 999px;
}
.brand-eyebrow .pulse {
    width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
    box-shadow: 0 0 0 0 rgba(34,197,94,.7); animation: pulse 2s infinite;
}
.brand-copy h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: clamp(2rem, 3.2vw, 2.9rem); line-height: 1.1; color: #fff;
    margin: 18px 0 14px; letter-spacing: -.02em;
}
.gradient-text {
    background: linear-gradient(90deg, #4ade80, #22d3ee, #60a5fa, #4ade80);
    background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: shimmer 8s linear infinite;
}
.brand-copy p { color: #94a3b8; font-size: 1.02rem; line-height: 1.65; }

.brand-features { list-style: none; display: grid; gap: 14px; margin-top: 28px; }
.brand-features li {
    display: flex; gap: 12px; align-items: center; color: #cbd5e1; font-size: .95rem;
    opacity: 0; transform: translateX(-12px); animation: slideIn .7s var(--ease) forwards;
}
.brand-features li:nth-child(2) { animation-delay: .12s; }
.brand-features li:nth-child(3) { animation-delay: .24s; }
.brand-features li:nth-child(4) { animation-delay: .36s; }
.brand-features .ico {
    width: 34px; height: 34px; flex: none; border-radius: 10px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #4ade80;
}
.brand-foot { color: #64748b; font-size: .82rem; }

/* ---------- Form side ---------- */
.form-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    width: 100%; max-width: 440px;
    background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
    border: 1px solid var(--line);
    padding: 36px 36px 30px;
    animation: rise .7s var(--ease) both;
}
.auth-card h2 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.6rem; letter-spacing: -.01em; margin-bottom: 6px;
}
.auth-card .sub { color: var(--muted); font-size: .95rem; margin-bottom: 22px; }

/* Tabs */
.tabs {
    position: relative; display: grid; grid-template-columns: 1fr 1fr;
    background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 26px;
}
.tabs button {
    position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
    padding: 10px 0; font: 600 .92rem 'Inter', sans-serif; color: var(--muted);
    border-radius: 9px; transition: color .3s;
}
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs .indicator {
    position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
    background: #fff; border-radius: 9px; box-shadow: 0 2px 8px rgba(15,23,42,.08);
    transition: transform .45s var(--ease);
}
.tabs[data-active="signup"] .indicator { transform: translateX(100%); }

.pane { display: none; }
.pane.active { display: block; animation: fadeSlide .5s var(--ease); }

/* Fields */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: #334155; }
.input-wrap { position: relative; }
.input-wrap .lead {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; pointer-events: none; transition: color .2s; font-size: .9rem;
}
.field input[type=text], .field input[type=email], .field input[type=password] {
    width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 11px;
    padding: 0 44px 0 40px; font: 400 .95rem 'Inter', sans-serif; color: var(--text);
    background: #fff; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: #a0aec0; }
.field input:hover { border-color: #cbd5e1; }
.field input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .15);
}
.input-wrap:focus-within .lead { color: var(--brand-600); }
.field.invalid input { border-color: var(--danger); background: #fffafa; }
.field.invalid input:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }
.field.valid input { border-color: #86efac; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.field-error:empty { display: none; }
.field.invalid .input-wrap { animation: shake .35s; }

.toggle-pw {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: 0; background: none; width: 32px; height: 32px; border-radius: 8px;
    color: #94a3b8; cursor: pointer; display: grid; place-items: center;
}
.toggle-pw:hover { color: var(--text); background: #f1f5f9; }

/* Strength meter */
.strength { margin-top: 8px; display: none; }
.strength.show { display: block; }
.strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.strength-bars span { height: 4px; border-radius: 4px; background: #e2e8f0; transition: background .3s; }
.strength-label { font-size: .75rem; color: var(--muted); margin-top: 5px; }
.strength[data-score="1"] .strength-bars span:nth-child(-n+1) { background: #ef4444; }
.strength[data-score="2"] .strength-bars span:nth-child(-n+2) { background: #f59e0b; }
.strength[data-score="3"] .strength-bars span:nth-child(-n+3) { background: #84cc16; }
.strength[data-score="4"] .strength-bars span:nth-child(-n+4) { background: var(--brand); }

.row-between { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 20px; font-size: .88rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: #475569; }
.check input { width: 16px; height: 16px; accent-color: var(--brand-600); }

/* Buttons */
.btn {
    position: relative; overflow: hidden;
    width: 100%; height: 48px; border: 0; border-radius: 12px; cursor: pointer;
    font: 600 .98rem 'Inter', sans-serif; color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
    box-shadow: 0 10px 24px -10px rgba(22, 163, 74, .7);
    transition: transform .2s var(--ease), box-shadow .2s, filter .2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(22, 163, 74, .75); filter: brightness(1.03); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(34,197,94,.4); outline-offset: 2px; }
.btn[disabled] { cursor: progress; filter: saturate(.7); }
.btn .spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .label { opacity: .85; }
.btn::after {
    content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-20deg); transition: left .7s;
}
.btn:hover::after { left: 140%; }
.btn-ghost {
    background: #fff; color: var(--text); border: 1.5px solid var(--line); box-shadow: none;
}
.btn-ghost:hover { border-color: #cbd5e1; box-shadow: none; }

.muted-line { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 18px; }
.legal { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 16px; line-height: 1.5; }

/* Alerts */
.alerts { display: grid; gap: 10px; margin-bottom: 18px; }
.alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
    font-size: .88rem; line-height: 1.45; border: 1px solid transparent;
    animation: fadeSlide .45s var(--ease);
}
.alert i { margin-top: 2px; }
.alert.error { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.alert.warning { background: var(--warn-bg); color: var(--warn); border-color: #fde68a; }
.alert.success { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.alert.info { background: var(--info-bg); color: #1d4ed8; border-color: #bfdbfe; }

/* Status illustration for simple pages */
.status-icon {
    width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center;
    font-size: 1.8rem; color: var(--brand-600); background: var(--ok-bg); margin-bottom: 18px;
    animation: pop .6s var(--ease) both;
}
.status-icon.warn { color: var(--warn); background: var(--warn-bg); }

.back-home { display: inline-flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.back-home:hover { color: var(--text); text-decoration: none; }

/* Hidden honeypot */
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: 300% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,.7); }
    70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .brand-panel { padding: 28px 24px; min-height: auto; }
    .brand-copy { margin: 22px 0 6px; }
    .brand-copy h1 { font-size: 1.7rem; }
    .brand-features, .brand-foot { display: none; }
    .form-panel { padding: 24px 16px 40px; margin-top: -24px; }
}
@media (max-width: 480px) {
    .auth-card { padding: 26px 20px 22px; border-radius: 16px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
