/* ═══════════════════════════════════════════════════════════
   SNSP Krypto-Handel – Styles
   Casino Purple Dark Theme
   ═══════════════════════════════════════════════════════════ */

:root {
  --p: #a855f7; --pl: #c084fc; --pd: #7c3aed;
  --ind: #6366f1; --bg: #06050e; --bgc: #0e0b1e;
  --tx: #ede9f6; --txd: #8b7fad; --brd: rgba(168,85,247,.12);
  --ok: #22c55e; --err: #ef4444; --warn: #f59e0b;
  --fd: 'Neofolia', sans-serif;
  --fb: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--fb); background: var(--bg); color: var(--tx); overflow-x: hidden; }
a { color: var(--pl); text-decoration: none; transition: color .2s; }
a:hover { color: #e9d5ff; }

/* ── Auth Pages ── */
.auth-page { display: flex; min-height: 100vh; }
.auth-left { flex: 1; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(168,85,247,.06), rgba(99,102,241,.03)); border-right: 1px solid var(--brd); padding: 40px; }
.auth-brand { text-align: center; }
.auth-logo { width: 100px; height: 100px; border-radius: 22px; overflow: hidden; margin: 0 auto 24px; box-shadow: 0 8px 40px rgba(168,85,247,.3); }
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-brand h1 { font-family: var(--fd); font-size: 28px; color: var(--pl); margin-bottom: 8px; }
.auth-brand p { color: var(--txd); font-size: 15px; }
.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form-container { width: 100%; max-width: 400px; }
.auth-form-container h2 { font-family: var(--fd); font-size: 24px; margin-bottom: 8px; color: var(--pl); }
.auth-form-container > p { color: var(--txd); margin-bottom: 28px; font-size: 14px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--txd); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(168,85,247,.15); background: rgba(13,10,31,.8); color: var(--tx); font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.form-input:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(168,85,247,.15); outline: none; }
.btn-submit { width: 100%; padding: 14px; border-radius: 12px; background: linear-gradient(135deg, var(--p), var(--pd)); color: #fff; font-size: 16px; font-weight: 600; border: none; cursor: pointer; transition: all .3s; }
.btn-submit:hover { background: linear-gradient(135deg, var(--pl), var(--p)); box-shadow: 0 6px 30px rgba(168,85,247,.35); }
.auth-links { margin-top: 20px; text-align: center; font-size: 14px; color: var(--txd); }

@media (max-width: 768px) {
  .auth-page { flex-direction: column; }
  .auth-left { border-right: none; border-bottom: 1px solid var(--brd); padding: 60px 24px 32px; min-height: auto; }
  .auth-right { padding: 32px 24px; }
}

/* ── Dashboard Layout ── */
.dashboard { max-width: 1200px; margin: 0 auto; padding: 24px; }

.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.dash-header h1 { font-family: var(--fd); font-size: 28px; background: linear-gradient(135deg, var(--pl), #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.dash-user { display: flex; align-items: center; gap: 12px; }
.dash-balance { background: rgba(168,85,247,.1); border: 1px solid rgba(168,85,247,.2); border-radius: 12px; padding: 8px 16px; font-weight: 600; color: var(--pl); }
.btn-logout { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2); border-radius: 10px; padding: 8px 16px; color: var(--err); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-logout:hover { background: rgba(239,68,68,.2); }
.user-name { color: var(--txd); font-size: 14px; }

/* ── Wallet Card ── */
.wallet-card { background: linear-gradient(135deg, #1a1040 0%, #13102b 100%); border: 1px solid rgba(168,85,247,.25); border-radius: 20px; padding: 28px; margin-bottom: 28px; position: relative; overflow: hidden; }
.wallet-card::before { content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(168,85,247,.08) 0%, transparent 70%); pointer-events: none; }
.wallet-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; position: relative; z-index: 1; }
.wallet-label { font-size: 13px; color: var(--txd); margin-bottom: 4px; }
.wallet-addr { font-family: 'Courier New', monospace; font-size: 14px; color: var(--pl); background: rgba(168,85,247,.1); padding: 6px 12px; border-radius: 8px; display: inline-block; cursor: pointer; transition: background .2s; }
.wallet-addr:hover { background: rgba(168,85,247,.2); }
.wallet-total { text-align: right; }
.wallet-total-label { font-size: 12px; color: var(--txd); }
.wallet-total-value { font-size: 28px; font-weight: 700; color: var(--pl); font-family: var(--fd); }
.wallet-coins { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.wallet-coin { background: rgba(168,85,247,.06); border: 1px solid rgba(168,85,247,.1); border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; min-width: 180px; }
.wallet-coin img { width: 28px; height: 28px; border-radius: 50%; }
.wallet-coin-info { flex: 1; }
.wallet-coin-symbol { font-weight: 700; font-size: 14px; }
.wallet-coin-amount { font-size: 12px; color: var(--txd); }
.wallet-coin-value { font-size: 12px; color: var(--pl); }
.wallet-empty { color: var(--txd); font-size: 14px; padding: 8px 0; }

/* ── Tab Navigation ── */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; background: rgba(168,85,247,.04); border-radius: 14px; padding: 4px; border: 1px solid var(--brd); }
.tab { flex: 1; padding: 12px 16px; border-radius: 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--txd); cursor: pointer; transition: all .25s; border: none; background: transparent; }
.tab:hover { color: var(--pl); background: rgba(168,85,247,.06); }
.tab.active { background: linear-gradient(135deg, var(--p), var(--pd)); color: #fff; box-shadow: 0 4px 16px rgba(168,85,247,.3); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Coin Grid (Prices) ── */
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.coin-card { background: var(--bgc); border: 1px solid var(--brd); border-radius: 16px; padding: 20px; transition: all .3s; cursor: pointer; position: relative; overflow: hidden; }
.coin-card:hover { border-color: rgba(168,85,247,.35); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(168,85,247,.1); }
.coin-card::before { content: ''; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(168,85,247,.04), transparent); transform: skewX(-15deg); }
.coin-card:hover::before { animation: cshine .5s ease; }
@keyframes cshine { 0% { left: -75%; } 100% { left: 125%; } }
.coin-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.coin-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(168,85,247,.1); }
.coin-name { font-weight: 700; font-size: 16px; }
.coin-symbol { font-size: 12px; color: var(--txd); font-weight: 600; }
.coin-price { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--pl); }
.coin-change { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; }
.coin-change.up { color: var(--ok); background: rgba(34,197,94,.1); }
.coin-change.down { color: var(--err); background: rgba(239,68,68,.1); }
.coin-desc { font-size: 12px; color: var(--txd); margin-top: 10px; line-height: 1.5; }
.coin-real { font-size: 11px; color: rgba(139,127,173,.5); margin-top: 4px; }

