/* ============================================================
   WEB CABINET global styles. Brand tokens come from brand.css;
   this file holds the base theme, reusable primitives, and the
   cabinet screens (auth, dashboard, wallet). Admin zone styles
   live in admin.css.
   ============================================================ */
html, body {
    font-family: var(--aethel-font);
    background-color: var(--aethel-bg-base);
    color: var(--aethel-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--aethel-gold); }

/* ---- Primitives (duplicated per host by design — only tokens are shared) ---- */
.aethel-num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.aethel-card {
    background-color: var(--aethel-bg-card);
    border: 1px solid var(--aethel-border);
    border-radius: var(--aethel-radius-card);
    box-shadow: var(--aethel-shadow-card);
}

.aethel-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--aethel-radius-pill);
    background: rgba(255, 255, 255, 0.06);
    color: var(--aethel-text-muted);
}

.aethel-pill--success { background: rgba(34, 197, 94, 0.14); color: var(--aethel-success); }
.aethel-pill--warning { background: rgba(245, 158, 11, 0.14); color: var(--aethel-warning); }
.aethel-pill--danger  { background: rgba(239, 68, 68, 0.14);  color: var(--aethel-danger); }

.aethel-btn-gold {
    border: none;
    border-radius: var(--aethel-radius-input);
    background: linear-gradient(135deg, var(--aethel-gold-bright), var(--aethel-gold));
    color: #1a1305;
    font-weight: 700;
    box-shadow: var(--aethel-glow-gold);
    cursor: pointer;
}

.aethel-btn-gold:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Shared helper text ---- */
.cab-muted { color: var(--aethel-text-muted); }
.cab-error { color: var(--aethel-danger); font-weight: 600; }
.cab-ok    { color: var(--aethel-success); font-weight: 600; }

/* ---- Auth (login / register) ---- */
.auth {
    min-height: calc(100vh - 64px);
    display: grid;
    place-items: center;
    padding: var(--aethel-s5);
}

.auth__card { width: 100%; max-width: 400px; padding: var(--aethel-s6); }
.auth__title { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.auth__sub { margin: 0 0 var(--aethel-s5); font-size: 14px; color: var(--aethel-text-muted); }
.auth__form { display: flex; flex-direction: column; gap: var(--aethel-s4); }
.auth__field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--aethel-text-muted); }

.auth__input {
    padding: 11px 13px;
    border: 1px solid var(--aethel-border);
    border-radius: var(--aethel-radius-input);
    background: var(--aethel-bg-base);
    color: var(--aethel-text);
    font-size: 14px;
    font-weight: 400;
}

.auth__input:focus { outline: none; border-color: var(--aethel-gold); }
.auth__submit { padding: 12px; font-size: 15px; }
.auth__error { margin: 0; color: var(--aethel-danger); font-size: 13px; font-weight: 600; }
.auth__alt { margin: var(--aethel-s4) 0 0; font-size: 13px; color: var(--aethel-text-muted); text-align: center; }

/* ---- Hero balance ---- */
.hero {
    padding: var(--aethel-s6);
    margin-bottom: var(--aethel-s5);
    border-color: var(--aethel-border-strong);
    box-shadow: var(--aethel-shadow-card), var(--aethel-glow-gold);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(212, 175, 55, 0.10), transparent 55%),
        var(--aethel-bg-card);
}

.hero__label { display: block; font-size: 13px; color: var(--aethel-text-muted); margin-bottom: 8px; }
.hero__amount { display: flex; align-items: baseline; gap: 10px; }
.hero__value { font-size: 42px; font-weight: 800; line-height: 1; }
.hero__unit { font-size: 18px; font-weight: 600; color: var(--aethel-gold); }
.hero__actions { margin-top: var(--aethel-s4); }
.hero__btn { display: inline-block; padding: 10px 18px; text-decoration: none; font-size: 14px; }

/* ---- Operations (deposit / withdraw) ---- */
.ops { display: grid; grid-template-columns: 1fr 1fr; gap: var(--aethel-s4); margin-bottom: var(--aethel-s5); }
.op { padding: var(--aethel-s5); }
.op__title { margin: 0 0 var(--aethel-s3); font-size: 15px; font-weight: 700; }
.op__row { display: flex; gap: var(--aethel-s3); }

.op__input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--aethel-border);
    border-radius: var(--aethel-radius-input);
    background: var(--aethel-bg-base);
    color: var(--aethel-text);
    font-size: 14px;
}

.op__input:focus { outline: none; border-color: var(--aethel-gold); }
.op__btn { padding: 10px 16px; font-size: 14px; border-radius: var(--aethel-radius-input); }

.op__btn--ghost {
    border: 1px solid var(--aethel-border-strong);
    background: transparent;
    color: var(--aethel-text);
    font-weight: 600;
    cursor: pointer;
}

.op__btn--ghost:hover { border-color: var(--aethel-gold); }

/* ---- Panels + tables ---- */
.panel { margin-top: var(--aethel-s5); }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--aethel-s4); }
.panel__title { margin: 0; font-size: 18px; font-weight: 800; }
.panel__all { font-size: 13px; font-weight: 600; color: var(--aethel-gold); text-decoration: none; }

