@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Dark theme (default) ── */
:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0f1d32;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.07);
    --accent: #60a5fa;
    --accent-glow: rgba(96,165,250,0.15);
    --text-primary: #f0f4f8;
    --text-secondary: rgba(240,244,248,0.55);
    --text-tertiary: rgba(240,244,248,0.3);
    --border: rgba(255,255,255,0.06);
    --radius: 16px;
    --content-width: 1200px;
    --content-padding: clamp(20px, 5vw, 80px);
    --glow-opacity: 1;
    --shadow-card: 0 2px 16px rgba(0,0,0,0.3);
    --badge-green-bg: rgba(34,197,94,0.12);
    --badge-green-fg: #4ade80;
    --badge-yellow-bg: rgba(234,179,8,0.12);
    --badge-yellow-fg: #facc15;
    --badge-red-bg: rgba(239,68,68,0.12);
    --badge-red-fg: #f87171;
}

/* ── Light theme ── */
[data-theme="light"] {
    --bg-primary: #f8f9fb;
    --bg-secondary: #ffffff;
    --bg-card: rgba(0,0,0,0.03);
    --bg-card-hover: rgba(0,0,0,0.06);
    --accent: #2563eb;
    --accent-glow: rgba(37,99,235,0.1);
    --text-primary: #0f172a;
    --text-secondary: rgba(15,23,42,0.6);
    --text-tertiary: rgba(15,23,42,0.35);
    --border: rgba(0,0,0,0.08);
    --glow-opacity: 0;
    --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
    --badge-green-bg: rgba(34,197,94,0.1);
    --badge-green-fg: #16a34a;
    --badge-yellow-bg: rgba(234,179,8,0.1);
    --badge-yellow-fg: #ca8a04;
    --badge-red-bg: rgba(239,68,68,0.1);
    --badge-red-fg: #dc2626;
}

/* ── Smooth transitions ── */
body, .info-card, .step-card, .faq-item, .faq-question,
.highlight-box, .data-table th, .page-nav, .page-footer,
.nav-brand, .nav-back, .content a, .badge {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* ── Theme toggle button ── */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.3s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
}
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── Ambient glow ── */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: var(--glow-opacity);
    transition: opacity 0.5s;
}
.glow-orb-1 {
    width: 600px; height: 600px;
    top: -200px; right: -150px;
    background: radial-gradient(circle, rgba(96,165,250,0.07), transparent 70%);
}
.glow-orb-2 {
    width: 500px; height: 500px;
    bottom: 5%; left: -100px;
    background: radial-gradient(circle, rgba(129,140,248,0.05), transparent 70%);
}

/* ── Layout ── */
.wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
}

/* ── Navigation ── */
.page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 56px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}
.nav-brand img {
    width: 32px; height: 32px;
    border-radius: 9px;
}
.nav-brand span {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-back:hover { color: var(--text-primary); }
.nav-back svg { width: 16px; height: 16px; }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Page Header ── */
.page-header {
    margin-bottom: 56px;
    max-width: 700px;
}
.page-header h1 {
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.12;
    margin-bottom: 14px;
}
.page-header .accent { color: var(--accent); }
.page-header p {
    font-size: clamp(15px, 1.5vw, 17px);
    color: var(--text-secondary);
    line-height: 1.7;
}
.page-header .updated {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

/* ── Content ── */
.content section {
    margin-bottom: 48px;
}
.content h2 {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.content h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.content p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 12px;
}
.content ul, .content ol {
    padding-left: 20px;
    margin-bottom: 12px;
}
.content li {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 6px;
}
.content a {
    color: var(--accent);
    text-decoration: none;
}
.content a:hover { text-decoration: underline; }
.content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Info Cards — responsive grid ── */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
    transition: background 0.2s;
}
.info-card:hover {
    background: var(--bg-card-hover);
}
.info-card h3 {
    margin-bottom: 8px;
}
.info-card p {
    margin-bottom: 0;
}

/* Grid wrapper for cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.cards-grid .info-card,
.cards-grid .step-card {
    margin-bottom: 0;
}

/* ── Accordion / FAQ — two-column on wide screens ── */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
    gap: 16px;
}
.faq-question:hover {
    background: var(--bg-card-hover);
}
.faq-question svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.3s;
}
.faq-item.open .faq-question svg {
    transform: rotate(180deg);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.faq-item.open .faq-answer {
    max-height: 600px;
}
.faq-answer-inner {
    padding: 0 24px 20px;
}
.faq-answer-inner p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 0;
}

