/* =========================
   VARIABLES
========================= */
:root {
  --bg: #f5f5f3;
  --bg-elevated: #ffffff;
  --border-soft: #e1e1dc;

  --accent: #f08a24;
  --accent-soft: rgba(240, 138, 36, 0.08);
  --accent-strong: #d97316;

  --text-main: #222221;
  --text-muted: #6b6b66;
  --text-soft: #9c9c92;
  --danger: #c62828;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --shadow-soft: 0 10px 30px rgba(0,0,0,.04);
}

/* =========================
   RESET
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

button, input, select {
  font-family: inherit;
}

/* =========================
   GLOBAL LAYOUT
========================= */
.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================
   BRAND
========================= */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 38px;
  width: auto;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* =========================
   APP LAYOUT
========================= */
.app-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1200px;
  margin: auto;
  padding: 20px 0;
}

.app-left,
.app-right {
  width: 100%;
}

/* =========================
   CATEGORIES
========================= */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-tile {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.category-tile.active {
  outline: 3px solid #4a7afe;
  background: #eef3ff;
}

.category-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* =========================
   CONVERSION DIRECTION (SWAP BUTTON)
========================= */

/* =========================
   CONVERSION DIRECTION (SWAP BUTTON)
========================= */

.swap-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f2f2;
  transition: transform 0.25s ease, background-color 0.2s ease;
}

/* EU → USA */
.app-root[data-direction="reverse"] .swap-button {
  transform: rotate(180deg);
  background-color: var(--accent-soft);
}

/* USA → EU */
.app-root[data-direction="forward"] .swap-button {
  transform: rotate(0deg);
}



/* Stato ATTIVO (USA → EU o EU → USA) */
.direction-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 600;
}

/* ================================
   Conversion direction (UI state)
   ================================ */

#converterView[data-direction="forward"] .swap-button {
  transform: rotate(0deg);
}

#converterView[data-direction="reverse"] .swap-button {
  transform: rotate(180deg);
}

/* opzionale: feedback visivo */
.swap-button {
  transition: transform 0.25s ease;
}

/* =========================
   CONVERTER
========================= */
.converter-header {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 8px;
}

.converter-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================
   FIELDS
========================= */
.field-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.field-input input,
.field-select select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
}

.field-input input:focus,
.field-select select:focus {
  border-color: var(--accent);
  outline: none;
}

/* Height feet/inches */
.height-input-group {
  display: flex;
  gap: 8px;
}

.height-input-group.hidden {
  display: none;
}

/* =========================
   UNITS ROW
========================= */
.unit-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.swap-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* =========================
   RESULT
========================= */
.result-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}

.result {
  font-size: 2rem;
  font-weight: 700;
}

.result-unit {
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================
   HELPERS
========================= */
.helper-text {
  font-size: 11px;
  color: var(--text-muted);
}

.error-text {
  font-size: 11px;
  color: var(--danger);
}

/* =========================
   SEO / TRUST
========================= */
.seo-info,
.trust {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

/* =========================
   FOOTER
========================= */
.site-footer {
  background: #111;
  color: #fff;
  margin-top: 60px;
  padding: 40px 20px;
}

.footer-container {
  max-width: 1100px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  border-top: 1px solid #333;
  padding-top: 12px;
}

/* =========================
   RESPONSIVE
========================= */
@media (min-width: 900px) {
  .app-layout {
    flex-direction: row;
    gap: 48px;
  }

  .app-left {
    flex: 0 0 38%;
  }

  .app-right {
    flex: 1;
  }

  .result {
    font-size: 2.4rem;
  }
}

@media (max-width: 600px) {
  .logo img {
    height: 32px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
