/* =========================================================================
   AI RankPilot — Design System
   Concept: a "flight instrument panel" reading of ranking data — RankPilot
   pilots you up the results page. Deep navy instrument background, amber
   beacon accent, tabular monospace for every number that moves (scores,
   positions), Space Grotesk for display type, Inter for body copy.
   ========================================================================= */

:root {
    --ink:            #0B1220;
    --ink-2:          #121B2E;
    --ink-3:          #1B2740;
    --paper:          #F6F7FB;
    --paper-2:        #FFFFFF;
    --text-dark:      #101828;
    --text-muted:     #5B6479;
    --border:         #E4E7EF;

    --beacon:         #FFB020;   /* primary accent — the pilot's instrument light */
    --beacon-dark:    #E39B14;
    --climb:          #23C58F;   /* position improved */
    --descend:        #EF5C5C;   /* position dropped */
    --signal-blue:    #4C7CFF;   /* links / secondary accent */

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display-font {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    color: var(--ink);
}

.text-muted-2 { color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

a { color: var(--signal-blue); text-decoration: none; }
a:hover { color: var(--ink); }

::selection { background: var(--beacon); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn-brand {
    background: var(--beacon);
    color: var(--ink);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    transition: transform .15s ease, background .15s ease;
}
.btn-brand:hover { background: var(--beacon-dark); color: var(--ink); transform: translateY(-1px); }

.btn-ghost-light {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.08); color: #fff; border-color: #fff; }

.btn-outline-ink {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.4rem;
    font-weight: 600;
}
.btn-outline-ink:hover { border-color: var(--ink); color: var(--ink); }

.btn-danger-soft { background:#FDECEC; color:#B42318; border:1px solid #F5C2C2; border-radius:var(--radius-sm); }
.btn-success-soft { background:#E7F9F1; color:#0F7A57; border:1px solid #BEEDD8; border-radius:var(--radius-sm); }

/* ---------------------------------------------------------------------
   Public site — navbar
   --------------------------------------------------------------------- */
.arp-navbar {
    background: var(--ink);
    padding: 1rem 0;
}
.arp-navbar .navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.arp-navbar .navbar-brand .dot { color: var(--beacon); }
.arp-navbar .nav-link {
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
}
.arp-navbar .nav-link:hover, .arp-navbar .nav-link.active { color: #fff; }
.lang-switch a { color: rgba(255,255,255,0.6); font-weight: 600; font-size: 0.85rem; }
.lang-switch a.active { color: var(--beacon); }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
    background: radial-gradient(120% 120% at 15% 0%, #16213B 0%, var(--ink) 55%);
    color: #fff;
    padding: 5rem 0 7rem;
    position: relative;
    overflow: hidden;
}
.hero h1 { color: #fff; font-size: clamp(2.1rem, 4vw, 3.2rem); line-height: 1.12; }
.hero p.lead { color: rgba(255,255,255,0.72); font-size: 1.15rem; max-width: 540px; }

/* Instrument-panel dashboard mock */
.instrument-panel {
    background: linear-gradient(180deg, var(--ink-3) 0%, var(--ink-2) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.55);
}
.instrument-panel .panel-top-line {
    height: 3px;
    background: linear-gradient(90deg, var(--beacon), transparent);
    border-radius: 3px;
    margin-bottom: 1.1rem;
}
.instrument-readout {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
}
.instrument-readout .label { color: rgba(255,255,255,0.55); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.instrument-readout .value { font-family: var(--font-mono); font-size: 1.5rem; color: #fff; font-weight: 600; }
.instrument-readout .value.beacon { color: var(--beacon); }
.instrument-readout .value.climb { color: var(--climb); }

/* ---------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------- */
.section { padding: 5.5rem 0; }
.section-alt { background: var(--paper-2); }
.section-header { max-width: 620px; margin-bottom: 3rem; }
.section-header h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-header p { color: var(--text-muted); font-size: 1.05rem; }

/* Feature panels — deliberately not identical rounded cards: left border marks category */
.feature-panel {
    background: var(--paper-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--beacon);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    height: 100%;
}
.feature-panel .icon-wrap {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink);
    border-radius: var(--radius-sm);
    color: var(--beacon);
    margin-bottom: 1.1rem;
}
.feature-panel h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.feature-panel p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

/* How it works — genuine sequence, numbering is earned here */
.step-item { position: relative; padding-left: 3.2rem; }
.step-item .step-num {
    position: absolute; left: 0; top: 0;
    width: 2.4rem; height: 2.4rem;
    border-radius: 50%;
    background: var(--ink);
    color: var(--beacon);
    font-family: var(--font-mono);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.step-item h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.step-item p { color: var(--text-muted); font-size: 0.92rem; }
.step-line { border-left: 2px dashed var(--border); position: absolute; left: 1.2rem; top: 2.4rem; bottom: -2.5rem; }

/* Pricing */
.price-card {
    background: var(--paper-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.price-card.is-popular {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -20px rgba(11,18,32,0.45);
}
.price-card.is-popular .text-muted-2 { color: rgba(255,255,255,0.6); }
.price-card.is-popular ul li { color: rgba(255,255,255,0.85); }
.price-card .plan-price { font-family: var(--font-mono); font-size: 2.6rem; font-weight: 700; }
.price-card .badge-popular {
    background: var(--beacon); color: var(--ink); font-weight: 700;
    border-radius: 30px; padding: 0.25rem 0.8rem; font-size: 0.75rem;
    display: inline-block; margin-bottom: 1rem;
}
.price-card ul { list-style: none; padding: 0; margin: 1.4rem 0; }
.price-card ul li { padding: 0.4rem 0; font-size: 0.92rem; display: flex; gap: 0.6rem; }
.price-card ul li svg { flex-shrink: 0; color: var(--climb); margin-top: 2px; }
.price-card.is-popular ul li svg { color: var(--beacon); }

.billing-toggle {
    display: inline-flex; background: var(--paper-2); border: 1px solid var(--border);
    border-radius: 30px; padding: 4px;
}
.billing-toggle button {
    border: none; background: transparent; padding: 0.5rem 1.2rem; border-radius: 30px;
    font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
}
.billing-toggle button.active { background: var(--ink); color: #fff; }

/* CTA footer band */
.cta-band {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    text-align: center;
}
.cta-band h2 { color: #fff; }

/* Footer */
.arp-footer { background: var(--ink); color: rgba(255,255,255,0.55); padding: 3rem 0 2rem; font-size: 0.9rem; }
.arp-footer a { color: rgba(255,255,255,0.65); }
.arp-footer a:hover { color: #fff; }
.arp-footer h5 { color: #fff; font-family: var(--font-display); font-size: 1rem; margin-bottom: 1rem; }

/* ---------------------------------------------------------------------
   Auth pages
   --------------------------------------------------------------------- */
.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink);
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--paper-2);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%; max-width: 440px;
    box-shadow: 0 30px 60px -25px rgba(0,0,0,0.5);
}
.auth-card .form-control { border-radius: var(--radius-sm); padding: 0.65rem 0.9rem; border-color: var(--border); }
.auth-card .form-control:focus { border-color: var(--beacon); box-shadow: 0 0 0 3px rgba(255,176,32,0.18); }
.auth-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--ink); }
.auth-logo .dot { color: var(--beacon-dark); }

/* ---------------------------------------------------------------------
   App shell (user dashboard + admin) — shared
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    width: 250px; flex-shrink: 0;
    background: var(--ink);
    color: rgba(255,255,255,0.8);
    padding: 1.5rem 1rem;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-sidebar .brand { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; padding: 0 0.5rem 1.5rem; display:block; }
.app-sidebar .brand .dot { color: var(--beacon); }
.app-sidebar .nav-link {
    color: rgba(255,255,255,0.68);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    display: flex; align-items: center; gap: 0.6rem;
    margin-bottom: 0.15rem;
}
.app-sidebar .nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.app-sidebar .nav-link.active { background: var(--beacon); color: var(--ink); font-weight: 600; }
.app-sidebar .nav-section-label { color: rgba(255,255,255,0.35); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 1rem 0.75rem 0.4rem; }

.app-main { flex: 1; min-width: 0; }
.app-topbar {
    background: var(--paper-2);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.75rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
}
.app-content { padding: 1.75rem; }

.stat-card {
    background: var(--paper-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.4rem;
    height: 100%;
}
.stat-card .stat-label { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 0.4rem; }
.stat-card .stat-value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.stat-card .stat-delta { font-size: 0.82rem; font-weight: 600; }
.stat-card .stat-delta.up { color: var(--climb); }
.stat-card .stat-delta.down { color: var(--descend); }

.panel-card {
    background: var(--paper-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}
.panel-card h3, .panel-card h5 { font-size: 1.05rem; margin-bottom: 1rem; }

.table-arp { font-size: 0.92rem; }
.table-arp thead th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom-width: 1px; }
.table-arp td, .table-arp th { vertical-align: middle; padding: 0.85rem 0.75rem; }
.pos-mono { font-family: var(--font-mono); font-weight: 600; }

.badge-status { font-weight: 600; font-size: 0.75rem; padding: 0.35em 0.7em; border-radius: 30px; }
.badge-active { background:#E7F9F1; color:#0F7A57; }
.badge-pending { background:#FFF6E5; color:#B36B00; }
.badge-expired, .badge-rejected { background:#FDECEC; color:#B42318; }
.badge-processing { background:#EAF0FF; color:#2451CC; }

.insight-card {
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 1.5rem;
}
.insight-card .insight-tag { color: var(--beacon); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.insight-card h4 { color: #fff; font-size: 1.15rem; }
.insight-card p { color: rgba(255,255,255,0.78); font-size: 0.92rem; margin-bottom: 0.5rem; }

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-muted); }
.empty-state svg { color: var(--border); margin-bottom: 1rem; }

.wizard-steps { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.wizard-steps .w-step { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.wizard-steps .w-step.done, .wizard-steps .w-step.current { background: var(--beacon); }

.upload-drop {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    text-align: center;
    color: var(--text-muted);
    background: var(--paper);
}

.crypto-wallet-box {
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 1.5rem;
}
.crypto-wallet-box .addr { font-family: var(--font-mono); background: rgba(255,255,255,0.08); padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); word-break: break-all; font-size: 0.85rem; }

@media (max-width: 991px) {
    .app-sidebar { position: fixed; left: -260px; z-index: 1050; transition: left .2s ease; }
    .app-sidebar.open { left: 0; }
    .price-card.is-popular { transform: none; }
}
