/* ===========================
   Unit Converter - styles
   Base tone matches tokens.css (Terracotta & Cream);
   no accent override, uses the base terracotta accent.
   =========================== */

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;

  /* Base tone (from tokens.css) */
  --bg: #FAF4EC;
  --card: #FFFFFF;
  --border: #EDE2D4;
  --divider: #F4EBDF;
  --ink: #3D3229;
  --text-2: #6B5F51;
  --muted: #8C7F70;
  --faint: #B5A794;
  --error: #C0392B;

  /* Base terracotta accent (no override) */
  --accent: #D9704C;
  --accent-hover: #C25B39;
  --accent-tint: #F8E4DA;
  --accent-line: #E8C9BB;

  --shadow-card: 0 2px 10px rgba(60, 40, 20, 0.06);
  --focus-ring: 0 0 0 3px rgba(217, 112, 76, 0.15);

  --radius-card: 20px;
  --radius-icon: 14px;
  --radius-pill: 999px;

  --font: "Nunito", sans-serif;
}

body {
  font-family: var(--font);
  margin: 0;
  padding: 40px 20px 64px;
  background: var(--bg);
  color: var(--ink);
}

header {
  max-width: 480px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-icon {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-icon);
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.app-icon-square {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.28);
  top: 10px;
  left: 8px;
  transform: rotate(-8deg);
}

.app-icon-circle {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  bottom: 8px;
  right: 7px;
}

.app-icon-symbol {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}

.header-text h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.header-text p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--faint);
}

main {
  max-width: 480px;
  margin: 0 auto;
}

.convert-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}

select,
input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  cursor: pointer;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

input[readonly] {
  background: var(--accent-tint);
  border-color: var(--accent-line);
  font-weight: 700;
  color: var(--ink);
}

.convert-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.convert-row .form-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.swap-btn {
  flex: none;
  width: 40px;
  height: 40px;
  margin-top: 22px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.swap-btn:hover {
  background: var(--accent-line);
}

.swap-btn:active {
  transform: scale(0.94);
}

@media (max-width: 420px) {
  .convert-row {
    flex-direction: column;
    align-items: stretch;
  }

  .swap-btn {
    align-self: center;
    margin-top: 0;
    transform: rotate(90deg);
  }

  .swap-btn:active {
    transform: rotate(90deg) scale(0.94);
  }
}
