:root {
    --bg: #06080f;
    --surface: #0d1117;
    --card: #111822;
    --card2: #161d29;
    --border: #1e2a3a;
    --border-hover: #2d4059;
    --text: #e6edf3;
    --text-dim: #7d8590;
    --text-muted: #484f58;
    --cyan: #00d4ff;
    --cyan-dim: #00d4ff25;
    --gold: #f0b429;
    --gold-dim: #f0b42920;
    --green: #2ea043;
    --green-dim: #2ea04320;
    --red: #f85149;
    --red-dim: #f8514920;
    --purple: #a371f7;
    --purple-dim: #a371f720;
    --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: var(--bg); color: var(--text);
    font-family: 'DM Sans', -apple-system, sans-serif;
    min-height: 100vh; overflow-x: hidden;
}

/* ── Backgrounds ── */
.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px; z-index: 0;
}
.bg-glow {
    position: fixed; top: -30%; left: 50%; transform: translateX(-50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 60%); z-index: 0;
}
.bg-glow-2 {
    position: fixed; bottom: -40%; right: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(240,180,41,0.04) 0%, transparent 60%); z-index: 0;
}

/* ── Auth Pages ── */
.auth-wrapper {
    position: relative; z-index: 1;
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 40px 20px; min-height: 100vh;
}
.auth-container { width: 100%; max-width: 440px; }
.logo-section { text-align: center; margin-bottom: 40px; }
.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px; font-weight: 700;
    color: var(--cyan); letter-spacing: -0.5px; margin-bottom: 4px;
    text-decoration: none; display: inline-block;
}
.logo span { color: var(--gold); }
.logo-sub {
    font-size: 13px; color: var(--text-dim);
    letter-spacing: 2px; text-transform: uppercase; font-weight: 500;
}
.auth-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; padding: 36px 32px; backdrop-filter: blur(10px);
}
.auth-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-card .subtitle { font-size: 14px; color: var(--text-dim); margin-bottom: 28px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-dim); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input, .ex-input {
    width: 100%; padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text);
    font-family: 'DM Sans', sans-serif; font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s; outline: none;
}
.form-group input:focus, .ex-input:focus {
    border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-dim);
}
.form-group input::placeholder, .ex-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.pw-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; font-size: 13px; font-family: 'DM Sans', sans-serif;
    padding: 4px 6px; border-radius: 4px; transition: color 0.2s;
}
.pw-toggle:hover { color: var(--text); }

/* ── Password strength ── */
.pw-strength { display: flex; gap: 4px; margin-top: 8px; height: 3px; }
.pw-bar { flex: 1; border-radius: 2px; background: var(--border); transition: background 0.3s; }
.pw-bar.active.weak { background: var(--red); }
.pw-bar.active.fair { background: var(--gold); }
.pw-bar.active.good { background: var(--green); }
.pw-bar.active.strong { background: var(--cyan); }
.pw-label { font-size: 11px; margin-top: 4px; font-weight: 600; letter-spacing: 0.3px; }
.pw-label.weak { color: var(--red); }
.pw-label.fair { color: var(--gold); }
.pw-label.good { color: var(--green); }
.pw-label.strong { color: var(--cyan); }

/* ── Buttons ── */
.btn-primary {
    width: 100%; padding: 13px 24px;
    background: linear-gradient(135deg, #00b4d8, #00d4ff);
    border: none; border-radius: 10px;
    color: #000; font-family: 'DM Sans', sans-serif;
    font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    margin-top: 6px; letter-spacing: 0.3px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,212,255,0.25); }
