:root {
  --navy-950: #070d1d;
  --navy-900: #0b1120;
  --navy-850: #0f172a;
  --navy-800: #162033;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --white: #f8fafc;
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --indigo: #8ba5f8;
  --danger: #fb7185;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--navy-850);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(6, 182, 212, 0.13), transparent 29rem),
    radial-gradient(circle at 85% 48%, rgba(99, 102, 241, 0.1), transparent 33rem),
    var(--navy-850);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button,
summary,
select,
input[type="date"] {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  background: rgba(11, 17, 32, 0.9);
  backdrop-filter: blur(16px);
}

.topline {
  border-bottom: 1px solid rgba(51, 65, 85, 0.32);
  background: rgba(7, 13, 29, 0.78);
}

.topline-inner {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.topline-accent {
  color: var(--cyan-light);
}

.divider {
  color: var(--slate-600);
}

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

.tool-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 750;
}

.tool-title-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, var(--cyan));
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.35);
  color: white;
  font-weight: 800;
}

.source-badge,
.eyebrow,
.section-kicker,
.currency-code {
  color: var(--cyan-light);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.source-badge {
  padding: 10px 15px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  font-size: 13px;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.14);
}

.hero {
  padding: 72px 0 38px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  font-size: 13px;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(27px, 4vw, 36px);
  line-height: 1.13;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.lead {
  max-width: 690px;
  margin: 0 auto;
  color: var(--slate-300);
  font-size: 19px;
  line-height: 1.65;
}

.workspace {
  padding: 16px 0 80px;
}

.date-panel,
.converter-card,
.rate-card,
.currency-settings {
  border: 1px solid rgba(71, 85, 105, 0.66);
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.2);
}

.date-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 28px;
  border-radius: 18px;
}

.date-panel p,
.converter-heading p {
  margin-bottom: 0;
  color: var(--slate-400);
}

.date-field,
.converter-grid label,
.add-currency-row label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--slate-300);
  font-weight: 650;
}

input,
select {
  min-height: 50px;
  border: 1px solid var(--slate-600);
  border-radius: 9px;
  outline: none;
  background: var(--navy-850);
  color: var(--white);
  padding: 11px 14px;
}

input:focus,
select:focus,
button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(34, 211, 238, 0.4);
  outline-offset: 2px;
}

.date-field input {
  min-width: 220px;
  color: var(--cyan-light);
  font-weight: 700;
}

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

.rate-date {
  color: var(--slate-300);
  font-size: 14px;
}

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

.rate-card {
  min-height: 210px;
  padding: 22px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.rate-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), #6366f1);
}

.rate-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.currency-code {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.nominal {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--slate-700);
  color: var(--slate-300);
  font-size: 12px;
  white-space: nowrap;
}

.rate-value {
  margin: 30px 0 13px;
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 760;
  letter-spacing: -0.03em;
}

.movement {
  color: var(--slate-400);
  font-size: 13px;
  line-height: 1.45;
}

.movement.up {
  color: #67e8f9;
}

.movement.down {
  color: #a5b4fc;
}

.skeleton {
  height: 19px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

.skeleton.short {
  width: 45%;
}

.skeleton.long {
  width: 80%;
  height: 37px;
  margin-top: 56px;
}

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

.currency-settings {
  margin-top: 16px;
  border-radius: 14px;
}

.currency-settings summary {
  padding: 18px 22px;
  color: var(--cyan-light);
  font-weight: 700;
}

.settings-content {
  padding: 0 22px 22px;
}

.selected-currencies {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
}

.currency-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.09);
  color: var(--cyan-light);
  font-weight: 700;
}

.currency-chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--slate-700);
  color: var(--white);
}

.add-currency-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.secondary-button {
  min-height: 50px;
  padding: 11px 22px;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  background: transparent;
  color: var(--cyan-light);
  font-weight: 700;
}

.converter-card {
  margin-top: 52px;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 20px;
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.1);
}

.converter-heading {
  margin-bottom: 28px;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr auto 1fr;
  align-items: end;
  gap: 14px;
}

.currency-search-control {
  position: relative;
}

.currency-search-control input {
  width: 100%;
  padding-left: 43px;
}

.currency-search-icon {
  position: absolute;
  z-index: 1;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cyan-light);
  font-size: 25px;
  line-height: 1;
  pointer-events: none;
}

.swap-button {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(34, 211, 238, 0.44);
  border-radius: 50%;
  background: var(--navy-850);
  color: var(--cyan-light);
  font-size: 24px;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.16);
}

.conversion-result {
  margin-top: 28px;
  padding: 26px;
  border: 1px solid rgba(34, 211, 238, 0.27);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(99, 102, 241, 0.08));
}

.conversion-result span,
.conversion-result small {
  display: block;
  color: var(--slate-300);
}

.conversion-result strong {
  display: block;
  margin: 7px 0;
  color: var(--white);
  font-size: clamp(30px, 6vw, 48px);
  letter-spacing: -0.035em;
}

.error-message,
.info-message {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 10px;
}

.error-message {
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.08);
  color: #fecdd3;
}

.info-message {
  margin: -6px 0 18px;
  border: 1px solid rgba(139, 165, 248, 0.38);
  background: rgba(99, 102, 241, 0.08);
  color: #c7d2fe;
}

.site-footer {
  border-top: 1px solid rgba(51, 65, 85, 0.55);
  background: #101a25;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: clamp(36px, 8vw, 96px);
  padding: 48px 0 34px;
  color: var(--slate-400);
  font-size: 14px;
}

.footer-about p {
  max-width: 390px;
  margin: 18px 0 0;
  line-height: 1.75;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 16px;
}

.footer-brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, var(--cyan));
  color: white;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.26);
}

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.footer-column h3 {
  margin-bottom: 4px;
  color: var(--white);
  font-size: 14px;
}

.footer-column a {
  color: var(--slate-400);
  transition: color 160ms ease;
}

.footer-column a:hover {
  color: var(--cyan-light);
}

.footer-bottom {
  padding: 20px 0 24px;
  border-top: 1px solid rgba(71, 85, 105, 0.5);
  color: var(--slate-600);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .rates-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .footer-main {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 34px;
  }

  .swap-button {
    display: none;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  .topline-inner {
    justify-content: center;
  }

  .topline-inner .divider,
  .topline-accent {
    display: none;
  }

  .navline {
    min-height: 72px;
  }

  .source-badge {
    display: none;
  }

  .hero {
    padding-top: 52px;
  }

  .date-panel,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .date-field input {
    min-width: 0;
    width: 100%;
  }

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

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

  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 38px 0 28px;
  }

  .footer-about p {
    max-width: 100%;
  }
}

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