/* ── BBH Client Portal — Cyber Serif Design System ───────────
   Matches bbhightech.com: Emerald (#10b981) on Deep Black (#050505)
   Newsreader (serif) + Inter (sans) + Space Grotesk (tech)
   ──────────────────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #050505;
    --bg-surface: #0a0a0a;
    --bg-card: #0d0d0d;
    --bg-input: #0a0a0a;
    --text: #EBEBEB;
    --text-dim: rgba(235, 235, 235, 0.5);
    --text-muted: rgba(235, 235, 235, 0.25);
    --emerald: #10b981;
    --emerald-dim: rgba(16, 185, 129, 0.15);
    --emerald-glow: rgba(16, 185, 129, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(16, 185, 129, 0.3);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { font-size: 16px; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--emerald); text-decoration: none; transition: color 0.3s; }
a:hover { color: #059669; }

/* ── Layout ───────────────────────────────────────────────── */
.portal-layout { min-height: 100vh; }

.portal-main {
    margin-left: 220px;
    padding: 2rem 2.5rem;
    max-width: 1000px;
}

/* ── Top Bar (auth pages) ─────────────────────────────────── */
.auth-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 40px;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.auth-topbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.auth-topbar .logo svg { width: 28px; height: 28px; }

.auth-topbar .back-link {
    margin-left: auto;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 5rem 40px 2rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-card .subtitle {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 2rem;
}

.auth-card .switch-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 13px;
    color: var(--text-dim);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
    z-index: 50;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 1.25rem;
    margin-bottom: 2rem;
    color: var(--text);
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.sidebar .logo svg { width: 24px; height: 24px; }

.sidebar nav { flex: 1; }

.sidebar .nav-section {
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem 0.4rem;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.25rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    border-left: 2px solid transparent;
}

.sidebar .nav-item:hover {
    color: var(--text);
    background: var(--glass);
}

.sidebar .nav-item.active {
    color: var(--emerald);
    border-left-color: var(--emerald);
    background: var(--emerald-glow);
}

.sidebar .nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar .nav-item.active svg { opacity: 1; }

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.sidebar-footer .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--emerald-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--emerald);
}

.sidebar-footer .user-name {
    font-size: 13px;
    font-weight: 500;
}

.sidebar-footer .user-email {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-footer .logout-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.3s;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
}

.sidebar-footer .logout-btn svg { width: 14px; height: 14px; }
.sidebar-footer .logout-btn:hover { color: var(--danger); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    font-family: 'Space Grotesk', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s var(--ease);
    outline: none;
}

.form-input:focus {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 3px var(--emerald-glow);
}

.form-input::placeholder { color: var(--text-muted); }

textarea.form-input { min-height: 80px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    border: 1px solid transparent;
    outline: none;
    letter-spacing: 0.01em;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn svg { width: 14px; height: 14px; }

.btn-primary {
    background: var(--emerald);
    color: var(--bg);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--text-dim);
    color: var(--text);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header { margin-bottom: 1.75rem; }

.page-header h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-dim);
    font-size: 14px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-header h2 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state .empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--emerald-glow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state .empty-icon svg { width: 24px; height: 24px; color: var(--emerald); }

.empty-state h3 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-dim);
    font-size: 14px;
    max-width: 340px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* ── Website Cards ────────────────────────────────────────── */
.website-grid { display: grid; gap: 0.75rem; }

.website-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.3s var(--ease);
}

.website-card:hover { border-color: var(--border-hover); }

.website-card .site-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.website-card .site-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 12px;
    color: var(--text-dim);
}

/* ── Status Badges ────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-active { background: var(--emerald-glow); color: var(--emerald); }
.badge-building { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.badge-pending { background: rgba(99, 102, 241, 0.1); color: #818cf8; }
.badge-expired { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.badge-suspended { background: rgba(107, 114, 128, 0.1); color: #9ca3af; }
.badge-basic { background: var(--glass); color: var(--text-dim); }
.badge-premium { background: var(--emerald-glow); color: var(--emerald); }

/* ── Alert ────────────────────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.alert-success {
    background: var(--emerald-glow);
    border-color: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

/* ── Settings ─────────────────────────────────────────────── */
.settings-section { margin-bottom: 1.5rem; }

.settings-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

/* ── Plan Selector ────────────────────────────────────────── */
.plan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.plan-option {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    position: relative;
}

.plan-option:hover { border-color: var(--border-hover); }

.plan-option.selected {
    border-color: var(--emerald);
    background: var(--emerald-glow);
}

.plan-option .plan-name {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.plan-option .plan-price {
    font-family: 'Space Grotesk', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--emerald);
    margin-bottom: 10px;
}

.plan-option .plan-price span {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-dim);
}

.plan-option .plan-features {
    list-style: none;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 2;
}

.plan-option .plan-features li::before {
    content: '\2713  ';
    color: var(--emerald);
}

.plan-option .plan-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    font-family: 'Space Grotesk', monospace;
    background: var(--emerald);
    color: var(--bg);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Steps Bar ────────────────────────────────────────────── */
.steps-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', monospace;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.step-dot.active {
    background: var(--emerald);
    border-color: var(--emerald);
    color: var(--bg);
}

.step-dot.done {
    background: var(--emerald-glow);
    border-color: var(--emerald);
    color: var(--emerald);
}

.step-line { flex: 1; height: 1px; background: var(--border); }
.step-line.done { background: var(--emerald); }

/* ── Billing Table ───────────────────────────────────────── */
.billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.billing-table th {
    text-align: left;
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.billing-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 13px;
}

.billing-table tr:hover td { color: var(--text); }

.billing-table .amount {
    font-family: 'Space Grotesk', monospace;
    font-weight: 600;
    color: var(--text);
}

/* ── Success Page ────────────────────────────────────────── */
.success-page { text-align: center; padding: 3rem 1.5rem; }

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--emerald-glow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg { width: 28px; height: 28px; color: var(--emerald); }

.success-page h1 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 28px;
    margin-bottom: 6px;
}

.success-page p {
    color: var(--text-dim);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.success-actions { display: flex; gap: 0.6rem; justify-content: center; }

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle {
    position: relative;
    width: 32px;
    height: 18px;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
}

.toggle input { display: none; }

.toggle .slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    transition: background 0.3s var(--ease);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: var(--text);
    border-radius: 50%;
    transition: transform 0.3s var(--ease);
}

.toggle input:checked + .slider { background: var(--emerald); }
.toggle input:checked + .slider::before { transform: translateX(14px); }

/* ── Mobile ───────────────────────────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 60;
    align-items: center;
    padding: 0 1rem;
    justify-content: space-between;
}

.mobile-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    font-size: 16px;
}

.mobile-header .logo svg { width: 22px; height: 22px; }

.hamburger {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

.hamburger svg { width: 20px; height: 20px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 45;
}

@media (max-width: 768px) {
    .portal-main { margin-left: 0; padding: 4.5rem 1rem 2rem; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 250ms var(--ease);
        z-index: 55;
    }

    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .mobile-header { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .website-card { grid-template-columns: 1fr; }
    .plan-grid { grid-template-columns: 1fr; }
    .auth-page { padding: 5rem 1rem 2rem; }
}
