:root {
  color-scheme: dark;
  --bg: #07101f;
  --surface: #0b1322;
  --surface-strong: #131d2e;
  --text: #ffffff;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #b8ff20;
  --accent-hover: #c4ff46;
  --danger: #ff8d8d;
  --positive: #78e6a4;
  --container: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(7, 16, 31, 0.9);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.navigation {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
  font-weight: 600;
}

.navigation a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s ease;
}

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

.navigation .site-link {
  border: 1px solid rgba(184, 255, 32, 0.48);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 84px 0 72px;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -140px;
  top: -260px;
  border-radius: 50%;
  background: rgba(184, 255, 32, 0.09);
  filter: blur(90px);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.65fr);
  gap: 72px;
  align-items: end;
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 24px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

h1 span {
  color: var(--accent);
}

.hero-copy > p {
  max-width: 670px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 18px;
  line-height: 1.65;
}

.date-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(11, 19, 34, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.date-card > label,
.field > span,
.field > label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.date-input-wrap {
  position: relative;
}

.date-input-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  pointer-events: none;
}

input,
select {
  width: 100%;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 255, 32, 0.12);
}

.date-input-wrap input {
  padding: 0 14px 0 48px;
  color-scheme: dark;
}

.date-status {
  min-height: 38px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rates-section {
  padding: 76px 0 88px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

h2 {
  margin: 10px 0 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.loader {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.loader[hidden] {
  display: none;
}

.loader span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(184, 255, 32, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.currency-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}

.picker-label {
  color: var(--muted);
  font-size: 13px;
}

.currency-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.currency-chip {
  min-width: 58px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.currency-chip:hover {
  border-color: rgba(184, 255, 32, 0.42);
  color: var(--text);
}

.currency-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.rates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.rate-card {
  min-height: 218px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(150deg, var(--surface-strong), var(--surface));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rate-card:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 255, 32, 0.35);
}

.rate-top,
.rate-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.currency-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 255, 32, 0.3);
  border-radius: 10px;
  background: rgba(184, 255, 32, 0.08);
  color: var(--accent);
  font-size: 19px;
  font-weight: 700;
}

.currency-code {
  text-align: right;
  font-weight: 700;
}

.currency-name {
  max-width: 140px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.rate-value {
  margin: 26px 0 10px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.rate-caption {
  color: var(--muted);
  font-size: 12px;
}

.trend {
  align-self: end;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.trend.up {
  background: rgba(120, 230, 164, 0.1);
  color: var(--positive);
}

.trend.down {
  background: rgba(255, 141, 141, 0.1);
  color: var(--danger);
}

.trend.flat {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.notice {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.error-notice {
  border: 1px solid rgba(255, 141, 141, 0.3);
  background: rgba(255, 141, 141, 0.08);
  color: #ffd0d0;
}

.converter-section {
  padding: 88px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.converter-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(520px, 1.25fr);
  gap: 80px;
  align-items: center;
}

.converter-copy > p {
  max-width: 500px;
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.formula-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.formula-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 255, 32, 0.35);
  border-radius: 50%;
  color: var(--accent);
  font-weight: 700;
}

.converter-card {
  position: relative;
  padding: 26px;
  border: 1px solid rgba(184, 255, 32, 0.22);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
}

.converter-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
  gap: 14px;
  align-items: end;
}

.field input {
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.currency-combobox {
  position: relative;
}

.currency-combobox::after {
  content: "⌄";
  position: absolute;
  right: 16px;
  top: 15px;
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
}

.field .currency-search {
  height: 54px;
  padding-right: 44px;
  border-color: var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.field .currency-search::placeholder {
  color: rgba(156, 163, 175, 0.8);
}

.field .currency-search:focus {
  border-color: var(--accent);
}

.currency-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 268px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid rgba(184, 255, 32, 0.32);
  border-radius: 12px;
  background: #0b1322;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.currency-options[hidden] {
  display: none;
}

.currency-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.currency-option:hover,
.currency-option.is-active {
  background: rgba(184, 255, 32, 0.1);
}

.currency-option-code {
  min-width: 38px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.currency-option-name {
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  line-height: 1.35;
}

.currency-empty {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.amount-field input {
  font-size: 21px;
}

.swap-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 14px auto;
  border: 1px solid rgba(184, 255, 32, 0.45);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.swap-button:hover {
  background: rgba(184, 255, 32, 0.12);
  transform: rotate(180deg);
}

.swap-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-row {
  padding: 20px;
  border-radius: 12px;
  background: var(--surface-strong);
}

.result-block > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.result-block strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--accent);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.result-block small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}

.footer-inner a {
  color: var(--accent);
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .hero-grid,
  .converter-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .date-card {
    max-width: 520px;
  }

  .rates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .header-inner {
    min-height: 68px;
  }

  .brand {
    font-size: 16px;
  }

  .navigation > a:not(.site-link) {
    display: none;
  }

  .navigation .site-link {
    padding: 8px 10px;
    font-size: 12px;
  }

  .hero {
    padding: 58px 0 52px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-copy > p {
    font-size: 16px;
  }

  .section-heading,
  .currency-picker,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .rates-grid,
  .converter-row {
    grid-template-columns: 1fr;
  }

  .rate-card {
    min-height: 190px;
  }

  .converter-section,
  .rates-section {
    padding: 60px 0;
  }

  .converter-card {
    padding: 18px;
  }

  .result-row {
    padding: 18px;
  }

  .footer-inner {
    justify-content: center;
    min-height: 112px;
    padding: 26px 0;
  }
}
