/* ============================================================
   STYLE.CSS — BRN Exchange
   Versão: 6.13 | Data: 2026-09-26
   ✅ Base v5.5 (btns, share-panel, bridge, dots)
   ✅ v6.10: botão 📋 copiar contrato
   ✅ v6.10: rodapé "ENDEREÇO BRN" marrom no card de saldo
   ✅ v6.12: modal "Carteiras Aceitas" (overlay, cards, grids)
   ✅ v6.12: modal "Verificador de Redes" (redes-grid, rede-card)
   ✅ v6.13: FIX #btcSaldoDisponivel (era #btcSaldoDis:ponivel)
   ✅ v6.13: FIX regra :disabled dos botões BTC (CSS malformado)
   ✅ v6.13: FIX word-break (era word bottom-break)
   ✅ v6.13: painel Cross-Chain enriquecido (selects, box passos, warns)
   ============================================================ */

:root {
    color-scheme: dark;
    --bg: #0d1117;
    --card: #161b22;
    --border: #30363d;
    --accent: #238636;
    --accent-hover: #2ea043;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --danger: #da3633;
    --btc: #f7931a;
    --eth: #627eea;
    --bsc: #f0b90b;
    --polygon: #8247e5;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* ==================== HEADER ==================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.header-left h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.header-left p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.net-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

/* ==================== DOTS DE STATUS ==================== */
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    transition: background 0.2s;
}

.dot.off { background: var(--danger); }

.dot.load {
    background: #d29922;
    animation: pulse 1s infinite;
}

.dot.btc-status { background: var(--btc); }
.dot.btc-status.off { background: var(--danger); }
.dot.btc-status.load {
    background: #d29922;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==================== BOTÕES ==================== */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s, transform 0.1s, background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.btn:hover:not(:disabled) {
    border-color: var(--text-muted);
    background: var(--card);
}

.btn:active { transform: scale(0.98); }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-ok {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-err {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-err:hover:not(:disabled) {
    background: #b62b28;
    border-color: #b62b28;
}

.btn-btc {
    background: var(--btc);
    color: #000;
    font-weight: 600;
    white-space: nowrap;
    border-color: var(--btc);
}

.btn-btc:hover:not(:disabled) {
    background: #f9a847;
    border-color: #f9a847;
}

.btn-success {
    background: #10b981;
    color: white;
    padding: 10px 16px;
    border: 1px solid #10b981;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 10px 16px;
    border: 1px solid #ef4444;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.tabs button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
    font-family: inherit;
}

.tabs button:hover { background: rgba(48, 54, 61, 0.5); }

.tabs button.active {
    background: var(--card);
    color: var(--text);
}

/* ==================== PAINÉIS ==================== */
.panel { animation: fadeIn 0.2s ease; }
.panel[hidden] { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== CARDS ==================== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.card h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    margin-top: 0;
}

.dim { color: var(--text-muted); }

/* ==================== INPUTS ==================== */
.input-group { margin-bottom: 12px; }

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

input, select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}

input::placeholder { color: var(--text-muted); opacity: 0.7; }
select { cursor: pointer; }

.row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.row input { flex: 1; min-width: 0; }
.row select { flex: 1; min-width: 0; }

/* ==================== ✅ v6.13: Cross-Chain selects destacados ==================== */
#ccTokenOrigem,
#ccTokenDestino {
    font-weight: 600;
    letter-spacing: 0.2px;
    border-left: 3px solid var(--accent);
}

#ccTokenOrigem option,
#ccTokenDestino option {
    background: var(--bg);
    color: var(--text);
    padding: 6px;
}

/* ==================== SALDOS (GRID PRINCIPAL) ==================== */
.balances {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.bal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
    position: relative;
    padding-bottom: 42px !important; /* ✅ v6.10: espaço para o rodapé */
    overflow: hidden;
}

.bal:hover { border-color: var(--accent); }

