:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1f2937, #020617 55%);
  color: #e5e7eb;
}

.page {
  min-height: 100vh;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page-header {
  margin-bottom: 1.75rem;
}

.site-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.site-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #9ca3af;
}

/* Kortti / card */

.converter-card {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 1.25rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.75);
}

.converter-form {
  margin: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.two-columns {
  justify-content: space-between;
}

.field {
  flex: 1 1 220px;
}

label {
  display: block;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

/* Syötekentät */

input[type="number"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(75, 85, 99, 0.95);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 0.95rem;
}

input[type="number"]:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

/* Valuuttapicker */

.currency-field {
  position: relative;
}

.currency-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(75, 85, 99, 0.9);
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  cursor: pointer;
}

.currency-toggle-main {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.currency-toggle-code {
  font-weight: 600;
  font-size: 0.95rem;
}

.currency-toggle-name {
  font-size: 0.8rem;
  color: #9ca3af;
}

.currency-toggle-caret {
  font-size: 0.9rem;
  opacity: 0.9;
}

.currency-toggle:focus-visible {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

/* Dropdown */

.currency-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.35rem;
  background: #020617;
  border-radius: 0.9rem;
  border: 1px solid rgba(55, 65, 81, 0.95);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
  z-index: 20;
  padding: 0.4rem 0.35rem 0.45rem;
}

.currency-search-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0.4rem 0.4rem;
}

.currency-search-label span {
  font-size: 0.75rem;
  color: #9ca3af;
}

.currency-search {
  width: 100%;
  padding: 0.4rem 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(55, 65, 81, 0.95);
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  font-size: 0.9rem;
}

.currency-search:focus {
  outline: none;
  border-color: #38bdf8;
}

/* Lista */

.currency-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.2rem 0.3rem 0.3rem;
}

.currency-option {
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-radius: 0.55rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.currency-option-code {
  font-weight: 600;
  width: 3ch;
}

.currency-option-name {
  flex: 1 1 auto;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.currency-option-fi {
  font-size: 0.75rem;
  color: #9ca3af;
}

.currency-option:hover {
  background: rgba(31, 41, 55, 0.95);
}

/* Napit */

.actions-row {
  align-items: center;
}

.swap-button,
.convert-button {
  border-radius: 999px;
  border: none;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.swap-button {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(55, 65, 81, 0.95);
  color: #e5e7eb;
}

.swap-button:hover {
  background: rgba(31, 41, 55, 0.98);
}

.convert-button {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ecfdf5;
  font-weight: 600;
}

.convert-button:hover {
  filter: brightness(1.05);
}

.status-text {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Tulos */

.result-section {
  margin-top: 1.25rem;
  border-top: 1px solid rgba(31, 41, 55, 0.9);
  padding-top: 1rem;
}

.result-main {
  margin: 0 0 0.25rem 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.result-rate {
  margin: 0.1rem 0 0.6rem 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

.info-text {
  margin: 0 0 0.4rem 0;
  font-size: 0.85rem;
  color: #fecaca;
}

.meta-text {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
}

/* INFO-OSIO */

.info-section {
  margin-top: 1.5rem;
  padding: 1.4rem 1.2rem 1.2rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.info-title {
  margin: 0 0 0.6rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.info-paragraph {
  margin: 0 0 0.6rem 0;
  font-size: 0.9rem;
  color: #d1d5db;
}

.info-paragraph strong {
  color: #e5e7eb;
}

/* Footer / kielenvaihto */

.page-footer {
  margin-top: 1.5rem;
}

.footer-text {
  margin: 0 0 0.3rem 0;
  font-size: 0.9rem;
}

.footer-text-secondary {
  font-size: 0.85rem;
}

.footer-label {
  margin-right: 0.25rem;
  color: #9ca3af;
}

.footer-separator {
  margin: 0 0.25rem;
  color: #6b7280;
}

.footer-link {
  color: #38bdf8;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-link--active {
  font-weight: 600;
}

/* Mobiili */

@media (max-width: 640px) {
  .converter-card {
    padding: 1.25rem 1rem 1rem;
  }

  .site-title {
    font-size: 1.5rem;
  }

  .info-section {
    padding: 1.2rem 1rem 1rem;
  }
}
