/* ═══════════════════════════════════════════════════
   ResearchPro — Login Page Stylesheet
   Themes: dark | grey | light
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=Space+Mono:wght@400;700&display=swap');

/* ── THEME TOKENS ───────────────────────────────── */
:root {
    --accent:  #00FFB2;
    --accent2: #FF3CAC;
    --accent3: #7B5EA7;
}

[data-theme="dark"] {
    --bg:       #080B0F;
    --bg2:      #0F1318;
    --surface:  #1A2130;
    --border:   rgba(255,255,255,0.07);
    --text:     #F0F4FF;
    --text2:    #8A95A8;
    --text3:    #4A5568;
    --card-bg:  rgba(26,33,48,0.9);
    --glow:     rgba(0,255,178,0.15);
    --orb1:     rgba(0,255,178,0.10);
    --orb2:     rgba(255,60,172,0.09);
    --orb3:     rgba(123,94,167,0.10);
    --input-bg: rgba(15,19,24,0.8);
    --left-bg:  #080B0F;
}

[data-theme="light"] {
    --bg:       #F7F9FC;
    --bg2:      #EDF0F5;
    --surface:  #FFFFFF;
    --border:   rgba(0,0,0,0.09);
    --text:     #0D1117;
    --text2:    #4A5568;
    --text3:    #A0AEC0;
    --card-bg:  rgba(255,255,255,0.96);
    --glow:     rgba(0,200,140,0.08);
    --orb1:     rgba(0,200,140,0.10);
    --orb2:     rgba(255,60,172,0.07);
    --orb3:     rgba(123,94,167,0.08);
    --input-bg: #F7F9FC;
    --left-bg:  #0D1117;
}

[data-theme="grey"] {
    --bg:       #17171E;
    --bg2:      #1E1E28;
    --surface:  #2C2C3C;
    --border:   rgba(255,255,255,0.06);
    --text:     #D4D4E8;
    --text2:    #7070A0;
    --text3:    #404060;
    --card-bg:  rgba(44,44,60,0.92);
    --glow:     rgba(0,255,178,0.10);
    --orb1:     rgba(0,255,178,0.07);
    --orb2:     rgba(255,60,172,0.06);
    --orb3:     rgba(123,94,167,0.08);
    --input-bg: rgba(23,23,30,0.8);
    --left-bg:  #17171E;
}

/* ── RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; height: 100%; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    transition: background 0.4s, color 0.4s;
    overflow-x: hidden;
    position: relative;
}

/* Noise overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9000;
    opacity: 0.35;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ── CURSOR GLOW ────────────────────────────────── */
.cursor-glow {
    position: fixed;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: var(--glow);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    filter: blur(70px);
    transition: left 0.08s, top 0.08s;
}

/* ── BACKGROUND ─────────────────────────────────── */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}
.orb-1 { width: 500px; height: 500px; top: -150px; left: -100px; background: var(--orb1); }
.orb-2 { width: 400px; height: 400px; bottom: -100px; right: -80px; background: var(--orb2); }
.orb-3 { width: 300px; height: 300px; top: 40%; left: 30%; background: var(--orb3); }

/* ── THEME BAR ──────────────────────────────────── */
.theme-bar {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    z-index: 8000;
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.theme-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text2);
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.theme-btn.active,
.theme-btn:hover { background: var(--accent); color: #000; }

/* ── LAYOUT ─────────────────────────────────────── */
.login-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ── LEFT PANEL ─────────────────────────────────── */
.left-panel {
    flex: 0 0 48%;
    background: var(--left-bg);
    border-right: 1px solid var(--border);
    padding: 2.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    bottom: -100px; left: -80px;
    background: radial-gradient(circle, rgba(0,255,178,0.08), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text2);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.03em;
    transition: color 0.2s, gap 0.2s;
    width: fit-content;
    margin-bottom: 3rem;
}
.back-link:hover { color: var(--accent); gap: 0.8rem; }

.left-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* Brand */
.brand {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    letter-spacing: 0.04em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 2rem;
}
.brand-accent { color: var(--accent); }
.brand-dot {
    width: 9px; height: 9px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 2.2s ease infinite;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.5); opacity: 0.6; }
}

/* Left title */
.left-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.6rem, 4vw, 3.8rem);
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 1.2rem;
}
.left-title em { font-style: normal; color: var(--accent); }

