/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0b;
    --bg-raised: #111113;
    --bg-card: #16161a;
    --bg-input: #1a1a1f;
    --border: #25252b;
    --border-focus: #4f46e5;
    --text: #e4e4e7;
    --text-dim: #71717a;
    --text-muted: #52525b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #22c55e;
    --error: #ef4444;
    --radius: 10px;
    --radius-lg: 16px;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Nav ─────────────────────────────────────────────────── */
.nav {
    border-bottom: 1px solid var(--border);
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-brand svg { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--text); background: var(--bg-card); }
.nav-link-accent { color: var(--accent) !important; }
.nav-link-dim { color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
    color: var(--text);
    box-shadow: none;
}

/* ── Flash Messages ──────────────────────────────────────── */
.flash-container {
    max-width: 600px;
    margin: 16px auto;
    padding: 0 24px;
}

.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    animation: slideIn 0.2s ease;
}

.flash-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--success); }
.flash-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--error); }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 4px;
}

.flash-close:hover { opacity: 1; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Main ────────────────────────────────────────────────── */
.main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 100px 0 60px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    color: var(--text-dim);
    font-size: 1.15rem;
    max-width: 480px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 32px;
}

.domain-badge {
    display: inline-block;
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* ── Features ────────────────────────────────────────────── */
.features {
    padding: 40px 0 80px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: all 0.2s;
}

.feature-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-glow);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-container {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-sub {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-footer {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 24px;
}

.auth-divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ── Forms ───────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dim);
}

.optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.15s;
    outline: none;
}

input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.15s;
}

.input-with-suffix:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-with-suffix input {
    border: none;
    background: transparent;
    border-radius: 0;
}

.input-with-suffix input:focus {
    box-shadow: none;
}

.input-suffix {
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-raised);
    border-left: 1px solid var(--border);
    white-space: nowrap;
}

.input-hint {
    font-size: 0.8rem;
    min-height: 18px;
}

.hint-ok { color: var(--success); }
.hint-err { color: var(--error); }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard {
    padding: 40px 0 80px;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.dash-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.text-dim { color: var(--text-dim); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.info-section {
    margin-top: 20px;
}

.info-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.setup-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.setup-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.setup-table {
    width: 100%;
    border-collapse: collapse;
}

.setup-table td {
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.setup-table td:first-child {
    color: var(--text-dim);
    width: 100px;
}

.setup-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setup-list li {
    font-size: 0.9rem;
    color: var(--text-dim);
    padding-left: 16px;
    position: relative;
}

.setup-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.setup-list li strong { color: var(--text); }

/* ── Settings ────────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.settings-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .setup-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: center; }
    .auth-card { padding: 28px; }
}

@media (max-width: 480px) {
    .nav-links { gap: 4px; }
    .nav-link { padding: 6px 8px; font-size: 0.85rem; }
    .hero { padding: 60px 0 40px; }
    .hero-title { font-size: 1.8rem; }
}
