/* ══════════════════════════════════════════════════════════════════
   swapctc.css  —  Swap CTC page
   Dark theme, matched to the rest of the Creditcoin site.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --primary: #0b1628;
  --primary-deep: #060d18;
  --violet-soft: #4976FF;
  --teal-deep: #111417;
  --teal-mid: #1a2132;
  --canvas: #0C0E10;
  --canvas-soft: #111417;
  --hairline: #1f2428;
  --hairline-dark: #2a3440;
  --ink: #F0EFEE;
  --ink-mute: #AAACAE;
  --ink-faint: #6e7073;
  --on-primary: #ffffff;
  --on-dark-mute: rgba(255,255,255,0.72);
  --on-dark-faint: rgba(255,255,255,0.5);
  --buidl-blue: #4976FF;
  --buidl-gray: #AAACAE;
  --mono: 'Source Code Pro', 'Courier New', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-variation-settings: "wght" 460;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 32px; }

/* ── Hero ───────────────────────────────────────────────────────── */
.swap-hero {
  padding: 140px 0 96px;
  background: var(--canvas);
  text-align: center;
}
.swap-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--buidl-blue);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.swap-hero h1 {
  font-family: 'Tektur', 'Inter var', sans-serif;
  font-size: clamp(38px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  color: var(--ink);
}
.swap-hero p {
  font-size: 17px;
  color: var(--ink-mute);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  font-variation-settings: "wght" 460;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Tab radio inputs (hidden, CSS-only tab switching) ───────────── */
.tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* ── Unified tab card: wraps tab bar + all panels ───────────────── */
.swap-tab-card {
  border-radius: 16px;
  overflow: hidden;
  background: var(--canvas-soft);
  border: 1px solid rgba(255,255,255,0.18);
  transition: border-color 0.2s;
}
.swap-tab-card:hover { border-color: rgba(255,255,255,0.32); }

/* ── Tab selector bar ───────────────────────────────────────────── */
.swap-tabs {
  display: flex;
}
.swap-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  cursor: pointer;
  background: var(--canvas-soft);
  border-bottom: 2px solid var(--hairline-dark);
  opacity: 0.42;
  transition: opacity 0.18s, background 0.18s, border-color 0.18s;
  user-select: none;
  -webkit-user-select: none;
}
.swap-tab + .swap-tab {
  border-left: 1px solid var(--hairline-dark);
}
.swap-tab:hover {
  opacity: 0.72;
  background: rgba(73,118,255,0.04);
}
.tab-token {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.tab-tok-img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.tab-tok-name {
  font-size: 13px;
  font-variation-settings: "wght" 600;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1;
}
.tab-arr {
  width: 16px;
  height: 8px;
  color: var(--ink-faint);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Active tab state via CSS :has() */
#SwapCTC:has(#tabSwap1:checked) .tab1 {
  opacity: 1;
  background: rgba(73,118,255,0.06);
  border-bottom-color: var(--violet-soft);
}
#SwapCTC:has(#tabSwap2:checked) .tab2 {
  opacity: 1;
  background: rgba(73,118,255,0.06);
  border-bottom-color: var(--violet-soft);
}

/* ── Tab panel show/hide ────────────────────────────────────────── */
.tab-panel { display: none; }

#SwapCTC:has(#tabSwap1:checked) .tab-content1 { display: block; }
#SwapCTC:has(#tabSwap1:checked) .tab-content2 { display: none; }
#SwapCTC:has(#tabSwap2:checked) .tab-content1 { display: none; }
#SwapCTC:has(#tabSwap2:checked) .tab-content2 { display: block; }

/* ── Main section ───────────────────────────────────────────────── */
.swap-section { padding: 0 0 96px; }

/* ── Swap + deposit layout ──────────────────────────────────────── */
.swap-layout {
  display: block;
}

/* ── Swap card (left) ───────────────────────────────────────────── */
.swap-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline-dark);
  border-radius: 0;
  padding: 28px;
  text-align: center;
}
.swap-card-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  text-align: center;
}

/* Token rows */
/* Token row — vertical stack: FROM label → icon → name → subtext */
.token-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.token-side {
  order: -1; /* FROM / TO label sits above the icon */
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.token-icon-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.token-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}
.token-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.token-name {
  display: block;
  font-size: 13px;
  font-variation-settings: "wght" 600;
  color: var(--ink);
  line-height: 1.3;
}
.token-sub {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.4;
}

/* Token pair: always a single horizontal row */
.token-pair {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Arrow — horizontal between columns */
.swap-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--violet-soft);
}
.swap-arrow svg {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
}

/* Destination input */
.field-label {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 20px 0 8px;
}
.dest-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline-dark);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.dest-input::placeholder { color: var(--ink-faint); }
.dest-input:focus { border-color: var(--violet-soft); }