/* ── Trade Panel ── */
.trade-panel { background: var(--bgc); border: 1px solid var(--brd); border-radius: 18px; padding: 28px; max-width: 500px; margin: 0 auto; }
.trade-panel h3 { font-family: var(--fd); font-size: 20px; margin-bottom: 20px; color: var(--pl); }
.trade-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: rgba(168,85,247,.06); border-radius: 10px; padding: 3px; }
.trade-tab { flex: 1; padding: 10px; text-align: center; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; border: none; background: transparent; color: var(--txd); transition: all .2s; }
.trade-tab.active-buy { background: rgba(34,197,94,.15); color: var(--ok); }
.trade-tab.active-sell { background: rgba(239,68,68,.15); color: var(--err); }
.trade-coin-select { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.trade-coin-opt { padding: 8px 14px; border-radius: 8px; background: rgba(168,85,247,.06); border: 1px solid rgba(168,85,247,.1); color: var(--txd); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; display: flex; align-items: center; gap: 6px; }
.trade-coin-opt:hover { border-color: rgba(168,85,247,.3); color: var(--pl); }
.trade-coin-opt.selected { background: rgba(168,85,247,.15); border-color: var(--p); color: var(--pl); }
.trade-coin-opt img { width: 18px; height: 18px; border-radius: 50%; }
.trade-amount-group { margin-bottom: 16px; }
.trade-amount-group label { font-size: 13px; color: var(--txd); display: block; margin-bottom: 6px; }
.trade-amount-group input { width: 100%; padding: 14px 16px; border-radius: 10px; background: rgba(13,10,31,.8); border: 1px solid rgba(168,85,247,.15); color: var(--tx); font-size: 16px; }
.trade-amount-group input:focus { border-color: var(--p); box-shadow: 0 0 0 3px rgba(168,85,247,.12); outline: none; }
.trade-preview { background: rgba(168,85,247,.04); border-radius: 10px; padding: 14px; margin-bottom: 20px; font-size: 13px; color: var(--txd); line-height: 1.8; }
.trade-preview strong { color: var(--tx); }
.trade-preview .spread { color: var(--warn); }
.btn-trade { width: 100%; padding: 16px; border-radius: 12px; font-size: 16px; font-weight: 700; border: none; cursor: pointer; transition: all .3s; letter-spacing: .5px; }
.btn-buy { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn-buy:hover { box-shadow: 0 6px 24px rgba(34,197,94,.35); }
.btn-sell { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-sell:hover { box-shadow: 0 6px 24px rgba(239,68,68,.35); }
.btn-trade:disabled { opacity: .5; cursor: not-allowed; }

/* ── Transfer Panel ── */
.transfer-panel { background: var(--bgc); border: 1px solid var(--brd); border-radius: 18px; padding: 28px; max-width: 500px; margin: 0 auto; }
.transfer-panel h3 { font-family: var(--fd); font-size: 20px; margin-bottom: 20px; color: var(--pl); }
.btn-transfer { width: 100%; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, var(--p), var(--pd)); color: #fff; font-size: 16px; font-weight: 700; border: none; cursor: pointer; transition: all .3s; }
.btn-transfer:hover { box-shadow: 0 6px 24px rgba(168,85,247,.35); }

/* ── Transaction History ── */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--bgc); border: 1px solid var(--brd); border-radius: 12px; transition: border-color .2s; }
.tx-item:hover { border-color: rgba(168,85,247,.25); }
.tx-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.tx-icon.buy { background: rgba(34,197,94,.1); }
.tx-icon.sell { background: rgba(239,68,68,.1); }
.tx-icon.transfer { background: rgba(168,85,247,.1); }
.tx-icon.payment { background: rgba(245,158,11,.1); }
.tx-info { flex: 1; min-width: 0; }
.tx-type { font-weight: 600; font-size: 14px; }
.tx-purpose { font-size: 12px; color: var(--txd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amounts { text-align: right; flex-shrink: 0; }
.tx-coin { font-weight: 700; font-size: 14px; }
.tx-eur { font-size: 12px; color: var(--txd); }
.tx-date { font-size: 11px; color: rgba(139,127,173,.5); }
.tx-empty { text-align: center; padding: 40px 20px; color: var(--txd); }

/* ── Toast ── */
#toast-container { position: fixed; top: 90px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-radius: 12px; background: rgba(19,16,43,.95); border: 1px solid rgba(168,85,247,.2); backdrop-filter: blur(12px); font-size: 14px; animation: slideIn .3s ease; box-shadow: 0 8px 24px rgba(0,0,0,.4); min-width: 280px; }
.toast.success { border-color: rgba(34,197,94,.3); }
.toast.error { border-color: rgba(239,68,68,.3); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ── Loading Overlay ── */
#loading { display: none; position: fixed; inset: 0; background: rgba(6,5,14,.85); z-index: 9998; justify-content: center; align-items: center; flex-direction: column; gap: 16px; }
#loading.active { display: flex; }
.spinner { width: 48px; height: 48px; border: 3px solid rgba(168,85,247,.15); border-top-color: var(--p); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loading-text { color: var(--txd); font-size: 15px; }

/* ── Disclaimer Button ── */
.auth-disclaimer-btn { position: fixed; bottom: 16px; right: 16px; z-index: 100; background: rgba(19,16,43,.8); color: var(--pl); padding: 8px 14px; border-radius: 10px; font-size: 13px; border: 1px solid rgba(168,85,247,.15); transition: all .2s; }
.auth-disclaimer-btn:hover { background: rgba(168,85,247,.12); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .dashboard { padding: 16px; }
  .wallet-card { padding: 20px; }
  .wallet-header { flex-direction: column; gap: 12px; }
  .wallet-total { text-align: left; }
  .tabs { overflow-x: auto; }
  .coin-grid { grid-template-columns: 1fr; }
  .trade-coin-select { gap: 6px; }
}