.left-sub {
    font-size: 0.95rem;
    color: var(--text2);
    line-height: 1.7;
    max-width: 400px;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Feature Pills */
.feat-pills { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2.5rem; }

.pill {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.25s, transform 0.25s;
    cursor: default;
}
.pill:hover { border-color: rgba(0,255,178,0.25); transform: translateX(4px); }

.pill > i {
    width: 36px; height: 36px;
    background: rgba(0,255,178,0.1);
    border: 1px solid rgba(0,255,178,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.95rem;
    flex-shrink: 0;
}
.pill-title { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 0.1rem; }
.pill-sub   { font-size: 0.75rem; color: var(--text2); }

/* Social proof */
.social-proof {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.avatars { display: flex; }
.av {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    margin-left: -8px;
}
.av:first-child { margin-left: 0; }
.proof-text { font-size: 0.8rem; color: var(--text2); line-height: 1.4; }
.proof-text strong { color: var(--text); }

/* Decorative ring */
.deco-ring {
    position: absolute;
    bottom: -140px; right: -140px;
    width: 380px; height: 380px;
    border: 1px dashed rgba(0,255,178,0.12);
    border-radius: 50%;
    animation: spin-slow 30s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ── RIGHT PANEL ─────────────────────────────────── */
.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: var(--bg);
}

.form-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Form Header */
.form-header { margin-bottom: 2rem; }
.form-header h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.03em;
    color: var(--text);
    margin-bottom: 0.3rem;
}
.form-header p { font-size: 0.88rem; color: var(--text2); }

/* Flash Messages */
.flash-msg {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    position: relative;
}
.flash-error   { background: rgba(220,53,69,0.12);  border: 1px solid rgba(220,53,69,0.3);  color: #ff6b7a; }
.flash-success { background: rgba(0,255,178,0.08);  border: 1px solid rgba(0,255,178,0.25); color: var(--accent); }
.flash-warning { background: rgba(255,179,0,0.1);   border: 1px solid rgba(255,179,0,0.3);  color: #FFB300; }
.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.8rem;
    padding: 2px 4px;
}
.flash-close:hover { opacity: 1; }

/* Field Groups */
.field-group { margin-bottom: 1.3rem; }
.field-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 0.5rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-family: 'Space Mono', monospace;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text3);
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.25s;
    z-index: 1;
}

.field-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field-input::placeholder { color: var(--text3); }
.field-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,255,178,0.12);
    background: var(--surface);
}
.input-wrap:focus-within .input-icon { color: var(--accent); }

.toggle-pw {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    transition: color 0.2s;
    z-index: 1;
}
.toggle-pw:hover { color: var(--accent); }

/* Form Row */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.6rem;
}

/* Custom Checkbox */
.check-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text2);
    cursor: pointer;
    user-select: none;
}
.check-label input[type="checkbox"] { display: none; }
.check-box {
    width: 18px; height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.check-label input:checked ~ .check-box {
    background: var(--accent);
    border-color: var(--accent);
}
.check-label input:checked ~ .check-box::after {
    content: '';
    display: block;
    width: 5px; height: 9px;
    border: 2px solid #000;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

.forgot-link {
    font-size: 0.82rem;
    color: var(--text2);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    transition: color 0.2s;
}
.forgot-link:hover { color: var(--accent); }

/* Submit Button */
.btn-submit {
    width: 100%;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.25s, box-shadow 0.25s, opacity 0.2s;
    margin-bottom: 1.5rem;
}
.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,255,178,0.35);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-text, .btn-loader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Divider */
.form-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text3);
    font-size: 0.8rem;
    font-family: 'Space Mono', monospace;
}
.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Register button */
.btn-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text2);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    transition: border-color 0.25s, color 0.25s, background 0.25s;
    margin-bottom: 1.5rem;
}
.btn-register:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0,255,178,0.05);
}

/* Form footer */
.form-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text3);
    font-family: 'Space Mono', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    letter-spacing: 0.02em;
}
.form-footer i { color: var(--accent); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
    .login-wrap { flex-direction: column; }
    .left-panel {
        flex: none;
        padding: 2rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .back-link { margin-bottom: 1.5rem; }
    .left-title { font-size: 2.2rem; }
    .feat-pills { display: grid; grid-template-columns: 1fr 1fr; }
    .deco-ring { display: none; }
    .right-panel { padding: 2rem; }
}

@media (max-width: 600px) {
    .left-panel { padding: 1.5rem; }
    .left-title { font-size: 1.9rem; }
    .feat-pills { grid-template-columns: 1fr; }
    .right-panel { padding: 1.5rem 1rem; }
    .form-card { padding: 1.8rem 1.3rem; }
    .theme-bar { top: 0.8rem; right: 0.8rem; }
    .social-proof { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}