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

:root {
  --bg: #070d0b; --surface: #0d1612; --surface2: #111e19; --border: #1a2e26;
  --accent: #00d4aa; --accent2: #00ffc4; --text: #e8f0ee; --muted: #4a6e62;
  --error: #ff4d6d; --green: #00d4aa; --yellow: #f5c542; --orange: #ff8c42;
  --mono: 'JetBrains Mono', monospace; --display: 'Syne', sans-serif; --body: 'Inter', sans-serif;
}

body { background: var(--bg); color: var(--text); font-family: var(--body); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }

.grid-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(rgba(0,212,170,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(0,212,170,.04) 1px, transparent 1px); background-size: 40px 40px; }
.glow { position: fixed; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(0,212,170,.12) 0%, transparent 70%); top: -150px; left: -150px; pointer-events: none; z-index: 0; }
.glow2 { position: fixed; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle, rgba(0,255,196,.07) 0%, transparent 70%); bottom: -100px; right: -100px; pointer-events: none; z-index: 0; }

header { position: relative; z-index: 10; background: rgba(7,13,11,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 24px; height: 56px; flex-shrink: 0; }
.header-inner { max-width: 960px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--display); font-size: 18px; font-weight: 800; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-text { background: linear-gradient(135deg, #00ffc4, #00d4aa, #00a87e, #00e5cc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
#user-area { display: flex; align-items: center; gap: 10px; }
#user-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); }

main { flex: 1; position: relative; z-index: 1; max-width: 960px; margin: 0 auto; width: 100%; padding: 40px 24px; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 8px; font-family: var(--display); font-size: 14px; font-weight: 700; cursor: pointer; border: none; transition: opacity .2s, transform .1s; text-decoration: none; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, #00a87e, #00d4aa); color: #050e0a; box-shadow: 0 0 16px rgba(0,212,170,.3); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); font-family: var(--body); font-size: 13px; font-weight: 400; }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-danger { background: var(--error); color: #fff; }
.btn-success { background: #0d4a32; color: #fff; border: 1px solid #00a87e; }
.btn-success:hover { background: #00a87e; color: #050e0a; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-full { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px 24px; box-shadow: 0 0 40px rgba(0,212,170,.06), 0 16px 32px rgba(0,0,0,.4); animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.hero { text-align: center; padding: 64px 0 48px; }
.hero-badge { display: inline-block; padding: 4px 14px; border-radius: 99px; border: 1px solid rgba(0,212,170,.4); background: rgba(0,212,170,.1); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 24px; }
.hero h1 { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1.15; margin-bottom: 16px; background: linear-gradient(135deg, #e8f0ee 30%, #7ab8a8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { color: var(--muted); font-size: 15px; margin-bottom: 32px; max-width: 500px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 48px; }
@media (max-width: 600px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 16px; text-align: center; }
.stat-value { font-family: var(--display); font-size: 28px; font-weight: 800; background: linear-gradient(135deg, #00a87e, #00d4aa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.network-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 600px) { .network-grid { grid-template-columns: repeat(2, 1fr); } }
.network-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 16px; text-align: center; transition: border-color .2s; }
.network-card:hover { border-color: rgba(0,212,170,.4); }
.network-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 11px; font-weight: 700; font-family: var(--display); }
.network-icon.usdc { background: rgba(39,117,202,.15); color: #2775ca; border: 1px solid rgba(39,117,202,.3); }
.network-icon.usdt { background: rgba(38,161,123,.15); color: #26a17b; border: 1px solid rgba(38,161,123,.3); }
.network-icon.ltc  { background: rgba(191,187,187,.1); color: #bfbbbb; border: 1px solid rgba(191,187,187,.2); }
.network-icon.sol  { background: rgba(153,69,255,.15); color: #9945ff; border: 1px solid rgba(153,69,255,.3); }
.network-name { font-family: var(--display); font-size: 14px; font-weight: 700; }
.network-key { font-size: 12px; color: var(--muted); margin-top: 3px; }

.section { margin-bottom: 48px; }
.section-title { font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }

.trade-status { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--display); }
.status-pending_payment  { background: rgba(245,197,66,.12); color: var(--yellow); border: 1px solid rgba(245,197,66,.25); }
.status-funded           { background: rgba(255,140,66,.12); color: var(--orange); border: 1px solid rgba(255,140,66,.25); }
.status-pending_delivery { background: rgba(0,212,170,.12); color: var(--accent); border: 1px solid rgba(0,212,170,.25); }
.status-complete         { background: rgba(0,212,170,.12); color: var(--green); border: 1px solid rgba(0,212,170,.25); }
.status-disputed         { background: rgba(255,77,109,.12); color: var(--error); border: 1px solid rgba(255,77,109,.25); }
.status-expired, .status-refunded { background: rgba(74,110,98,.12); color: var(--muted); border: 1px solid rgba(74,110,98,.25); }

.trades-list { display: flex; flex-direction: column; gap: 8px; }
.trade-row { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: border-color .2s, background .2s; text-decoration: none; color: var(--text); }
.trade-row:hover { border-color: rgba(0,212,170,.4); background: var(--surface2); text-decoration: none; }
.trade-desc { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade-amount { font-family: var(--display); font-size: 13px; font-weight: 700; flex-shrink: 0; }
.trade-network { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.form-wrap { max-width: 520px; margin: 0 auto; }
.form-wrap h2 { font-family: var(--display); font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.form-sub { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
input, select, textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; color: var(--text); font-size: 13px; font-family: var(--body); transition: border-color .2s; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #00d4aa; box-shadow: 0 0 0 2px rgba(0,212,170,.12); }
select option { background: var(--surface); }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 28px; }

.trade-detail { max-width: 600px; margin: 0 auto; }
.detail-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-header h2 { font-family: var(--display); font-size: 20px; font-weight: 800; flex: 1; }
.detail-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; font-size: 13px; }
.detail-key { color: var(--muted); min-width: 130px; flex-shrink: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding-top: 2px; }
.detail-val { word-break: break-all; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.deposit-box { background: rgba(0,212,170,.06); border: 1px dashed rgba(0,212,170,.3); border-radius: 12px; padding: 20px; margin: 20px 0; text-align: center; }
.deposit-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.deposit-amount { font-family: var(--display); font-size: 26px; font-weight: 800; margin: 8px 0 4px; background: linear-gradient(135deg, #00a87e, #00d4aa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.deposit-address { font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--yellow); margin: 8px 0; }

.action-area { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.action-area p { font-size: 13px; color: var(--muted); }

.auth-gate { text-align: center; padding: 80px 24px; }
.auth-gate h2 { font-family: var(--display); font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.auth-gate p { color: var(--muted); margin-bottom: 28px; font-size: 14px; }

.loading { color: var(--muted); font-size: 13px; padding: 20px 0; }
.error-msg { color: var(--error); font-size: 12px; margin-top: 8px; padding: 10px 14px; background: rgba(255,77,109,.08); border: 1px solid rgba(255,77,109,.2); border-radius: 8px; }
.success-msg { color: var(--green); font-size: 12px; margin-top: 8px; padding: 10px 14px; background: rgba(0,212,170,.08); border: 1px solid rgba(0,212,170,.2); border-radius: 8px; }
.empty { color: var(--muted); font-size: 13px; padding: 32px; text-align: center; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); }
.copy-btn { background: none; border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-family: var(--mono); }
.copy-btn:hover { color: var(--text); border-color: var(--muted); }

footer { position: relative; z-index: 1; background: rgba(7,13,11,.8); border-top: 1px solid var(--border); text-align: center; padding: 16px; font-size: 12px; color: var(--muted); }
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }

/* ── Animations ───────────────────────────────────────────── */
@keyframes navGradShift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}
.nav-grad-border {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #00ffc4, #00d4aa, #00a87e, #00e5cc, #00ffc4);
  background-size: 300% 100%;
  animation: navGradShift 14s linear infinite;
}

@keyframes fnplGradText {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.fnpl-grad-text {
  background: linear-gradient(135deg, #00ffc4, #00d4aa, #00a87e, #00e5cc);
  background-size: 200% 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: fnplGradText 4s ease infinite;
}
.btn-login-grad {
  background: linear-gradient(135deg, #00d4aa, #00a87e) !important;
  box-shadow: 0 0 14px rgba(0,212,170,0.25);
  transition: filter 0.2s, box-shadow 0.2s !important;
}
.btn-login-grad:hover { filter: brightness(1.15); box-shadow: 0 0 20px rgba(0,212,170,0.4) !important; }

@keyframes cardFloat {
  0%,100% { transform: translateY(0px); }
  50%      { transform: translateY(-8px); }
}
@keyframes cardFloat2 {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes scanLine {
  0%   { top: 52px; opacity: 0; }
  5%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: calc(100% - 48px); opacity: 0; }
}
@keyframes scanLine2 {
  0%   { top: 48px; opacity: 0; }
  5%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: calc(100% - 44px); opacity: 0; }
}

@keyframes pulseBadge {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.5s ease both; }
.fade-in-1 { animation-delay: 0.1s; }
.fade-in-2 { animation-delay: 0.2s; }
.fade-in-3 { animation-delay: 0.35s; }
