/* ---------- Brand tokens Dovescalo ---------- */
:root {
  --oro:        #E8A838;  /* magnesite oro — CTA, header, spicco */
  --verde:      #1D5C3A;  /* verde roccia — dettagli, tag, link, icone */
  --calcare:    #F2EDE6;  /* background pagina e card */
  --granito:    #2C2C2A;  /* testo principale */
  --cielo:      #C4DBD0;  /* cielo nord — tag meteo, badge */
  --su-oro:     #4A2F00;  /* testo su oro (mai nero puro) */
  --su-verde:   #FFFFFF;  /* testo su verde */

  --radius:     14px;
  --radius-pill: 999px;
  --border-oro: rgba(232, 168, 56, 0.35);  /* bordo sottile primario */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Poppins", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  background: var(--calcare);
  color: var(--granito);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
  padding: 1rem 1.25rem;
  border-bottom: 0.5px solid var(--border-oro);
}
.brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 48px; width: auto; }

/* ---------- Layout ---------- */
main { max-width: 680px; margin: 0 auto; padding: 1.25rem; }

/* ---------- Hero ---------- */
.hero { padding: 1.5rem 0 1.75rem; }
.hero h1 {
  font-weight: 600;
  font-size: 2rem;
  color: var(--oro);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.tagline { color: var(--granito); font-size: 1.05rem; opacity: 0.85; }

/* ---------- Card form ---------- */
.form-card {
  background: var(--calcare);
  border: 0.5px solid var(--border-oro);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}
.field { margin-bottom: 1.1rem; }

label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--verde);
  margin-bottom: 0.45rem;
}

input, select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--granito);
  background: #FFFFFF;
  border: 0.5px solid var(--border-oro);
  border-radius: 12px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--oro);
  box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.15);
}

/* ---------- Bottoni ---------- */
.btn-primary {
  width: 100%;
  padding: 0.8rem;
  margin-top: 0.4rem;
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  color: var(--granito);
  background: var(--oro);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  margin-top: 0.45rem;
  padding: 0.4rem 0.85rem;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--verde);
  background: transparent;
  border: 0.5px solid var(--verde);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

/* ---------- Risultati ---------- */
#risultati h2 {
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--granito);
  margin-bottom: 1rem;
}

.card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #FFFFFF;
  border: 0.5px solid var(--border-oro);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
}
.card-rank {
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--oro);
  min-width: 1.8rem;
  text-align: center;
}
.card-body { flex: 1; }
.card h3 { font-weight: 500; font-size: 1.1rem; margin-bottom: 0.55rem; }
.card h3 a { color: var(--verde); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }

/* ---------- Tag / pill ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.7rem; }
.tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
}
/* sfondo a bassa opacità + testo scuro dello stesso family */
.tag-geo     { background: rgba(29, 92, 58, 0.12);  color: var(--verde); }
.tag-grade   { background: rgba(232, 168, 56, 0.18); color: var(--su-oro); }
.tag-routes  { background: rgba(29, 92, 58, 0.12);  color: var(--verde); }
.tag-aspect  { background: rgba(232, 168, 56, 0.18); color: var(--su-oro); }
.tag-weather { background: var(--cielo);             color: var(--granito); }

/* ---------- Barra punteggio ---------- */
.score-bar {
  background: rgba(44, 44, 42, 0.1);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
}
.score-fill {
  background: var(--oro);
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.3s;
}
.score-label {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--verde);
}

.empty {
  text-align: center;
  color: var(--granito);
  opacity: 0.7;
  padding: 2rem;
}

/* ---------- Preset pesi ---------- */
.presets { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.preset {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  color: var(--verde, #1D5C3A);
  background: transparent;
  border: 1px solid var(--border-oro, rgba(232,168,56,0.30));
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.preset:hover { background: rgba(29,92,58,0.07); }
.preset.is-active {
  background: var(--oro, #E8A838);
  color: var(--su-oro, #4A2F00);
  border-color: var(--oro, #E8A838);
}


/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--granito);
  opacity: 0.6;
  padding: 2rem 1rem;
}
.site-footer a { color: var(--verde); }

.field-hint {
  font-size: 0.8rem;
  color: var(--granito, #2C2C2A);
  opacity: 0.65;
  margin: -0.1rem 0 0.55rem;
  line-height: 1.4;
}

/* ---------- Sezione credit falesia.it ---------- */
.credit {
  max-width: 1180px;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}
.credit h3 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--verde);
  margin-bottom: 1.25rem;
}
.credit-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #FFFFFF;
  border: 1px solid var(--border-oro);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.credit-ico {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(232, 168, 56, 0.18);
  display: flex; align-items: center; justify-content: center;
}
.credit-body { min-width: 0; }
.credit-body h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; }
.credit-body p {
  font-size: 0.9rem;
  opacity: 0.78;
  line-height: 1.65;
  margin-bottom: 0.9rem;
}
.credit-body p a { color: var(--verde); }
.credit-btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--su-oro);
  background: var(--oro);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.15s;
}
.credit-btn:hover { background: #C98D23; }

/* ---------- Footer esteso ---------- */
.ft { display: flex; flex-direction: column; gap: 0.5rem; }
.ft-links a, .ft-credits a { color: var(--verde); }
.ft-credits { line-height: 1.7; }
.ft-copy { margin-top: 0.25rem; }
