/* ==========================================================================
   IQITrader
   Hand-written rather than compiled: no npm, no build step, nothing for
   Hostinger shared hosting to choke on. Edit this file and it is live.
   ========================================================================== */

:root {
    --bg: #0a0c10;
    --surface: #11141a;
    --surface-2: #171b23;
    --surface-3: #1e2430;
    --border: #232935;
    --border-bright: #313a4b;

    --text: #e6e9ef;
    --text-dim: #a4adbe;
    --muted: #7c8696;

    --brand: #c3f53c;
    --brand-dim: #96bd2a;
    --brand-ink: #0a0c10;

    --long: #16c784;
    --short: #ea3943;
    --warn: #f0a93c;

    --radius: 10px;
    --radius-sm: 6px;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;

    --shell: 1200px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img,
svg {
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.5em;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 650;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.num {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* --- layout ------------------------------------------------------------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 20px;
}

.shell-wide {
    max-width: 1560px;
}

.section {
    padding-block: clamp(48px, 8vw, 96px);
}

.stack > * + * { margin-top: var(--gap, 16px); }

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.row-between {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --- header ------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .shell {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 62px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 0.78rem;
    font-weight: 800;
}

.nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
    align-items: center;
}

.nav a {
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}

.nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.nav a.is-active { color: var(--brand); }

.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 1rem;
    cursor: pointer;
}

/* --- buttons ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-brand {
    background: var(--brand);
    color: var(--brand-ink);
}

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

.btn-ghost:hover { color: var(--text); }

.btn-long { background: var(--long); color: #04231a; }
.btn-short { background: var(--short); color: #2b0609; }

.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* --- cards & surfaces --------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.card-tight { padding: 14px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.panel-head h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.panel-body { padding: 14px; }

/* --- text helpers ------------------------------------------------------- */

.eyebrow {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 14px;
}

.lead {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-dim);
    max-width: 62ch;
}

.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.small { font-size: 0.84rem; }
.tiny { font-size: 0.76rem; }
.up { color: var(--long); }
.down { color: var(--short); }
.center { text-align: center; }
.mono { font-family: var(--mono); }

.label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
}

/* --- badges ------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-bright);
    background: var(--surface-2);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.badge-brand { border-color: var(--brand-dim); color: var(--brand); background: rgba(195, 245, 60, 0.08); }
.badge-long { border-color: var(--long); color: var(--long); background: rgba(22, 199, 132, 0.1); }
.badge-short { border-color: var(--short); color: var(--short); background: rgba(234, 57, 67, 0.1); }
.badge-warn { border-color: var(--warn); color: var(--warn); background: rgba(240, 169, 60, 0.1); }

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    flex: none;
}

.dot-live {
    background: var(--long);
    box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.6);
    animation: pulse 2s infinite;
}

.dot-stale { background: var(--warn); animation: none; }

@keyframes pulse {
    70% { box-shadow: 0 0 0 7px rgba(22, 199, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .dot-live { animation: none; }
    * { transition: none !important; }
}

/* --- forms -------------------------------------------------------------- */

.input,
.select {
    width: 100%;
    padding: 9px 11px;
    background: var(--bg);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
}

.input.num,
.select.num { font-family: var(--mono); }

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--brand-dim);
    box-shadow: 0 0 0 3px rgba(195, 245, 60, 0.12);
}

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

.field + .field { margin-top: 14px; }

.error {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--short);
}

.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-bright);
    background: var(--surface-2);
    font-size: 0.9rem;
}

.alert-ok { border-color: var(--long); background: rgba(22, 199, 132, 0.08); }
.alert-bad { border-color: var(--short); background: rgba(234, 57, 67, 0.08); }
.alert-warn { border-color: var(--warn); background: rgba(240, 169, 60, 0.08); }

/* --- tables ------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    white-space: nowrap;
}

table.data th {
    text-align: left;
    padding: 9px 12px;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

table.data td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .right { text-align: right; }

.empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

/* --- stats -------------------------------------------------------------- */

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-value {
    margin-top: 5px;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.stat-sub {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--muted);
}

/* --- progress / objectives --------------------------------------------- */

.objective + .objective {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.objective-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 0.86rem;
}

.bar {
    margin-top: 7px;
    height: 6px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--brand);
    transition: width 0.4s ease;
}

.bar.is-risk > span { background: var(--warn); }
.bar.is-danger > span { background: var(--short); }
.bar.is-done > span { background: var(--long); }

/* --- hero --------------------------------------------------------------- */

