/* ============================================================
   Futuros Cripto - pagina nativa (sem proxy)
   Paleta alinhada ao tema do site: fundo #090C1D, paineis #191939
   ============================================================ */

.fx-page {
    --fx-panel: #191939;
    --fx-panel-soft: rgba(255, 255, 255, 0.035);
    --fx-panel-line: rgba(255, 255, 255, 0.08);
    --fx-green: var(--rb-gold, #01e0a3);
    --fx-green-deep: var(--rb-gold-deep, #04241b);
    --fx-red: #ff4d5e;
    --fx-text: #ffffff;
    --fx-text-soft: rgba(191, 191, 191, 0.82);
    --fx-text-faint: rgba(160, 160, 160, 0.55);
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--fx-text);
}

/* ---------- topo ---------- */
.fx-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.fx-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fx-title-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--fx-panel);
    color: var(--fx-green);
    font-size: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fx-title h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.fx-title p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--fx-text-faint);
}

.fx-quote {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--fx-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fx-quote-symbol {
    font-size: 12px;
    font-weight: 700;
    color: var(--fx-text-faint);
}

.fx-quote-price {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.fx-quote-change {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--fx-text-faint);
}

.fx-quote-change.is-up { color: var(--fx-green); }
.fx-quote-change.is-down { color: var(--fx-red); }

/* ---------- grid ---------- */
.fx-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.fx-col-main,
.fx-col-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.fx-card {
    background: var(--fx-panel);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ---------- cabecalho do mercado (clone WBET) ---------- */
.fx-market {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
}

.fx-pick {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    max-width: 100%;
    padding: 8px;
    border-radius: 12px;
    background-image: var(--rb-surface-sunken, linear-gradient(180deg, #12142E 0%, #0E1124 100%));
    cursor: pointer;
}

.fx-pick-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 999px;
}

.fx-pick-text { min-width: 0; }

.fx-pick-symbol {
    display: block;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fx-pick-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--fx-text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fx-pick-chev { flex-shrink: 0; color: var(--fx-text-faint); }

.fx-pick-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.fx-pick-select option { background: #191939; color: #fff; }

.fx-market-side {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.fx-icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 12px;
    color: var(--fx-text-faint);
    background-image: var(--rb-surface-sunken, linear-gradient(180deg, #12142E 0%, #0E1124 100%));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: color .15s, filter .15s;
}

.fx-icon-btn:hover { color: var(--fx-text); filter: brightness(1.15); }
.fx-icon-btn--gold { color: var(--rb-gold, #01e0a3); }

.fx-views {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 4px;
    border-radius: 12px;
    background-image: var(--rb-surface-sunken, linear-gradient(180deg, #12142E 0%, #0E1124 100%));
}

.fx-view {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 550;
    color: var(--fx-text-faint);
    background: transparent;
    transition: color .15s, background .15s;
}

.fx-view:hover { color: var(--fx-text); }

.fx-view.is-active {
    background: var(--rb-gold, #01e0a3);
    color: var(--rb-gold-deep, #04241b);
    font-weight: 600;
}

.fx-views-sep {
    width: 1px;
    height: 18px;
    margin: 0 5px;
    background: var(--fx-panel-line);
}

/* estatisticas 24h (na caixa de cotacao) */
.fx-quote-stats {
    display: flex;
    gap: 10px;
    margin-left: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--fx-panel-line);
    font-size: 11px;
    color: var(--fx-text-faint);
}

.fx-quote-stats strong {
    color: var(--fx-text-soft);
    font-variant-numeric: tabular-nums;
}

/* ---------- modais ---------- */
.fx-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: grid;
    place-items: center;
    padding: 16px;
}

.fx-modal[hidden] { display: none; }

.fx-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 18, 0.66);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.fx-modal-card {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 18px;
    border-radius: 16px;
    background: var(--fx-panel, #191939);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: fx-in .2s ease both;
}

.fx-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.fx-modal-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.fx-modal-x {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 10px;
    color: var(--fx-text-faint);
    background: rgba(255, 255, 255, 0.06);
    font-size: 18px;
    line-height: 1;
    transition: color .15s, background .15s;
}

.fx-modal-x:hover { color: var(--fx-text); background: rgba(255, 255, 255, 0.12); }

.fx-modal-body { display: flex; flex-direction: column; gap: 12px; }

.fx-calc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.fx-suffix {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--fx-text-faint);
}

.fx-calc-scen { display: flex; flex-direction: column; gap: 6px; }

.fx-scen-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.fx-scen-row span:first-child { color: var(--fx-text-faint); }
.fx-scen-row .is-up { color: var(--fx-green, #01e0a3); font-weight: 700; }
.fx-scen-row .is-down { color: var(--fx-red, #ff4d5e); font-weight: 700; }

.fx-help { gap: 10px; }
.fx-help-item b { display: block; margin-bottom: 2px; font-size: 13px; }
.fx-help-item p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--fx-text-soft); }
/* ---------- grafico ---------- */
.fx-chart-card {
    position: relative;
    padding: 10px 12px 6px;
    height: 420px;
}

#fxCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.fx-chart-tag {
    position: absolute;
    top: 14px;
    left: 16px;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--fx-text-faint);
    background: rgba(0, 0, 0, 0.28);
}

/* ---------- tabelas ---------- */
.fx-table-card {
    padding: 6px 6px 4px;
}

.fx-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
}

.fx-tab {
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fx-text-faint);
    transition: color .15s, background .15s;
}

.fx-tab:hover { color: var(--fx-text); }

.fx-tab.is-active {
    background-image: linear-gradient(420deg, rgb(0 255 142) 0%, #01e0a3 49%, #00aa6d 49%, #00aa6d 100%);
    color: var(--fx-green-deep);
    font-weight: 700;
}

.fx-table-wrap {
    position: relative;
    min-height: 150px;
    max-height: 320px;
    overflow: auto;
}

.fx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.fx-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--fx-text-faint);
    background: var(--fx-panel);
    white-space: nowrap;
}

.fx-table tbody td {
    padding: 11px 12px;
    color: var(--fx-text-soft);
    white-space: nowrap;
    border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.fx-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.fx-table .fx-pos { color: var(--fx-green); font-weight: 700; }
.fx-table .fx-neg { color: var(--fx-red); font-weight: 700; }
.fx-table .fx-side-long { color: var(--fx-green); font-weight: 700; }
.fx-table .fx-side-short { color: var(--fx-red); font-weight: 700; }

.fx-table .fx-close-btn {
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--fx-text);
    background: rgba(255, 255, 255, 0.08);
    transition: background .15s;
}

.fx-table .fx-close-btn:hover { background: rgba(255, 255, 255, 0.16); }

.fx-empty {
    padding: 34px 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--fx-text-faint);
}

.fx-empty.hidden { display: none; }

/* ---------- painel de ordem (clone WBET) ---------- */
.fx-order {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

/* caixa afundada (Saldo/Simbolo e resumo) */
.fx-box {
    padding: 12px;
    border-radius: 8px;
    background: var(--rb-card-sunken, #12142E);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 500;
}

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

.fx-row--gap { margin-top: 8px; }

.fx-row-label { color: var(--fx-text-faint); }

.fx-row-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.fx-row-value--gold { color: var(--rb-gold, #01e0a3); }

.fx-row-value--trunc {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* moeda ($) */
.fx-cur {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--rb-gold, #01e0a3);
    color: var(--rb-gold-deep, #04241b);
    font-size: 9px;
    font-weight: 600;
}

.fx-cur--sm { width: 16px; height: 16px; font-size: 8px; }

/* campos */
.fx-field2 { display: block; }

.fx-field2-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--fx-text-faint);
}

.fx-field2-label--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fx-input-box {
    display: flex;
    align-items: center;
    margin-top: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--rb-card-sunken, #12142E);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.fx-input-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--fx-text);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fx-input-box input::-webkit-outer-spin-button,
.fx-input-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* barra de alavancagem (identica a WBET) */
.fx-range {
    width: 100%;
    height: 6px;
    margin-top: 8px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 999px;
    outline: none;
    background: linear-gradient(90deg, #2fd063 0%, #f5ca55 50%, #ff3d5f 100%);
}

.fx-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #f5ca55;
    border: 3px solid #111827;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.fx-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #f5ca55;
    border: 3px solid #111827;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.fx-range-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--fx-text-faint);
}

/* TP / SL */
.fx-tpsl2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.fx-opt {
    width: 100%;
    margin-top: 4px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    outline: none;
    background: var(--rb-card-sunken, #12142E);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: var(--fx-text);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fx-opt::placeholder { color: var(--fx-text-faint); font-weight: 600; }
.fx-opt:focus { box-shadow: 0 0 0 1px rgba(1, 224, 163, 0.45); }

/* botoes Longo / Curto (clone WBET: gradiente + efeito 3D) */
.fx-keys {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.fm-key {
    --fm-key: #01e0a3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 550;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    background-color: var(--fm-key);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.03) 48%, rgba(0, 0, 0, 0) 52%),
        linear-gradient(180deg, var(--fm-key) 0%, var(--fm-key) 52%, var(--fm-key) 100%);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.03) 48%, rgba(0, 0, 0, 0) 52%),
        linear-gradient(180deg, color-mix(in srgb, var(--fm-key) 84%, #fff) 0%, var(--fm-key) 52%, color-mix(in srgb, var(--fm-key) 80%, #000) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 var(--fm-key),
        0 4px 0 var(--fm-key),
        0 5px 0 rgba(0, 0, 0, 0.28),
        0 12px 20px -8px var(--fm-key);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 color-mix(in srgb, var(--fm-key) 65%, #000),
        0 4px 0 color-mix(in srgb, var(--fm-key) 48%, #000),
        0 5px 0 rgba(0, 0, 0, 0.28),
        0 12px 20px -8px color-mix(in srgb, var(--fm-key) 50%, transparent);
    transition: filter .15s, transform .06s, box-shadow .06s;
}

.fm-key--long { --fm-key: #01e0a3; }
.fm-key--short { --fm-key: #ff4d5e; }

.fm-key:hover { filter: brightness(1.08); }
.fm-key:disabled { opacity: 0.6; cursor: not-allowed; }

.fm-key:not(:disabled):active {
    transform: translateY(3px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 1px 0 color-mix(in srgb, var(--fm-key) 48%, #000),
        0 3px 6px -3px rgba(0, 0, 0, 0.5);
}

.fm-key__icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--fm-key);
    background: color-mix(in srgb, var(--fm-key) 55%, #000);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.fm-key__icon svg { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.fm-key--long:hover .fm-key__icon svg { transform: translate(1px, -2px); }
.fm-key--short:hover .fm-key__icon svg { transform: translate(1px, 2px); }

/* convidado */
.fx-guest {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(1, 224, 163, 0.08);
}

.fx-guest p {
    margin: 0;
    font-size: 12px;
    color: var(--fx-text-soft);
}

.fx-btn-login {
    padding: 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--rb-gold-deep, #04241b);
    background: var(--rb-gold, #01e0a3);
}
/* ---------- toasts ---------- */
.fx-toasts {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.fx-toast {
    min-width: 210px;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: #191939;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    animation: fx-in .22s ease both;
}

.fx-toast.is-ok { border-left: 3px solid var(--fx-green, #01e0a3); }
.fx-toast.is-err { border-left: 3px solid #ff4d5e; }

@keyframes fx-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- responsivo ---------- */
@media (max-width: 1080px) {
    .fx-grid { grid-template-columns: minmax(0, 1fr); }
    .fx-chart-card { height: 330px; }
}

@media (max-width: 640px) {
    .fx-quote-stats { display: none; }
    .fx-title p { display: none; }
    .fx-quote { width: 100%; justify-content: space-between; }
    .fx-chart-card { height: 260px; }
    .fx-pick { min-width: 0; }
    .fx-pick-name { display: none; }
}