.cab-tablewrap { overflow-x: auto; padding: 4px; }
.cab-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.cab-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--aethel-text-muted);
    border-bottom: 1px solid var(--aethel-border);
    white-space: nowrap;
}

.cab-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.cab-table tbody tr:last-child td { border-bottom: none; }
.cab-table .num { text-align: right; }
.cab-table .muted { color: var(--aethel-text-muted); }

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

/* ---- Spot (1-min up/down trading) ---- */
.spot-live {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--aethel-text-muted);
}

.live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--aethel-teal);
    box-shadow: 0 0 8px rgba(45, 212, 191, 0.7);
    animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.spot-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--aethel-s4); align-items: start; }
@media (max-width: 820px) { .spot-grid { grid-template-columns: 1fr; } }

.spot-chart { padding: var(--aethel-s5); }
.spot-chart__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.spot-chart__sym { font-size: 16px; font-weight: 800; }
.spot-quote { display: flex; align-items: baseline; gap: 10px; }
.spot-price { font-size: 18px; font-weight: 800; }
.spot-chg { font-size: 13px; font-weight: 700; }
.spot-chg.is-pos { color: var(--aethel-success); }
.spot-chg.is-neg { color: var(--aethel-danger); }

.spot-chartbox { width: 100%; height: 380px; }
.candles { width: 100%; height: 280px; display: block; }
.candle__wick.is-up   { stroke: var(--aethel-success); }
.candle__wick.is-down { stroke: var(--aethel-danger); }
.candle__body.is-up   { fill: var(--aethel-success); }
.candle__body.is-down { fill: var(--aethel-danger); }

.spot-tf { display: flex; gap: 6px; margin-top: 12px; }
.spot-tf button {
    flex: 1; padding: 7px 0; border: none; border-radius: 8px;
    background: transparent; color: var(--aethel-text-muted);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.spot-tf button.is-active { background: rgba(212, 175, 55, 0.12); color: var(--aethel-gold); }

.spot-trade { padding: var(--aethel-s5); display: flex; flex-direction: column; gap: 12px; }
.spot-trade__head { display: flex; align-items: center; justify-content: space-between; }
.spot-trade__title { font-size: 15px; font-weight: 700; }

.spot-timer {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 700; color: var(--aethel-gold);
    font-variant-numeric: tabular-nums;
}

.spot-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--aethel-text-muted); }

.spot-input {
    padding: 12px 14px; border: 1px solid var(--aethel-border);
    border-radius: var(--aethel-radius-input); background: var(--aethel-bg-base);
    color: var(--aethel-text); font-size: 22px; font-weight: 800;
}
.spot-input:focus { outline: none; border-color: var(--aethel-gold); }
.spot-input:disabled { opacity: 0.6; }
.spot-conv { font-size: 13px; color: var(--aethel-text-muted); }

.spot-chips { display: flex; gap: 8px; }
.spot-chips button {
    flex: 1; padding: 9px; border: 1px solid var(--aethel-border);
    border-radius: var(--aethel-radius-input); background: var(--aethel-bg-base);
    color: var(--aethel-text); font-size: 13px; font-weight: 600; cursor: pointer;
}
.spot-chips button:hover:not(:disabled) { border-color: var(--aethel-gold); }
.spot-chips button:disabled { opacity: 0.5; cursor: not-allowed; }

.spot-payout { text-align: center; font-size: 13px; color: var(--aethel-text-muted); }
.spot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.spot-btn {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 14px; border: none; border-radius: var(--aethel-radius-input);
    font-weight: 800; cursor: pointer;
}
.spot-btn__dir { font-size: 16px; }
.spot-btn__act { font-size: 13px; font-weight: 700; opacity: 0.85; }
.spot-btn--up   { background: linear-gradient(135deg, var(--aethel-teal-bright), var(--aethel-teal)); color: #06140f; }
.spot-btn--down { background: linear-gradient(135deg, #F87171, var(--aethel-danger)); color: #2a0707; }
.spot-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.spot-result { text-align: center; font-weight: 700; font-size: 14px; margin: 0; }
.spot-result.is-win  { color: var(--aethel-success); }
.spot-result.is-lose { color: var(--aethel-danger); }

.spot-pos {
    padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
    border: 1px solid var(--aethel-border); border-left-width: 3px;
    border-radius: var(--aethel-radius-input); background: var(--aethel-bg-base);
}
.spot-pos.is-up   { border-left-color: var(--aethel-success); }
.spot-pos.is-down { border-left-color: var(--aethel-danger); }
.spot-pos__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spot-pos__dir { font-size: 14px; font-weight: 700; }
.spot-pos__timer { font-size: 14px; font-weight: 700; color: var(--aethel-gold); }
.spot-pos__sub { font-size: 12px; color: var(--aethel-text-muted); }
.spot-note { font-size: 12px; margin: 0; }

/* ---- Blazor error UI (kept from template) ---- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #1a1305;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ---- swap (AETHEL → USDT) ---- */
.swap-summary { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.swap-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--cab-muted, #9aa); }
.swap-row--total {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px; margin-top: 2px;
    color: inherit; font-weight: 700;
}
.swap-row--total .aethel-num { color: var(--aethel-gold); font-size: 18px; }
.swap-modal__backdrop {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.swap-modal { width: 100%; max-width: 440px; padding: 24px; }
