/* USDTOY Design System — Fintech Currency Platform */

:root {
  --primary: #FFD900;
  --primary-hover: #FFA800;
  --primary-dark: #E6C300;
  --bg-dark: #121316;
  --bg-dark-secondary: #1A1D20;
  --bg-light: #FFFFFF;
  --bg-muted: #F8F9FA;
  --text-primary: #1E2229;
  --text-secondary: #6C757D;
  --text-muted: #8C96A3;
  --text-light: #FFFFFF;
  --text-light-muted: #A0A8B3;
  --border: #E5E7EB;
  --border-dark: #2A2D32;
  --positive: #10B981;
  --negative: #EF4444;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --font: 'Inter', 'Roboto', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --container: 1200px;
  --header-h: 64px;
  --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-hover); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.375rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

.section-title {
  margin-bottom: 1.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
}

.tabular { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--text-primary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255,255,255,.25);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  min-height: 36px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dark);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo span { color: var(--primary); }

.nav-desktop {
  display: none;
  gap: 28px;
}

.nav-desktop a {
  color: var(--text-light-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.header-actions .btn-primary { display: none; }

.select-compact {
  appearance: none;
  background: var(--bg-dark-secondary);
  color: var(--text-light);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 8px 28px 8px 12px;
  font-size: 0.8125rem;
  font-family: var(--font);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A0A8B3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-height: 36px;
}

.select-compact:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-light);
  transition: transform var(--transition);
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--bg-dark);
  padding: 24px 20px;
  flex-direction: column;
  gap: 4px;
  z-index: 999;
  overflow-y: auto;
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  color: var(--text-light);
  padding: 14px 0;
  font-size: 1.05rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-dark);
}

.nav-mobile .btn-primary {
  display: inline-flex;
  margin-top: 16px;
  width: 100%;
}

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .menu-toggle { display: none; }
  .header-actions .btn-primary { display: inline-flex; }
}

/* Hero */
.hero {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 48px 0 64px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: start;
}

.hero-content h1 {
  color: var(--text-light);
  margin-bottom: 16px;
}

.hero-content p {
  color: var(--text-light-muted);
  font-size: 1.125rem;
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (min-width: 900px) {
  .hero { padding: 64px 0 80px; }
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
  }
}

/* Converter Widget */
.converter-widget {
  background: var(--bg-dark-secondary);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 24px;
}

.converter-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.converter-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light-muted);
  margin-bottom: 6px;
}

.converter-input-group {
  display: flex;
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.converter-input-group:focus-within {
  border-color: var(--primary);
}

.converter-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1.375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 14px 16px;
  font-family: var(--font);
  min-width: 0;
}

.converter-input-group input:focus { outline: none; }

.converter-input-group select {
  background: var(--bg-dark-secondary);
  border: none;
  border-left: 1px solid var(--border-dark);
  color: var(--text-light);
  font-weight: 600;
  padding: 0 12px;
  font-family: var(--font);
  cursor: pointer;
  min-width: 80px;
}

.converter-swap {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.btn-swap {
  background: var(--bg-dark);
  border: 1px solid var(--border-dark);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  font-size: 1.25rem;
  transition: background var(--transition), transform var(--transition);
}

.btn-swap:hover {
  background: var(--bg-dark-secondary);
  transform: rotate(180deg);
}

.converter-results {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dark);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  gap: 12px;
}

.result-label {
  font-size: 0.8125rem;
  color: var(--text-light-muted);
}

.result-value {
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-light);
}

.result-value.highlight {
  color: var(--primary);
  font-size: 1.375rem;
}

.result-value.rate-positive { color: var(--positive); }
.result-value.rate-negative { color: var(--negative); }

.converter-meta {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--text-light-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.converter-meta .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--positive);
}

.converter-meta.stale .dot { background: var(--negative); }

.converter-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Sections */
.section {
  padding: 56px 0;
}

.section-muted {
  background: var(--bg-muted);
}

.section-dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.section-dark h2 { color: var(--text-light); }

/* Cards */
.card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-highlight {
  border-color: var(--primary);
  background: linear-gradient(to bottom, rgba(255,217,0,.06), transparent);
}

/* Rate highlight banner */
.rate-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  padding: 28px 32px;
  background: var(--bg-dark);
  border-radius: var(--radius);
  color: var(--text-light);
}

.rate-banner-main {
  flex: 1;
  min-width: 200px;
}