.hero {
    position: relative;
    padding-block: clamp(56px, 10vw, 118px);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero::before {
    content: "";
    position: absolute;
    inset: -40% 20% auto -10%;
    height: 520px;
    background: radial-gradient(ellipse at center, rgba(195, 245, 60, 0.11), transparent 62%);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    display: grid;
    gap: 44px;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
}

/* --- ticker ------------------------------------------------------------- */

.ticker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ticker-cell {
    background: var(--surface);
    padding: 11px 13px;
}

.ticker-sym {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.ticker-price {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 2px;
    transition: color 0.3s;
}

.ticker-chg { font-size: 0.76rem; margin-top: 1px; }

/* --- pricing ------------------------------------------------------------ */

.plan {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.plan.is-featured {
    border-color: var(--brand-dim);
    box-shadow: 0 0 0 1px rgba(195, 245, 60, 0.18), 0 18px 48px -28px rgba(195, 245, 60, 0.3);
}

.plan-size {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    margin: 6px 0 2px;
}

.plan-rules {
    list-style: none;
    margin: 18px 0;
    padding: 0;
    font-size: 0.88rem;
    flex: 1;
}

.plan-rules li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
}

.plan-rules li:last-child { border-bottom: 0; }
.plan-rules dfn { font-style: normal; color: var(--text-dim); }
.plan-rules b { font-family: var(--mono); font-weight: 600; }

/* --- steps -------------------------------------------------------------- */

.step {
    position: relative;
    padding-left: 48px;
}

.step-num {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--surface-3);
    border: 1px solid var(--border-bright);
    font-family: var(--mono);
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--brand);
}

/* --- insights ----------------------------------------------------------- */

.insight {
    display: flex;
    gap: 12px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    border-left-width: 3px;
    background: var(--surface-2);
}

.insight + .insight { margin-top: 10px; }
.insight-high { border-left-color: var(--short); }
.insight-medium { border-left-color: var(--warn); }
.insight-good { border-left-color: var(--long); }
.insight-info { border-left-color: var(--border-bright); }

.insight h4 {
    margin: 0 0 3px;
    font-size: 0.92rem;
    font-weight: 650;
}

.insight p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* --- footer ------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 36px;
    margin-top: 48px;
    font-size: 0.86rem;
    color: var(--muted);
}

.site-footer a:hover { color: var(--text); }

.footer-cols {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 28px;
}

.footer-cols h4 {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 10px;
}

.footer-cols ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-cols li + li { margin-top: 7px; }

.disclaimer {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ==========================================================================
   Trading terminal
   ========================================================================== */

.terminal {
    display: grid;
    gap: 12px;
    grid-template-columns: 196px minmax(0, 1fr) 286px;
    align-items: start;
    padding: 12px 0 28px;
}

@media (max-width: 1180px) {
    .terminal { grid-template-columns: 170px minmax(0, 1fr); }
    .terminal .col-ticket { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .terminal { grid-template-columns: minmax(0, 1fr); }
    .terminal .col-watch { order: 2; }
    .terminal .col-chart { order: 1; }
    .terminal .col-ticket { order: 3; }
}

.account-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.account-bar > div {
    background: var(--surface);
    padding: 9px 13px;
}

.account-bar .stat-label { font-size: 0.68rem; }

.account-bar .stat-value {
    font-size: 1.05rem;
    margin-top: 2px;
}

/* watchlist */

.watch {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

.watch li + li { border-top: 1px solid var(--border); }

.watch button {
    display: block;
    width: 100%;
    padding: 9px 13px;
    background: none;
    border: 0;
    border-left: 2px solid transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.watch button:hover { background: var(--surface-2); }

.watch button.is-active {
    background: var(--surface-3);
    border-left-color: var(--brand);
}

.watch-sym {
    font-size: 0.84rem;
    font-weight: 650;
}

.watch-price {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    color: var(--text-dim);
    transition: color 0.25s;
}

.flash-up { color: var(--long) !important; }
.flash-down { color: var(--short) !important; }

/* chart */

.chart-head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.chart-symbol {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chart-last {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.2rem;
    font-weight: 600;
    transition: color 0.25s;
}

.tf-group {
    display: flex;
    gap: 2px;
    margin-left: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.tf-group button {
    padding: 4px 9px;
    background: none;
    border: 0;
    border-radius: 4px;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
}

.tf-group button:hover { color: var(--text); }

.tf-group button.is-active {
    background: var(--surface-3);
    color: var(--brand);
}

#chart {
    height: clamp(320px, 52vh, 560px);
    width: 100%;
}

.chart-attrib {
    padding: 5px 14px;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--muted);
}

.chart-attrib a { color: var(--text-dim); text-decoration: underline; }

/* order ticket */

.ticket-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.ticket-side button {
    padding: 11px;
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-dim);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.ticket-side button.is-active[data-side="buy"] {
    background: rgba(22, 199, 132, 0.14);
    border-color: var(--long);
    color: var(--long);
}

.ticket-side button.is-active[data-side="sell"] {
    background: rgba(234, 57, 67, 0.14);
    border-color: var(--short);
    color: var(--short);
}

.ticket-quote {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
    font-family: var(--mono);
}

.ticket-quote > div {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.ticket-quote .tiny { font-family: var(--sans); }

.ticket-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
}

.ticket-meta div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
}

.ticket-meta b {
    font-family: var(--mono);
    font-weight: 600;
}

/* toasts */

.toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(340px, calc(100vw - 32px));
}

.toast {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-bright);
    border-left-width: 3px;
    background: var(--surface-3);
    font-size: 0.87rem;
    box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.7);
    animation: toast-in 0.2s ease;
}

.toast-ok { border-left-color: var(--long); }
.toast-bad { border-left-color: var(--short); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
}

/* auth */

.auth-wrap {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 62px);
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 404px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

/* utilities */

.hide { display: none !important; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
    .nav { display: none; }
    .nav.is-open {
        display: flex;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 16px 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }
    .nav-toggle { display: block; }
}
