/* PipAlgo Exchange — light theme, PipAlgo blue accent */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --pa-blue: #1a56db;
  --pa-blue-dark: #1543ab;
  --pa-blue-light: #e8f0fe;
  --pa-green: #0e9f6e;
  --pa-red: #e02424;
  --pa-amber: #c27803;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 8px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: var(--pa-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--card);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--pa-blue), var(--pa-blue-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px;
}
.nav { display: flex; gap: 18px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.nav a { color: var(--ink-soft); }
.nav a.active, .nav a:hover { color: var(--pa-blue); text-decoration: none; }

footer {
  margin-top: 48px; padding: 28px 20px 40px; text-align: center;
  color: var(--ink-soft); font-size: 13px; border-top: 1px solid var(--line);
}

/* ---------- rate ticker ---------- */
.ticker {
  display: flex; gap: 0; overflow-x: auto; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.ticker-item {
  flex: 1 0 auto; padding: 10px 18px; border-right: 1px solid var(--line);
  font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.ticker-sym { font-weight: 700; color: var(--ink); }
.ticker-price { font-family: 'JetBrains Mono', monospace; color: var(--pa-blue); font-weight: 600; }

/* ---------- hero ---------- */
.hero { padding: 40px 0 8px; text-align: center; }
.hero h1 { font-size: 28px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero p { color: var(--ink-soft); font-size: 15px; margin: 0 auto; max-width: 520px; }

/* ---------- mode switch (Buy / Sell) ---------- */
.switch {
  display: flex; background: #eef2f7; border-radius: 10px; padding: 4px;
  margin: 24px 0 20px; max-width: 320px; margin-left: auto; margin-right: auto;
}
.switch a {
  flex: 1; text-align: center; padding: 10px 0; border-radius: 8px;
  font-weight: 700; font-size: 14px; color: var(--ink-soft);
}
.switch a.active { background: var(--card); color: var(--pa-blue); box-shadow: var(--shadow); text-decoration: none; }

/* ---------- card / form ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card h2 { font-size: 16px; margin: 0 0 16px; font-weight: 700; }
.card h3 { font-size: 14px; margin: 20px 0 10px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: #94a3b8; margin-top: 5px; }

input[type=text], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--pa-blue); box-shadow: 0 0 0 3px var(--pa-blue-light);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--pa-blue); color: #fff; border: none; border-radius: 8px;
  padding: 13px 20px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--pa-blue-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: #eef2f7; color: var(--ink); }
.btn.secondary:hover { background: #e2e8f0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.summary-box {
  background: var(--pa-blue-light); border: 1px solid #c7dbfb; border-radius: 8px;
  padding: 16px; margin: 16px 0;
}
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.summary-row .label { color: var(--ink-soft); }
.summary-row .value { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.summary-row.total { border-top: 1px dashed #a9c6f5; margin-top: 8px; padding-top: 10px; font-size: 16px; }

/* ---------- payment instructions box ---------- */
.pay-box {
  background: #fff8ec; border: 1px solid #fbe4b4; border-radius: 8px; padding: 18px; margin: 18px 0;
}
.pay-box .amount { font-size: 26px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--ink); }
.copy-field {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 12px; margin-top: 8px;
}
.copy-field span { font-family: 'JetBrains Mono', monospace; font-size: 13px; word-break: break-all; flex: 1; }
.copy-btn {
  border: none; background: var(--pa-blue-light); color: var(--pa-blue); font-weight: 700;
  font-size: 12px; padding: 6px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap;
}

/* ---------- badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.awaiting_payment, .badge.payment_submitted { background: #fff8ec; color: var(--pa-amber); }
.badge.awaiting_payment .badge-dot, .badge.payment_submitted .badge-dot { background: var(--pa-amber); }
.badge.payment_confirmed, .badge.processing { background: var(--pa-blue-light); color: var(--pa-blue); }
.badge.payment_confirmed .badge-dot, .badge.processing .badge-dot { background: var(--pa-blue); }
.badge.completed { background: #edfcf3; color: var(--pa-green); }
.badge.completed .badge-dot { background: var(--pa-green); }
.badge.cancelled, .badge.expired { background: #fef2f2; color: var(--pa-red); }
.badge.cancelled .badge-dot, .badge.expired .badge-dot { background: var(--pa-red); }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 16px 0 0; padding: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; padding: 0 0 18px 22px; font-size: 14px; }
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--pa-blue); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--pa-blue);
}
.timeline li .t-time { color: #94a3b8; font-size: 12px; display: block; margin-top: 2px; }

/* ---------- alerts ---------- */
.alert { border-radius: 8px; padding: 13px 16px; font-size: 14px; margin-bottom: 16px; }
.alert.info { background: var(--pa-blue-light); color: var(--pa-blue-dark); }
.alert.success { background: #edfcf3; color: #036640; }
.alert.error { background: #fef2f2; color: #9b1c1c; }
.alert.warn { background: #fff8ec; color: #92400e; }

/* ---------- misc ---------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  counter-increment: step; position: relative; padding: 0 0 22px 40px; font-size: 14px; color: var(--ink-soft);
}
.steps li strong { color: var(--ink); display: block; margin-bottom: 3px; font-size: 14.5px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--pa-blue-light); color: var(--pa-blue); font-weight: 700;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
}

table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.admin-table th { color: var(--ink-soft); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; background: #f8fafc; }
table.admin-table tr:hover td { background: #fafbfc; }

.small-note { font-size: 12px; color: #94a3b8; }

@media (max-width: 480px) {
  .row2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 23px; }
}
