/*
  FILE: task1-currency-web/static/style.css
  VERSION: 1.1.0
  Стили веб-конвертера валют. Светлая тема, карточная вёрстка, один акцентный цвет.
  v1.1.0 — селекты валют ('из'/'в') выложены вертикально: горизонтальный ряд
           ломал карточку на узких экранах.
*/

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --text: #1a2233;
  --text-muted: #6b7488;
  --accent: #2f6df0;
  --accent-dark: #2356c8;
  --up: #1f9d57;
  --down: #d8453b;
  --border: #dfe3ec;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(26, 34, 51, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 32px 16px;
}

.app { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.app__header { text-align: center; }
.app__title { font-size: 1.9rem; font-weight: 700; }
.app__subtitle { color: var(--text-muted); font-size: 0.95rem; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card__title { font-size: 1.05rem; margin-bottom: 14px; font-weight: 600; }

/* --- Поля ввода --- */
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.field__label { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.field__input {
  font: inherit;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfcfe;
  color: var(--text);
  transition: border-color 0.15s;
}
.field__input:focus { outline: none; border-color: var(--accent); }

.converter { display: flex; flex-direction: column; gap: 16px; }
/* Селекты валют — вертикально (одна над другой), свап-кнопка между ними.
   Горизонтальный ряд ломал карточку на узких экранах. */
.converter__currencies { display: flex; flex-direction: column; gap: 10px; }

.swap-btn {
  align-self: center;
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fbfcfe;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.swap-btn:hover { background: #eef2fb; transform: rotate(180deg); }

.btn-primary {
  font: inherit;
  font-weight: 600;
  padding: 12px;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* --- Результат конвертации --- */
.result {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 9px;
  background: #eef4ff;
  font-size: 1.15rem;
}
.result strong { font-size: 1.45rem; color: var(--accent-dark); }
.result__rate { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* --- Баннер ошибки --- */
.banner { padding: 12px 16px; border-radius: 9px; font-size: 0.9rem; }
.banner--error { background: #fdecea; color: var(--down); border: 1px solid #f5c6c2; }

/* --- Таблица курсов --- */
.table-wrap { max-height: 340px; overflow-y: auto; }
.rates { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.rates th, .rates td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.rates th { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; position: sticky; top: 0; background: var(--surface); }
.rates .num { text-align: right; }
.rates td.num { font-variant-numeric: tabular-nums; }
.rates__loading { text-align: center; color: var(--text-muted); padding: 20px; }
.rates code { font-weight: 700; }

.delta--up { color: var(--up); }
.delta--down { color: var(--down); }
.delta--flat { color: var(--text-muted); }

.app__footer { text-align: center; font-size: 0.82rem; color: var(--text-muted); }
.app__footer a { color: var(--accent); }