.btn-primary:active { transform: translateY(0); }
.btn-connect {
    padding: 9px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 700;
    border: 1px solid var(--green); background: var(--green-dim);
    color: var(--green); cursor: pointer; transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.btn-connect:hover { background: rgba(46,160,67,0.3); }
.btn-disconnect {
    padding: 9px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 700;
    border: 1px solid var(--border); background: none;
    color: var(--red); cursor: pointer; transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.btn-disconnect:hover { border-color: var(--red); background: var(--red-dim); }

/* ── Divider ── */
.divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 500; }

/* ── Google button ── */
.btn-google {
    width: 100%; padding: 12px 24px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text);
    font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-google:hover { border-color: var(--border-hover); background: var(--card); }

/* ── Footer & Features ── */
.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-dim); }
.auth-footer a { color: var(--cyan); text-decoration: none; font-weight: 600; transition: opacity 0.2s; }
.auth-footer a:hover { opacity: 0.8; }
.features { display: flex; gap: 24px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.feature { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); letter-spacing: 0.3px; }
.feature-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); opacity: 0.6; }
.terms { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 16px; line-height: 1.5; }

/* ── Flash messages ── */
.flash {
    padding: 12px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 500; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}
.flash.error { background: var(--red-dim); border: 1px solid rgba(248,81,73,0.3); color: var(--red); }
.flash.success { background: var(--green-dim); border: 1px solid rgba(46,160,67,0.3); color: var(--green); }
.flash.error::before { content: '✕'; font-size: 16px; }
.flash.success::before { content: '✓'; font-size: 16px; }

/* ── Dashboard Header ── */
.header {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 0 24px; position: sticky; top: 0; z-index: 100;
}
.header-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.header-left { display: flex; align-items: center; gap: 32px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 8px; background: var(--card);
    border: 1px solid var(--border); border-radius: 20px;
    font-size: 13px; font-weight: 600;
}
.user-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--gold));
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #000;
}
.btn-logout {
    padding: 6px 14px; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: var(--text-dim);
    background: none; border: 1px solid var(--border);
    cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Main content ── */
.main { max-width: 1400px; margin: 0 auto; padding: 24px; }
.welcome-card {
    background: linear-gradient(135deg, var(--card) 0%, var(--card2) 100%);
    border: 1px solid var(--border); border-radius: 16px;
    padding: 32px; margin-bottom: 24px; position: relative; overflow: hidden;
}
.welcome-card::after {
    content: ''; position: absolute; top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--cyan-dim) 0%, transparent 60%);
    pointer-events: none;
}
.welcome-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; position: relative; z-index: 1; }
.welcome-card h1 span { color: var(--cyan); }
.welcome-card p { color: var(--text-dim); font-size: 14px; position: relative; z-index: 1; }
.section-title {
    font-size: 16px; margin-bottom: 16px; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}

/* ── Exchange cards ── */
.exchange-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.exchange-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 24px;
}
.exchange-card h3 {
    font-size: 16px; font-weight: 700;
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.ex-badge {
    font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.ex-badge.connected { background: var(--green-dim); color: var(--green); }
.ex-badge.disconnected { background: var(--red-dim); color: var(--red); }
.ex-input {
    font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-bottom: 8px;
}
.ex-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Message box ── */
.msg-box {
    padding: 12px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 500; margin-bottom: 16px;
    display: none; align-items: center; gap: 8px;
}
.msg-box.show { display: flex; }
.msg-box.success { background: var(--green-dim); border: 1px solid rgba(46,160,67,0.3); color: var(--green); }
.msg-box.error { background: var(--red-dim); border: 1px solid rgba(248,81,73,0.3); color: var(--red); }

/* ── Coming soon ── */
.coming-soon {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 40px; text-align: center;
}
.coming-soon h2 { font-size: 18px; margin-bottom: 8px; }
.coming-soon p { color: var(--text-dim); font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
    .main { padding: 16px; }
    .exchange-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; border-radius: 12px; }
    .logo { font-size: 24px; }
    .features { gap: 16px; }
}

/* ── Animations ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.auth-container { animation: fadeUp 0.5s ease-out; }
.main > * { animation: fadeIn 0.4s ease-out both; }
.main > :nth-child(2) { animation-delay: 0.08s; }
.main > :nth-child(3) { animation-delay: 0.16s; }
.main > :nth-child(4) { animation-delay: 0.24s; }
