:root {
  --bg: #070b14;
  --bg-elevated: #0e1524;
  --bg-card: rgba(16, 24, 40, 0.92);
  --border: rgba(148, 163, 184, 0.14);
  --text: #e8eef9;
  --muted: #8b9bb8;
  --accent: #22d3a6;
  --accent-2: #38bdf8;
  --danger: #f87171;
  --warning: #fbbf24;
  --ok: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

img {
  display: block;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-glow {
  position: fixed;
  inset: -20% auto auto 40%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(34, 211, 166, 0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.header,
main,
footer {
  position: relative;
  z-index: 1;
}

.header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018;
  font-weight: 800;
}

.accent {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.7rem 1.05rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #1fd6a4, #2bb7f5);
  color: #041018;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--muted);
}

.btn-xl {
  width: 100%;
  padding: 1rem 1.2rem;
  font-size: 1.05rem;
  border-radius: 14px;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3.5rem 0 2rem;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(34, 211, 166, 0.12);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.lead {
  margin: 1.1rem 0 1.6rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36rem;
}

.hero-stats {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stats strong {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.85rem;
}

.exchange-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.rate-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: rgba(34, 211, 166, 0.1);
  border: 1px solid rgba(34, 211, 166, 0.22);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.rate-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 166, 0.15);
  flex-shrink: 0;
}

.rate-source {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.field-block {
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.field-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.amount-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.amount-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.amount-row input::-webkit-outer-spin-button,
.amount-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-row input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.asset-select {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 0.45rem 0.7rem 0.45rem 0.45rem;
  cursor: pointer;
  font-weight: 700;
}

.asset-select img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.chevron {
  color: var(--muted);
  font-size: 0.8rem;
}

.swap-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: -0.55rem auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #121a2b;
  color: var(--accent);
  cursor: pointer;
  position: relative;
  z-index: 2;
  font-size: 1.1rem;
}

.swap-btn:hover {
  border-color: rgba(34, 211, 166, 0.5);
  background: rgba(34, 211, 166, 0.12);
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}

.address-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.address-field input {
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.72);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  outline: none;
}

.address-field input:focus {
  border-color: rgba(34, 211, 166, 0.55);
}

.disclaimer {
  margin: 0.75rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.section {
  padding: 2.5rem 0 1rem;
}

.section-head {
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.rates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.rate-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.rate-card:hover {
  border-color: rgba(34, 211, 166, 0.4);
  transform: translateY(-2px);
}

.rate-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.rate-card-top img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.pair-name {
  font-weight: 700;
}

.pair-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.rate-price {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rate-change {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.rate-change.up {
  color: var(--ok);
}

.rate-change.down {
  color: var(--danger);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.step {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(34, 211, 166, 0.14);
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.step h3 {
  margin: 0 0 0.45rem;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.orders-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.orders-table th,
.orders-table td {
  padding: 0.95rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.orders-table th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.orders-table tr:last-child td {
  border-bottom: 0;
}

.empty-row td {
  text-align: center !important;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status.pending {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
}

.status.done {
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
}

.faq-list {
  display: grid;
  gap: 0.7rem;
}

.faq-list details {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
}

.faq-list p {
  margin: 0.7rem 0 0;
  color: var(--muted);
}

.footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(420px, 100%);
  background: #101827;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.modal-head h3 {
  margin: 0;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.search {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.7);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  outline: none;
  margin-bottom: 0.75rem;
}

.asset-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}

.asset-group {
  padding: 0.65rem 0.45rem 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.asset-list li button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.45rem;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}

.asset-list li button:hover {
  background: rgba(255, 255, 255, 0.04);
}

.asset-list img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.asset-meta {
  display: flex;
  flex-direction: column;
}

.asset-meta strong {
  font-size: 0.95rem;
}

.asset-meta span {
  color: var(--muted);
  font-size: 0.8rem;
}

.order-modal {
  text-align: center;
}

.success-badge {
  width: 56px;
  height: 56px;
  margin: 0.25rem auto 0.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(52, 211, 153, 0.16);
  color: var(--ok);
  font-size: 1.5rem;
  font-weight: 800;
}

.deposit-box {
  margin: 1rem 0 1.2rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  text-align: left;
}

.deposit-box code {
  display: block;
  margin: 0.45rem 0 0.7rem;
  word-break: break-all;
  font-size: 0.85rem;
  color: var(--accent-2);
}

.order-timer {
  margin: 0.35rem 0 0.8rem;
  color: var(--warning);
  font-weight: 600;
  font-size: 0.95rem;
}

.order-status-line {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.fiat-methods {
  margin: 0 0 1rem;
}

.fiat-methods-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.fiat-method-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}

.fiat-method-btn.active {
  border-color: rgba(34, 211, 166, 0.55);
  background: rgba(34, 211, 166, 0.14);
  color: var(--accent);
}

.fiat-extra {
  margin: 0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: left;
  line-height: 1.45;
}

.auth-user {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-hint {
  margin: 0 0 0.75rem;
  color: var(--warning);
  font-size: 0.85rem;
  text-align: center;
}

.auth-hint[hidden] {
  display: none;
}

.auth-modal .address-field {
  margin-bottom: 0.75rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: rgba(7, 11, 20, 0.85);
  border: 1px solid var(--border);
}

.auth-tabs .tab {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 0.55rem 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-tabs .tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.auth-tabs .tab.active {
  background: rgba(34, 211, 166, 0.16);
  color: var(--accent);
}

.auth-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin: 0 0 0.75rem;
}

.receipt-box {
  margin: 1rem 0;
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.28);
  text-align: left;
}

.receipt-box input[type="file"] {
  width: 100%;
  margin: 0.45rem 0 0.55rem;
  color: var(--muted);
}

.receipt-file-name {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 920px) {
  .auth-user {
    display: none;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: #152238;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  z-index: 60;
  box-shadow: var(--shadow);
}

.toast[hidden] {
  display: none;
}

@media (max-width: 920px) {
  .nav {
    display: none;
  }

  .hero,
  .rates-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .header-actions .btn-ghost {
    display: none;
  }

  .meta-row {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
  }
}
