:root {
  --bg: #0f172a;
  --bg-deep: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(30, 41, 59, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(34, 197, 94, 0.42);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --brand: #22c55e;
  --brand-dark: #16a34a;
  --brand-ink: #052e16;
  --danger: #f87171;
  --warning: #facc15;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at top right, rgba(20, 83, 45, 0.42), transparent 38rem),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(16px);
}

.topbar__inner {
  width: min(1180px, calc(100% - 32px));
  height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand);
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.28);
}

.brand__mark svg {
  width: 23px;
  height: 23px;
  fill: white;
}

.brand__text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand__text span {
  color: var(--brand);
}

.topbar__link,
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: white;
  background: var(--brand);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.topbar__link:hover,
.button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.button--ghost,
.topbar__link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.button--ghost:hover,
.topbar__link:hover {
  background: rgba(255, 255, 255, 0.16);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 80px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 32px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.96;
  font-weight: 800;
}

h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
}

.lead {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 19px;
  line-height: 1.65;
}

.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.date-card,
.panel,
.converter,
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.date-card {
  padding: 22px;
}

.date-card label,
.converter label span {
  display: block;
  margin-bottom: 9px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 700;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.58);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

select option {
  color: #0f172a;
}

.panel {
  padding: 26px;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.currency-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  color: var(--brand-ink);
  border-color: transparent;
  background: var(--brand);
}

.rates-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.rate-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(30, 41, 59, 0.72);
}

.rate-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 34px;
  border-radius: 6px;
  color: var(--brand-ink);
  background: var(--brand);
  font-weight: 800;
}

.rate-card h3 {
  margin: 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.35;
}

.rate-value {
  margin: 18px 0 4px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  font-weight: 800;
}

.rate-note {
  color: var(--muted);
  font-size: 13px;
}

.converter {
  display: grid;
  grid-template-columns: 0.8fr 1.6fr;
  gap: 22px;
  margin-top: 24px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.14), transparent 38%),
    var(--panel);
}

.converter__form {
  display: grid;
  grid-template-columns: 1fr 1fr 50px 1fr;
  gap: 12px;
  align-items: end;
}

.swap-button {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--brand);
  background: rgba(34, 197, 94, 0.1);
  cursor: pointer;
}

.swap-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.result-card {
  grid-column: 1 / -1;
  padding: 24px;
  background: rgba(2, 6, 23, 0.54);
}

.result-card span {
  color: var(--muted);
  font-weight: 700;
}

.result-card strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
}

.result-card p {
  margin: 0;
  color: var(--soft);
}

.state {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
}

.state--error {
  border-color: rgba(248, 113, 113, 0.42);
  color: #fecaca;
}

@media (max-width: 900px) {
  .intro,
  .converter {
    grid-template-columns: 1fr;
  }

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

  .converter__form {
    grid-template-columns: 1fr 1fr;
  }

  .swap-button {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .topbar__inner,
  .page {
    width: min(100% - 24px, 1180px);
  }

  .topbar__inner {
    height: 68px;
  }

  .brand__text {
    font-size: 18px;
  }

  .topbar__link {
    display: none;
  }

  .page {
    padding-top: 34px;
  }

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

  .panel,
  .converter {
    padding: 18px;
  }

  .section-head {
    display: grid;
  }
}
