/* Font self-hosted (SIL OFL 1.1). No Google Fonts / third-party requests. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/fraunces-latin-700-normal.woff2") format("woff2"); }

:root {
  --sage: #8FA58C;
  --cream: #F6F1E7;
  --terracotta: #C9734F;
  --anthracite: #2F3437;
  --sand: #E3D3B6;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(47, 52, 55, 0.08);
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--anthracite);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(143, 165, 140, 0.25), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 115, 79, 0.12), transparent 55%),
    var(--cream);
  line-height: 1.5;
}

a { color: var(--terracotta); }

.wrap {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--sage), #6f8a6c);
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.lang-toggle {
  display: inline-flex;
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--anthracite);
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--sage);
  color: var(--white);
}

.hero { margin-bottom: 1.25rem; }
.hero h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.2;
}
.hero p { margin: 0; max-width: 42rem; color: #4a5154; }

.privacy {
  margin: 1rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--sand);
  background: rgba(143, 165, 140, 0.15);
  font-size: 0.92rem;
}

.disclaimer {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--terracotta);
  background: rgba(201, 115, 79, 0.12);
  font-size: 0.92rem;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
}
@media (max-width: 800px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.85rem 0 0.35rem;
}
label:first-of-type { margin-top: 0; }

input, select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--sand);
  border-radius: 10px;
  font: inherit;
  background: var(--cream);
  color: var(--anthracite);
}
input:focus, select:focus {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
  background: var(--white);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
}

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #667075;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

button.primary, button.secondary {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.primary { background: var(--terracotta); color: var(--white); }
button.primary:hover { filter: brightness(0.96); }
button.secondary {
  background: var(--cream);
  color: var(--anthracite);
  border: 1px solid var(--sand);
}

.results { display: flex; flex-direction: column; gap: 0.65rem; }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--sand);
  font-size: 0.95rem;
}
.result-row:last-child { border-bottom: 0; }
.result-row .label { color: #556065; }
.result-row .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.result-row.net {
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--sage);
  border-radius: var(--radius);
  background: rgba(143, 165, 140, 0.15);
}
.result-row.net .label { color: var(--anthracite); font-weight: 600; }
.result-row.net .value { font-size: 1.15rem; color: var(--anthracite); }

.period-tabs {
  display: inline-flex;
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.period-tabs button {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.period-tabs button[aria-pressed="true"] {
  background: var(--sage);
  color: var(--white);
}

.footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: #6a7276;
  text-align: center;
}

.error {
  margin-top: 0.75rem;
  color: #9b3a2a;
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* Language switch as links between /tools/<tool>/ (EN) and /tools/<tool>/it/ (IT), same as tools/cin (14/10/2026). */
.lang-toggle a {
  border: 0;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--anthracite);
}

.lang-toggle a[aria-current="page"] {
  background: var(--sage);
  color: var(--white);
}


/* Strumento 6 — occupancy / ADR / RevPAR (19/10/2026). No inline styles (CSP style-src 'self'). */
.sub-title {
  margin: 1.4rem 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
}
.card-results .sub-title { margin-top: 1.25rem; }

.check-line {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: var(--cream);
  font-size: 0.82rem;
  color: #4a5154;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.card-how { margin-top: 1.25rem; }
.how-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
}
.how-list li { margin: 0.35rem 0; }

.result-row .label { overflow-wrap: anywhere; }

@media print {
  body { background: white; }
  .topbar,
  .hero,
  .privacy,
  .card-form,
  .actions,
  .footer {
    display: none !important;
  }
  .wrap { width: 100%; margin: 0; padding: 0; }
  .grid { display: block; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .card-how { margin-top: 1rem; }
  .disclaimer { border: 1px solid #999; background: white; font-size: 0.8rem; }
  .result-row.net { background: white; }
  .check-line { background: white; border: 1px solid #ccc; }
}

/* Spacing between field groups (labels in .row are all first-of-type) and bottom-aligned inputs when a label wraps. */
.card-form .hint + .row { margin-top: 0.85rem; }
.card-form .row { align-items: end; }