/* Inline note below input */
.note-text {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.6;
  margin-top: 16px;
}
.note-text strong { color: var(--ink); font-variation-settings: "wght" 600; }

/* ── Deposit / QR card ──────────────────────────────────────────── */
.deposit-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 28px;
  text-align: center;
}
.deposit-card h3 {
  font-size: 15px;
  font-variation-settings: "wght" 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 6px;
}
.deposit-sub {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.5;
  margin-bottom: 24px;
}
.qr-wrap {
  margin: 0 auto 24px;
  display: block;
  width: fit-content;
}
.qr-img {
  width: 200px;
  height: 200px;
  display: block;
  border-radius: 14px;
}
.address-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  width: fit-content;
  margin: 0 auto;
}
.address-text {
  font-family: var(--mono);
  font-size: 14px;
  font-variation-settings: "wght" 600;
  color: var(--ink);
  word-break: break-all;
  line-height: 1.5;
}
.copy-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink-mute);
  border: none;
  padding: 4px;
  cursor: pointer;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--ink); }
.copy-btn svg { width: 16px; height: 16px; }
.copy-btn.copied { color: #2ea043; }

/* ── Rate / warning card ────────────────────────────────────────── */
.rate-card {
  margin-top: 24px;
  background: transparent;
  padding: 22px 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.rate-card h4 {
  font-size: 14px;
  font-variation-settings: "wght" 600;
  color: var(--violet-soft);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.4;
}
.rate-card h4 svg { flex-shrink: 0; }
.rate-row {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
  font-variation-settings: "wght" 500;
}
.rate-card p {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.6;
  max-width: 560px;
}

/* ── Information section ────────────────────────────────────────── */
.info-section { padding: 0 0 96px; }
.info-card {
  background: transparent;
  border: none;
  padding: 0;
}
.info-card h2 {
  font-family: 'Tektur', 'Inter var', sans-serif;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}
.info-list,
.info-sublist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.info-sublist {
  margin: 6px 0 0 16px;
  padding-left: 0;
}
.info-list li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  color: var(--ink-mute);
  line-height: 1.6;
}
.info-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet-soft);
}
.info-list strong { color: var(--ink); font-variation-settings: "wght" 600; }
.info-list a { color: var(--violet-soft); text-decoration: none; }
.info-list a:hover { text-decoration: underline; }
.info-contact {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline-dark);
  font-size: 14px;
  color: var(--ink-mute);
}
.info-contact a { color: var(--violet-soft); text-decoration: none; }
.info-contact a:hover { text-decoration: underline; }

/* ── Footer (shared look) ───────────────────────────────────────── */
footer {
  background: var(--canvas-soft);
  border-top: 1px solid var(--hairline-dark);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand-logo svg path { fill: var(--ink-faint); }
.footer-logo-mark { display: none; }
.footer-col h4 {
  font-size: 12px;
  font-variation-settings: "wght" 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 14px;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--ink); }
.footer-link-active { color: #ffffff !important; }
.footer-sub-item { padding-left: 10px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom-left { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.footer-copy { font-size: 13px; color: var(--ink-faint); }
.footer-email { font-size: 13px; color: var(--ink-mute); text-decoration: none; }
.footer-email:hover { color: var(--ink); }
.footer-socials { display: flex; gap: 16px; }
.footer-social { color: var(--ink-mute); transition: color 0.2s; display: flex; }
.footer-social:hover { color: var(--ink); }
.footer-social svg { width: 18px; height: 18px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .swap-layout { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { display: none; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .swap-hero { padding: 110px 0 48px; }
  .swap-card,
  .deposit-card,
  .info-card { padding: 22px; }
  .tab-label { font-size: 12px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .tab-label { display: none; }

  /* Vertical button stack */
  .swap-tabs {
    flex-direction: column;
    border-bottom: none;
    padding: 10px;
    gap: 8px;
  }
  .swap-tab {
    padding: 13px 16px;
    border-radius: 10px;
    border: 1px solid var(--hairline-dark);
    border-bottom: 1px solid var(--hairline-dark);
    background: transparent;
    opacity: 0.56;
    justify-content: center;
  }
  .swap-tab + .swap-tab {
    border-left: 1px solid var(--hairline-dark);
  }
  /* Active button state */
  #SwapCTC:has(#tabSwap1:checked) .tab1,
  #SwapCTC:has(#tabSwap2:checked) .tab2 {
    opacity: 1;
    background: rgba(73,118,255,0.10);
    border-color: var(--violet-soft);
    border-bottom-color: var(--violet-soft);
  }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .info-card { padding: 22px 20px; }
}