/* ── Step Cards (Guide) — responsive grid ── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.steps-grid .step-card {
    margin-bottom: 0;
}
.step-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
    transition: background 0.2s, transform 0.2s;
}
.step-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}
.step-number {
    width: 44px; height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: var(--accent);
}
.step-content h3 {
    margin-bottom: 6px;
}
.step-content p {
    margin-bottom: 0;
    font-size: 14px;
}

/* ── Highlight Box ── */
.highlight-box {
    background: linear-gradient(135deg, rgba(96,165,250,0.08), rgba(129,140,248,0.04));
    border: 1px solid rgba(96,165,250,0.1);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
}
[data-theme="light"] .highlight-box {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(99,102,241,0.03));
    border-color: rgba(37,99,235,0.1);
}
.highlight-box p {
    color: var(--text-secondary);
    margin-bottom: 0;
}
.highlight-box strong {
    color: var(--accent);
}

/* ── Table — responsive wrapper ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}
.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.data-table td {
    color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-green {
    background: var(--badge-green-bg);
    color: var(--badge-green-fg);
}
.badge-yellow {
    background: var(--badge-yellow-bg);
    color: var(--badge-yellow-fg);
}
.badge-red {
    background: var(--badge-red-bg);
    color: var(--badge-red-fg);
}

/* ── Two-column layout for text-heavy content ── */
.two-col {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
}
.two-col .sidebar {
    position: sticky;
    top: 24px;
}
.sidebar-nav {
    list-style: none;
    padding: 0;
}
.sidebar-nav li {
    margin-bottom: 4px;
}
.sidebar-nav a {
    display: block;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.sidebar-nav a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ── Footer ── */
.page-footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}
.page-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-bottom: 16px;
}
.page-footer .footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.page-footer .footer-links a:hover { color: var(--text-primary); }
.page-footer p {
    font-size: 13px;
    color: var(--text-tertiary);
}
.page-footer p a {
    color: var(--text-secondary);
    text-decoration: none;
}
.page-footer p a:hover { color: var(--text-primary); }

/* ══════════════════════════════════════════════════
   Responsive Breakpoints
   ══════════════════════════════════════════════════ */

/* Extra-large desktops */
@media (min-width: 1400px) {
    :root { --content-width: 1400px; }
    .steps-grid { grid-template-columns: repeat(3, 1fr); }
    .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablets landscape & small desktops */
@media (max-width: 1024px) {
    .two-col {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .two-col .sidebar {
        position: static;
        display: none;
    }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablets portrait */
@media (max-width: 768px) {
    .page-nav { margin-bottom: 40px; }
    .page-header { margin-bottom: 40px; }
    .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .data-table th,
    .data-table td { padding: 12px 14px; font-size: 13px; }
}

/* Mobile */
@media (max-width: 640px) {
    .page-nav { margin-bottom: 28px; }
    .page-header { margin-bottom: 32px; }
    .steps-grid { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: 1fr; }
    .step-card { flex-direction: column; gap: 12px; padding: 22px; }
    .info-card { padding: 22px; }
    .highlight-box { padding: 22px; }
    .faq-question { padding: 16px 18px; font-size: 14px; }
    .faq-answer-inner { padding: 0 18px 16px; }
}
