/* design.css — main exchange page, Tether Gold XAUt style */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@300;400;500&display=swap');

body { padding: 0 0 80px; }
.page-wrap { position: relative; z-index: 1; }

/* ===========================
   HERO
=========================== */
.hero {
  text-align: center;
  padding: 48px 24px 20px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--c-gold);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 5px 16px;
  background: var(--c-gold-dim);
  border: 1px solid var(--c-border2);
  border-radius: 2px;
}
.hero-tag::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-gold);
  box-shadow: 0 0 8px var(--c-gold);
  animation: blink 3s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin-bottom: 14px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.hero h1 em { font-style: italic; color: var(--c-gold3); }

.hero-sub {
  font-size: 15px;
  color: var(--c-muted);
  max-width: 420px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

/* thin gold rule under hero text */
.hero-sub::after {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  margin: 22px auto 0;
}

.hero-stats {
  display: inline-flex;
  border: 1px solid var(--c-border2);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-surface);
}
.stat {
  padding: 11px 24px;
  text-align: center;
  border-right: 1px solid var(--c-border2);
}
.stat:last-child { border-right: none; }
.stat-value {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--c-text);
  letter-spacing: 0.01em;
}
.stat-label {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

/* ===========================
   SWAP WIDGET
=========================== */
.swap-section {
  padding: 24px 16px 0;
  display: flex;
  justify-content: center;
}

.swap-card {
  width: 100%;
  max-width: 480px;
  background: var(--c-surface);
  border: 1px solid var(--c-border2);
  border-radius: var(--r-xl);
  overflow: visible;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  /* subtle gold top edge */
  position: relative;
}
.swap-card::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-gold-glow), transparent);
  border-radius: 1px;
}

/* card header */
.swap-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 0;
}
.swap-card-title {
  font-family: var(--f-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.swap-card-rate {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--c-gold);
  display: flex;
  align-items: center;
  gap: 5px;
}
.swap-card-rate::before {
  content: '●';
  font-size: 6px;
  animation: blink 3s infinite;
}

/* field blocks */
.swap-field {
  margin: 10px 14px 0;
  background: var(--c-bg2);
  border: 1px solid var(--c-border2);
  border-radius: var(--r-lg);
  padding: 13px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.swap-field:focus-within {
  border-color: rgba(201,168,76,0.45);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.07);
}

.swap-field-label {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--c-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 10px;
}
.swap-field-row { display: flex; align-items: center; gap: 12px; }

.swap-amount {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--f-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--c-text);
  caret-color: var(--c-gold);
  min-width: 0;
  letter-spacing: 0.01em;
}
.swap-amount::placeholder { color: var(--c-muted); opacity: 0.45; }
.swap-amount.error { color: var(--c-red); }

.receive-display {
  flex: 1;
  font-family: var(--f-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--c-gold3);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

/* token selector */
.token-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border2);
  border-radius: var(--r-md);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition);
}
.token-selector:hover {
  border-color: rgba(201,168,76,0.40);
  background: var(--c-surface3);
}
.token-selector img { width: 20px; height: 20px; border-radius: 50%; }
.token-selector-name { font-size: 14px; font-weight: 600; color: var(--c-text); }
.token-selector-arrow { font-size: 9px; color: var(--c-muted); transition: transform 0.2s; }
.custom-select.active .token-selector-arrow { transform: rotate(180deg); }

.swap-field-hint {
  margin-top: 7px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--c-muted);
  min-height: 14px;
}

/* swap direction button */
.swap-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
  z-index: 5;
  position: relative;
}
.swap-direction-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--c-surface2);
  border: 1px solid var(--c-border2);
  color: var(--c-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
}
.swap-direction-btn:hover {
  border-color: var(--c-gold);
  color: var(--c-gold);
  transform: rotate(180deg);
  box-shadow: 0 0 16px rgba(201,168,76,0.18);
}

/* wallet block */
.wallet-block {
  margin: 8px 14px 0;
  background: var(--c-bg2);
  border: 1px solid var(--c-border2);
  border-radius: var(--r-lg);
  padding: 13px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.wallet-block:focus-within {
  border-color: rgba(201,168,76,0.45);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.07);
}
.wallet-block-label {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wallet-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--c-text);
  caret-color: var(--c-gold);
  letter-spacing: 0.03em;
}
.wallet-input::placeholder { color: var(--c-muted); opacity: 0.5; }
.wallet-input.error { color: var(--c-red); }
.wallet-error { font-family: var(--f-mono); font-size: 11px; color: var(--c-red); margin-top: 8px; display: none; }
.wallet-validation-status { font-size: 11px; font-family: var(--f-mono); }
.wallet-validation-status.valid  { color: var(--c-gold); }
.wallet-validation-status.invalid{ color: var(--c-red); }
.amount-error { font-family: var(--f-mono); font-size: 11px; color: var(--c-red); margin-top: 6px; }