.bal .t {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.bal .v {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-all;
}

.bal .v.dim { color: var(--text-muted); }

.bal-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==================== ✅ v6.10: BOTÃO COPIAR CONTRATO ==================== */
.btn-copy-token {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
    opacity: 0.5;
    line-height: 1;
    font-family: inherit;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-copy-token:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
    transform: scale(1.15);
}

.btn-copy-token:active { transform: scale(0.95); }

/* ==================== ✅ v6.10: RODAPÉ "ENDEREÇO BRN" (MARROM) ==================== */
.bal-endereco {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 2px solid #8B4513;
    background: linear-gradient(180deg,
        rgba(139, 69, 19, 0.10) 0%,
        rgba(139, 69, 19, 0.25) 100%);
    color: #d4a373;
    font-size: 0.62rem;
    text-align: center;
    padding: 5px 6px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    cursor: pointer;
    transition: background 0.15s ease;
}

/* Efeito de brilho na borda superior */
.bal-endereco::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        #8B4513 10%,
        #cd853f 50%,
        #8B4513 90%,
        transparent 100%);
    pointer-events: none;
}

.bal-endereco:hover {
    background: linear-gradient(180deg,
        rgba(139, 69, 19, 0.18) 0%,
        rgba(139, 69, 19, 0.32) 100%);
    border-top-color: #cd853f;
}

.bal-endereco:active {
    background: rgba(139, 69, 19, 0.4);
}

.bal-endereco-label {
    color: #ff8c42;
    font-weight: 700;
    margin-right: 4px;
    text-shadow: 0 0 4px rgba(255, 140, 66, 0.35);
    letter-spacing: 0.4px;
}

.bal-endereco-valor {
    color: #d4a373;
    font-weight: 500;
}

