/* ============================================
   Change — Dark Premium Exchange Monitor
   ============================================ */

/* --- Variables --- */
:root {
  --bg: #080c14;
  --bg-2: #0d1117;
  --bg-3: #161b22;
  --card: #0d1117;
  --card-hover: #161b22;
  --card-border: rgba(255,255,255,0.06);
  --glass: rgba(13,17,23,0.8);
  --accent: #00d4aa;
  --accent-2: #00f0c0;
  --accent-glow: rgba(0,212,170,0.15);
  --accent-glow-strong: rgba(0,212,170,0.3);
  --red: #ff4757;
  --orange: #ffa502;
  --blue: #3b82f6;
  --text: #e6edf3;
  --text-2: #b8c0cc;
  --text-3: #9099a5;
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.04);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --transition: 0.2s ease;
  --max-w: 1280px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* --- Utilities --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.sr-only:focus,
a.sr-only:focus-visible,
a.sr-only:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  margin: 0;
  clip: auto;
  overflow: visible;
  white-space: normal;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  border-radius: var(--radius-xs);
  z-index: 2000;
  text-decoration: none;
  box-shadow: var(--shadow);
}

/* --- Focus rings --- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #000;
  font-weight: 800;
}

.nav { display: flex; align-items: center; gap: 8px; }

.nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.nav a:hover, .nav a.active {
  color: var(--text);
  background: var(--accent-glow);
}

.nav a.nav-cta {
  color: #000;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  margin-left: 4px;
}

.nav a.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow-strong);
  color: #000;
}

.nav a.nav-cta.active {
  color: #000;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  background: var(--bg-3);
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border);
}

.lang-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.lang-btn.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* --- Hero Section --- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%);
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-2);
  max-width: 500px;
  margin: 0 auto 40px;
}

/* --- Exchange Selector --- */
.exchange-selector {
  max-width: 700px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 12px;
  align-items: end;
  box-shadow: var(--shadow);
}

.selector-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selector-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
}

.selector-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  background-color: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300d4aa'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.selector-select option {
  background: var(--bg-2);
  color: var(--text);
}

.selector-select optgroup {
  background: var(--bg);
  color: var(--text-2);
  font-weight: 700;
}

.selector-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.selector-swap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.selector-swap:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.btn-primary {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow-strong);
}

/* --- Stats Strip --- */
.stats-strip {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border-light);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* --- Section --- */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

/* --- Popular Pairs Grid --- */
.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.pair-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.pair-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pair-arrow {
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
}

.pair-codes {
  font-weight: 600;
  font-size: 14px;
}

.pair-count {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}

/* --- Rate Table --- */
.rate-table-wrap {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.rate-table {
  width: 100%;
  border-collapse: collapse;
}

.rate-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.rate-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.rate-table tr:hover td {
  background: rgba(0,212,170,0.04);
}

.rate-table tr:last-child td {
  border-bottom: none;
}

.rate-table .exchanger-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trusted-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.licensed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59,130,246,0.15);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(59,130,246,0.35);
  cursor: help;
}

.licensed-badge::before {
  content: '🛡';
  font-size: 9px;
  filter: saturate(0);
}

.rate-value {
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.rate-best {
  color: var(--accent);
}

.btn-go {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-go:hover {
  background: var(--accent);
  color: #000;
}

/* --- How It Works --- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.how-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.how-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.how-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--accent-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.how-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.how-card p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 40px;
}

.footer-col { flex: 1; }

.footer-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.footer-text {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

.footer-links a {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  padding: 4px 0;
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 24px auto 0;
  padding: 16px 24px 0;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

/* --- Loading & Empty States --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-3);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero { padding: 48px 0 40px; }
  .exchange-selector { flex-direction: column; }
  .exchange-selector .btn-primary { width: 100%; text-align: center; }
  .selector-group { width: 100%; }
  .selector-swap { align-self: center; }
  .stats-strip { gap: 24px; flex-wrap: wrap; }
  .how-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .header-inner { padding: 0 16px; }
  .container { padding: 0 16px; }
  .nav a { padding: 8px 10px; font-size: 13px; }
  .pairs-grid { grid-template-columns: repeat(2, 1fr); }
  .rate-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rate-table { min-width: 540px; }
  .pair-header h1 { font-size: 22px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .stat-value { font-size: 22px; }
  .nav { gap: 4px; }
  .nav a { padding: 6px 8px; font-size: 12px; }
  .pairs-grid { grid-template-columns: 1fr; }
  .rate-table { min-width: 480px; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* --- Page transitions --- */
#app {
  min-height: calc(100vh - 64px - 140px);
}

/* --- Exchanger Page --- */
.exchanger-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.exchanger-profile h2 {
  font-size: 24px;
  font-weight: 700;
}

.exchanger-profile .trusted-badge {
  font-size: 12px;
  padding: 4px 12px;
}

/* --- Subscription Page --- */
.subscription-page {
  max-width: 960px;
  margin: 0 auto;
}

.pricing-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}

.pricing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.pricing-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.pricing-amount {
  font-size: 56px;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
}

.pricing-currency {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-2);
}

.pricing-period {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 28px;
}

.pricing-features {
  text-align: left;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.pricing-features li {
  padding: 10px 0 10px 32px;
  font-size: 14px;
  color: var(--text-2);
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 4px;
  top: 10px;
  width: 20px;
  height: 20px;
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  background: var(--accent-glow);
  border-radius: 50%;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.subscribe-form input[type="text"],
.subscribe-form input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.subscribe-form input[type="text"]:focus,
.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.subscribe-error {
  padding: 10px 14px;
  background: rgba(255,71,87,0.1);
  border: 1px solid rgba(255,71,87,0.3);
  border-radius: var(--radius-xs);
  color: var(--red);
  font-size: 13px;
}

.subscribe-submit {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
}

.subscribe-submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

.subscribe-note {
  text-align: center;
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .pricing-card { padding: 28px 20px; }
  .pricing-amount { font-size: 44px; }
}

/* --- FAQ Page --- */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.faq-item:hover,
.faq-item[open] {
  border-color: var(--accent);
}

.faq-item summary {
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color var(--transition);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item summary:hover {
  color: var(--accent);
}

.faq-answer {
  padding: 0 24px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
}

/* --- Pair Page Header --- */
.pair-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.pair-header h1 {
  font-size: 28px;
  font-weight: 700;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 8px;
  margin-bottom: 16px;
}

.back-link:hover { color: var(--accent); }