/* submit */
.swap-submit-wrap { padding: 12px 14px; }
.swap-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--c-gold) 0%, var(--c-gold2) 100%);
  color: #0a0807;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 20px rgba(201,168,76,0.20);
}
.swap-submit:hover {
  background: linear-gradient(135deg, var(--c-gold3) 0%, var(--c-gold) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 32px rgba(201,168,76,0.32);
}

/* disclaimer */
.swap-disclaimer {
  padding: 0 14px 16px;
  font-size: 11px;
  color: var(--c-muted);
  text-align: center;
  line-height: 1.55;
}
.swap-disclaimer a { color: var(--c-muted); text-decoration: underline; }
.swap-disclaimer a:hover { color: var(--c-gold); }

/* ===========================
   DROPDOWN
=========================== */
.custom-select { position: relative; }
.options-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: none;
}
.options-dropdown::-webkit-scrollbar { width: 3px; }
.options-dropdown::-webkit-scrollbar-thumb { background: var(--c-border3); border-radius: 2px; }

.dropdown-search {
  position: sticky; top: 0;
  width: 100%; height: 42px;
  padding: 0 14px;
  background: var(--c-surface);
  border: none;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: 13px;
  outline: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.dropdown-search::placeholder { color: var(--c-muted); }

.opt-group {
  padding: 8px 14px 4px;
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--c-gold);
  text-transform: uppercase;
  position: sticky; top: 42px;
  background: var(--c-surface); z-index: 1;
}
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  transition: background 0.12s;
}
.option:hover { background: var(--c-surface2); }
.option.selected { background: var(--c-gold-dim); color: var(--c-gold3); }
.option img { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ===========================
   FEATURES ROW
=========================== */
.features-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.feat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--c-muted);
  letter-spacing: 0.02em;
}
.feat-item::before {
  content: '—';
  color: var(--c-gold);
  font-size: 10px;
  opacity: 0.7;
}

/* ===========================
   HOW IT WORKS
=========================== */
.how-section {
  max-width: 1000px;
  margin: 80px auto 0;
  padding: 0 24px;
}
.section-label {
  font-family: var(--f-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.20em;
  color: var(--c-gold);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--f-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--c-text);
  margin-bottom: 40px;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.step-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.step-card:hover {
  border-color: var(--c-border2);
  box-shadow: 0 4px 24px rgba(201,168,76,0.07);
}
.step-num {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--c-gold);
  letter-spacing: 0.18em;
  margin-bottom: 16px;
  text-transform: uppercase;
}
.step-card h2, .step-card h3 {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--c-text);
  letter-spacing: 0.01em;
}
.step-card p { font-size: 13px; color: var(--c-muted); line-height: 1.7; }

/* ===========================
   SEO SECTION
=========================== */
.seo-section {
  max-width: 820px;
  margin: 64px auto 0;
  padding: 0 24px;
}
.seo-section h2 {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--c-text);
  margin: 36px 0 10px;
  letter-spacing: 0.01em;
}
.seo-section h2:first-child { margin-top: 0; }
.seo-section p { font-size: 13px; color: var(--c-muted); line-height: 1.85; margin-bottom: 12px; }
.seo-section ul, .seo-section ol { margin: 8px 0 12px 20px; }
.seo-section li { font-size: 13px; color: var(--c-muted); line-height: 1.75; margin-bottom: 5px; }
.seo-section strong { color: var(--c-mid); font-weight: 600; }
.seo-section table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.seo-section td {
  padding: 8px 12px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--c-muted);
  border: 1px solid var(--c-border);
}

/* ===========================
   INFO BLOCK
=========================== */
.info-block { max-width: 820px; margin: 20px auto 0; padding: 0 24px; }
.info-block .label {
  font-family: var(--f-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--c-muted);
  margin-bottom: 5px;
}
.info-block .value { font-size: 13px; color: var(--c-mid); }
.info-block a { color: var(--c-gold); }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 680px) {
  .hero { padding: 40px 16px 28px; }
  .hero-stats { flex-direction: column; border-radius: var(--r-md); }
  .stat { border-right: none; border-bottom: 1px solid var(--c-border2); }
  .stat:last-child { border-bottom: none; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .swap-amount, .receive-display { font-size: 24px; }
}
@media (max-width: 420px) {
  .steps-grid { grid-template-columns: 1fr; }
  .swap-amount, .receive-display { font-size: 22px; }
  .token-selector-name { display: none; }
}

/* refund block */
.refund-block {
  border-style: dashed;
  border-color: var(--c-border);
}
.refund-block:focus-within {
  border-color: rgba(201,168,76,0.40);
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.06);
}
.refund-optional {
  font-family: var(--f-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-muted);
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  padding: 2px 7px;
  border-radius: 2px;
  margin-left: 4px;
}
.refund-hint {
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--c-muted);
  line-height: 1.55;
}