.bal-endereco:hover .bal-endereco-valor { color: #f4a460; }

/* ==================== CHIPS DE TOKENS ==================== */
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.chip.brn { background: #4f46f1; color: white; }
.chip.pol { background: #8247e5; color: white; }
.chip.usdc { background: #2775ca; color: white; }
.chip.usdt { background: #26a17b; color: white; }
.chip.wpol { background: #8247e5; color: white; }
.chip.wbtc { background: #f7931a; color: #000; }
.chip.btc { background: var(--btc); color: #000; }
.chip.other { background: var(--border); color: var(--text); }

/* ==================== FILTROS ==================== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
}

.filters > * { flex: 1; min-width: 120px; }

.filters label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    min-width: 140px;
    user-select: none;
}

.filters input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ==================== MURAL DE ORDENS ==================== */
.orders {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.2s, transform 0.15s;
}

.order:hover { transform: translateY(-1px); }

.order.active { border-color: var(--accent); }
.order.done { border-color: #1a7f37; opacity: 0.8; }
.order.cancelled { border-color: var(--danger); opacity: 0.6; }
.order.blocked { border-color: #d29922; opacity: 0.7; }
.order.error { border-color: var(--danger); opacity: 0.6; }

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

.order-num {
    font-weight: bold;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.order-id {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    word-break: break-all;
}

.tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag.active { background: rgba(35, 134, 54, 0.15); color: #3fb950; }
.tag.done { background: rgba(26, 127, 55, 0.15); color: #3fb950; }
.tag.cancelled { background: rgba(218, 54, 51, 0.15); color: #da3633; }
.tag.blocked { background: rgba(210, 153, 34, 0.15); color: #d29922; }

.swap {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 12px 0;
    gap: 8px;
}

.swap-side { text-align: center; flex: 1; min-width: 0; }

.swap-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.swap-amt {
    font-size: 1.1rem;
    font-weight: 600;
    word-break: break-all;
}

.swap-icon {
    font-size: 1.2rem;
    padding: 0 8px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.swap-escrow {
    font-size: 0.75rem;
    margin-top: 4px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.swap-escrow.ok { color: var(--accent); }
.swap-escrow.bad { color: var(--danger); }

.order-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.order-meta { font-size: 0.8rem; color: var(--text-muted); }

.order-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.order-note {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.warn {
    background: rgba(210, 153, 34, 0.1);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.source-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
    padding: 8px 10px;
    background: rgba(210, 153, 34, 0.08);
    border-left: 3px solid #d29922;
    border-radius: 4px;
    line-height: 1.5;
}

/* ==================== ✅ v6.13: BOX DE PASSOS (Cross-Chain) ==================== */
.steps-box {
    background: rgba(88, 166, 255, 0.06);
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-top: 14px;
    font-size: 0.82rem;
    line-height: 1.6;
}

.steps-box strong {
    color: #58a6ff;
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.steps-box ol {
    padding-left: 20px;
    margin: 0;
}

.steps-box li {
    margin: 4px 0;
    color: var(--text-muted);
}

.steps-box .gas-warn {
    display: block;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    color: #d29922;
    font-weight: 500;
}

/* ==================== ✅ v6.13: BADGES DE REDE ==================== */
.rede-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    margin-left: 4px;
}

.rede-badge.polygon { background: rgba(130, 71, 229, 0.2); color: #a97fee; }
.rede-badge.ethereum { background: rgba(98, 126, 234, 0.2); color: #8fa5f0; }
.rede-badge.bsc { background: rgba(240, 185, 11, 0.2); color: var(--bsc); }

/* ==================== ESTADOS ==================== */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty .big {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== TOASTS ==================== */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: slideIn 0.2s ease;
    transition: opacity 0.2s;
    pointer-events: auto;
    font-size: 0.9rem;
    word-break: break-word;
    white-space: pre-line;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.ok { border-left: 3px solid var(--accent); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.warn { border-left: 3px solid #d29922; }
.toast.info { border-left: 3px solid #58a6ff; }

.toast a {
    color: #58a6ff;
    font-size: 0.8rem;
    margin-left: 6px;
    white-space: nowrap;
}

/* ==================== BARRA DA CARTEIRA ==================== */
.wallet-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wallet-info code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.wallet-info span { font-size: 0.9rem; }

/* ==================== PAINEL DE COMPARTILHAMENTO ==================== */
.share-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;
}

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

.share-head h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.share-addr-box {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
}

.share-addr-box code {
    flex: 1;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    word-break: break-all;
    color: var(--text-muted);
}

.share-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-actions .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
    text-decoration: none;
}

/* ==================== BALANÇOS (linha única) ==================== */
.bal-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

/* ==================== BITCOIN ==================== */
.btc-address {
    background: rgba(247, 147, 26, 0.08);
    border: 1px solid var(--btc);
    border-radius: var(--radius);
    padding: 14px;
    margin: 12px 0;
}

.btc-address h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--btc);
}

.btc-address code {
    display: block;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
    margin-top: 8px;
    color: var(--btc);
    font-size: 0.9rem;
}

.btc-balance-result {
    background: rgba(247, 147, 26, 0.05);
    border: 1px solid var(--btc);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    display: none;
}

.btc-balance-result.show {
    display: block;
    animation: fadeIn 0.25s ease;
}

.btc-balance-result .t {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.btc-balance-result .v {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--btc);
    word-break: break-all;
}

/* ==================== BRIDGE WBTC → BTC ==================== */
#bridge-result { animation: fadeIn 0.25s ease; }

#bridge-result code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.3px;
}

#bridge-result strong { color: var(--btc); }

/* ==================== ✅ v6.13: RESULT CROSS-CHAIN ==================== */
#cc-result { animation: fadeIn 0.25s ease; }

#cc-result code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.3px;
}

#cc-result strong { color: var(--btc); }

/* ==================== ✅ v6.13: FIX — ENVIO DE BTC ==================== */
#btcWalletStatus {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
    color: var(--btc);
    font-size: 0.8rem;
    word-break: break-all; /* ✅ FIX v6.13: era "word bottom-break" */
}

/* ✅ FIX v6.13: seletor correto (era "#btcSaldoDis:ponivel") */
#btcSaldoDisponivel {
    font-weight: 600;
    color: var(--btc);
}

/* ✅ FIX v6.13: regra unificada (antes estava malformada com ";" e ",") */
#btnEnviarBTC:disabled,
#btnConectarBTC:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==================== FORMULÁRIOS DE SWAP ==================== */
.trade-forms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

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

.form-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text);
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

/* ==================== TIPOGRAFIA GERAL ==================== */
ul {
    padding-left: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

ul li { margin: 4px 0; line-height: 1.5; }

a {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.15s;
}

a:hover { text-decoration: underline; }

small { font-size: 0.75rem; }

code { font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace; }

.hidden { display: none !important; }

.debug-info {
    font-size: 0.75rem;
    margin-top: 8px;
    padding: 8px;
    background: rgba(88, 166, 255, 0.05);
    border-radius: 4px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ============================================================
   ✅ v6.12: MODAL (base compartilhada)
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.modal-section-title {
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
}

.modal-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================
   ✅ v6.12: MODAL "CARTEIRAS ACEITAS" — grid + cards
   ============================================================ */
.carteiras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.carteira-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: all 0.15s ease;
}

.carteira-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.15);
}

.carteira-card.detectada {
    border-color: var(--accent);
    background: rgba(35, 134, 54, 0.06);
}

.carteira-card.indisponivel { opacity: 0.75; }

.carteira-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.carteira-nome {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.carteira-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.carteira-status.ok {
    color: #3fb950;
    background: rgba(35, 134, 54, 0.15);
}

.carteira-status.off { color: var(--text-muted); }

.carteira-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s;
    margin-top: 4px;
    width: 100%;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.carteira-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
    text-decoration: none;
}

.carteira-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.carteira-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.carteira-btn.btc {
    background: var(--btc);
    border-color: var(--btc);
    color: #000;
}

.carteira-btn.btc:hover {
    background: #f9a847;
    border-color: #f9a847;
}

.carteira-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   ✅ v6.12: MODAL "VERIFICADOR DE REDES"
   ============================================================ */
.redes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.rede-card {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.rede-card.ativa {
    box-shadow: 0 0 15px rgba(35, 134, 54, 0.3);
    transform: scale(1.02);
}

.rede-icon {
    font-size: 2rem;
    line-height: 1;
}

.rede-nome {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.rede-status {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.rede-status.ok {
    color: #3fb950;
    background: rgba(35, 134, 54, 0.2);
    font-weight: 700;
}

.rede-status.off {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

/* ==================== RESPONSIVIDADE ==================== */
@media (max-width: 768px) {
    .trade-forms { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    body { padding: 10px; }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wallet-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .wallet-info { justify-content: space-between; }

    .filters { flex-direction: column; }
    .filters > * { width: 100%; }

    .swap {
        flex-direction: column;
        gap: 8px;
    }

    .swap-icon { transform: rotate(90deg); }

    .order-foot {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-actions { width: 100%; }
    .order-actions .btn { flex: 1; }

    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .row { flex-wrap: wrap; }
    .row input,
    .row select,
    .row button { width: 100%; }

    .balances {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .bal {
        padding-bottom: 38px !important;
    }

    .bal-endereco {
        font-size: 0.55rem;
        padding: 4px 4px;
    }

    .card { padding: 16px; }

    .share-actions { flex-direction: column; }
    .share-actions .btn { width: 100%; }

    .share-addr-box {
        flex-direction: column;
        align-items: stretch;
    }

    .share-addr-box code { text-align: center; }

    /* Modais em mobile */
    .modal-content { padding: 16px; }

    .carteiras-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }

    .carteira-icon { font-size: 1.5rem; }
    .carteira-nome { font-size: 0.8rem; }
    .carteira-status { font-size: 0.65rem; }
    .carteira-btn { font-size: 0.7rem; }

    .redes-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .rede-icon { font-size: 1.5rem; }
    .rede-nome { font-size: 0.8rem; }
    .rede-status { font-size: 0.65rem; }

    /* v6.13: Cross-Chain em mobile */
    #ccTokenOrigem,
    #ccTokenDestino {
        font-size: 0.9rem;
    }

    .steps-box {
        font-size: 0.78rem;
        padding: 10px 12px;
    }
}
