
:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #182033;
  --muted: #778096;
  --border: #e7eaf1;
  --accent: #635bff;
  --accent-soft: #eeedff;
  --green: #13866a;
  --shadow: 0 12px 36px rgba(26, 35, 65, 0.06);
}

body.dark {
  color-scheme: dark;
  --bg: #10131d;
  --surface: #191e2b;
  --text: #edf0fa;
  --muted: #a0a8bc;
  --border: #2a3142;
  --accent: #a39cff;
  --accent-soft: #292747;
  --green: #63d8b5;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button {
  transition: opacity 0.15s, transform 0.15s;
}

button:hover {
  opacity: 0.88;
}

button:active {
  transform: scale(0.99);
}

.hidden {
  display: none !important;
}

/* HEADER */

.topbar {
  max-width: 1180px;
  height: 76px;
  margin: auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  font-size: 23px;
}

.brand-dot {
  color: var(--accent);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.demo-label {
  padding: 4px 8px;
  border: 1px solid #e7b768;
  border-radius: 6px;
  background: #fff5df;
  color: #986012;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.icon-btn,
.swap-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
}

/* PAGE */

main {
  max-width: 1020px;
  margin: auto;
  padding: 38px 24px 80px;
}

.hero {
  max-width: 760px;
  margin: 36px auto 80px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--green);
}

.hero h1 {
  margin: 18px 0;
  font-size: clamp(39px, 6vw, 65px);
  line-height: 1.1;
  letter-spacing: -2.8px;
}

.hero h1 span {
  color: var(--accent);
}

.hero-copy {
  max-width: 550px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: 16px;
}

/* SEARCH */

.search-area {
  position: relative;
  max-width: 760px;
  margin: auto;
  text-align: left;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-icon {
  padding-left: 8px;
  color: var(--muted);
  font-size: 29px;
}

.search-box input {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-box input:focus-visible {
  outline: none;
}

.search-box button,
.primary-btn {
  padding: 13px 19px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.search-box button span {
  margin-left: 7px;
}

.search-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* AUTOCOMPLETE */

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item:focus-visible {
  background: var(--accent-soft);
}

.suggestion-flag {
  font-size: 23px;
}

.suggestion-details {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.suggestion-details strong {
  font-size: 14px;
}

.suggestion-details small {
  color: var(--muted);
  font-size: 12px;
}

.suggestion-arrow {
  color: var(--muted);
}

.suggestion-message {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
}

/* SECTION HEADINGS */

.content-section {
  margin-top: 65px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.7px;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.section-note,
.muted {
  color: var(--muted);
  font-size: 13px;
}

/* POPULAR CURRENCIES */

.popular-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rate-card {
  width: 100%;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: left;
}

.rate-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.currency-pair {
  font-size: 14px;
  font-weight: 800;
}

.pair-flags {
  font-size: 20px;
}

.rate-card p {
  margin: 16px 0 3px;
  font-size: 20px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.rate-card small {
  color: var(--muted);
}

/* CONVERTER */

.converter-card,
.result-card {
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.converter-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: end;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

.field input {
  font-size: 20px;
  font-weight: 700;
}

.field select {
  font-size: 13px;
}

.swap-btn {
  color: var(--accent);
}

.converter-card .muted {
  margin: 17px 0;
}

.primary-btn {
  width: 100%;
  padding: 14px;
}

/* RESULTS PAGE */

.results-view {
  max-width: 700px;
  margin: 18px auto 60px;
}

.back-btn,
.secondary-btn {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.result-heading {
  margin: 35px 0 23px;
}

.result-heading h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 45px);
  letter-spacing: -1.6px;
}

.result-amount {
  margin: 5px 0;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  overflow-wrap: anywhere;
}

.result-rate {
  color: var(--green);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.result-divider {
  margin: 25px 0;
  border-top: 1px solid var(--border);
}

.result-meta {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 13px;
  font-size: 13px;
}

.result-meta span {
  color: var(--muted);
}

.result-meta strong {
  overflow-wrap: anywhere;
}
/* 
.notice {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #e7b768;
  border-radius: 12px;
  background: #fff5df;
  color: #805416;
  font-size: 13px;
} */

body.dark .notice {
  border-color: #6b512a;
  background: #302819;
  color: #f3d5a0;
}

.secondary-btn {
  width: 100%;
}

/* FOOTER */

footer {
  padding: 27px 20px 35px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer-brand {
  justify-content: center;
  font-size: 17px;
}

footer p {
  margin: 8px 0 0;
}

.footer-note {
  font-size: 11px;
}

/* MOBILE LAYOUT */

@media (max-width: 700px) {
  .topbar {
    height: 68px;
    padding: 0 16px;
  }

  main {
    padding: 24px 16px 60px;
  }

  .hero {
    margin: 32px auto 55px;
  }

  .hero h1 {
    letter-spacing: -1.8px;
  }

  .search-box {
    gap: 7px;
    padding: 7px;
  }

  .search-box button {
    padding: 12px;
    font-size: 13px;
  }

  .search-box button span {
    display: none;
  }

  .popular-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .rate-card {
    padding: 13px;
  }

  .rate-card p {
    font-size: 16px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .converter-card {
    padding: 16px;
  }

  .converter-fields {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    gap: 7px;
  }

  .field input,
  .field select {
    padding: 10px 7px;
    font-size: 13px;
  }

  .field input {
    font-size: 17px;
  }

  .swap-btn {
    width: 36px;
    height: 40px;
  }

  .result-card {
    padding: 20px;
  }

  /* .demo-label {
    font-size: 9px;
  } */
}

@media (max-width: 380px) {
  .brand {
    font-size: 18px;
  }

  .popular-grid {
    grid-template-columns: 1fr;
  }

  .search-icon {
    display: none;
  }
}