.rate-banner-label {
  font-size: 0.8125rem;
  color: var(--text-light-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.rate-banner-value {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.rate-banner-change {
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rate-banner-meta {
  font-size: 0.8125rem;
  color: var(--text-light-muted);
}

/* Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.rate-table th,
.rate-table td {
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.rate-table th:first-child,
.rate-table td:first-child {
  text-align: left;
}

.rate-table th {
  background: var(--bg-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.rate-table tbody tr:hover {
  background: rgba(255,217,0,.04);
}

.rate-table tr.row-highlight {
  background: rgba(255,217,0,.08);
  font-weight: 600;
}

.rate-table tr.row-highlight td:first-child {
  color: var(--text-primary);
}

.bank-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bank-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* Bank cards grid */
.bank-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .bank-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .bank-grid { grid-template-columns: repeat(3, 1fr); }
}

.bank-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.bank-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bank-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.bank-card-name {
  font-weight: 700;
  font-size: 1rem;
}

.bank-card-rates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.bank-card-rate-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bank-card-rate-value {
  font-weight: 700;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.bank-card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Chart */
.chart-container {
  position: relative;
  height: 320px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.chart-controls {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.chart-btn {
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-light);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  min-height: 32px;
}

.chart-btn.active,
.chart-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-primary);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 12px;
  font-size: 0.8125rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Countries grid */
.countries-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.country-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.country-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.country-flag { font-size: 2rem; }
.country-name { font-weight: 600; font-size: 0.9375rem; }
.country-currency { font-size: 0.8125rem; color: var(--text-secondary); }

/* Comparison bar */
.compare-bar {
  display: grid;
  gap: 20px;
}

.compare-item {
  display: grid;
  gap: 8px;
}

.compare-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
}

.compare-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.compare-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 600ms ease;
}

.compare-fill.usdtoy { background: var(--primary); }
.compare-fill.mid { background: var(--text-muted); }

/* FAQ */
.faq-list { display: grid; gap: 12px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-light);
  border: none;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  min-height: 44px;
}

.faq-question:hover { background: var(--bg-muted); }

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .faq-question::after { content: '−'; }

.faq-answer {
  display: none;
  padding: 0 20px 16px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer { display: block; }

/* Methodology steps */
.steps {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.step {
  padding: 24px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-num {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  margin-bottom: 12px;
}

/* Trust badges */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 24px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-light-muted);
}

.trust-badge svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.breadcrumb a:hover { color: var(--primary-hover); }
.breadcrumb span { color: var(--text-muted); }

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

.amount-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: border-color var(--transition);
}

.amount-card:hover { border-color: var(--primary); }

.amount-usd {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 4px;
}

.amount-local {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-light-muted);
  padding: 56px 0 32px;
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 40px;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer-col h4 {
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li { margin-bottom: 10px; }

.footer-col a {
  color: var(--text-light-muted);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
}

.footer-disclaimer {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-dark-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-light-muted);
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f0f0f0 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Alert */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.alert-warning {
  background: rgba(255,168,0,.12);
  border: 1px solid rgba(255,168,0,.3);
  color: #92600A;
}

.alert-error {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  color: #991B1B;
}

/* CTA section */
.cta-section {
  text-align: center;
  padding: 64px 20px;
  background: var(--bg-dark);
  color: var(--text-light);
}

.cta-section h2 { color: var(--text-light); margin-bottom: 12px; }
.cta-section p { color: var(--text-light-muted); margin-bottom: 24px; }

/* Page header (inner pages) */
.page-header {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 40px 0 48px;
}

.page-header h1 { color: var(--text-light); }
.page-header p { color: var(--text-light-muted); margin: 0; }

/* Two column layout */
.two-col {
  display: grid;
  gap: 32px;
}

@media (min-width: 768px) {
  .two-col { grid-template-columns: 1fr 1fr; }
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-0 { margin-top: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
[dir="rtl"] .header-inner { flex-direction: row-reverse; }
[dir="rtl"] .nav-desktop { flex-direction: row-reverse; }
[dir="rtl"] .header-actions { flex-direction: row-reverse; margin-left: 0; margin-right: auto; }
[dir="rtl"] .result-row { flex-direction: row-reverse; }
[dir="rtl"] .compare-header { flex-direction: row-reverse; }
[dir="rtl"] .bank-cell { flex-direction: row-reverse; }
[dir="rtl"] .breadcrumb { flex-direction: row-reverse; }
[dir="rtl"] .select-compact { background-position: left 8px center; padding: 8px 12px 8px 28px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
