/* =========================================================
   CalcolaExtra — Stile principale del sito
   ========================================================= */

:root {
  --color-primary: #0f766e;
  --color-primary-dark: #0b544e;
  --color-primary-light: #14b8a6;
  --color-accent: #f59e0b;
  --color-bg: #f7fafa;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-text-muted: #5b6472;
  --color-border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.12);
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  text-decoration: none;
}

.logo span {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.badge-new {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: relative;
  top: -1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--color-primary-dark);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
  }
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  padding: 64px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.92;
  max-width: 650px;
  margin: 0 auto;
}

.page-header {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  padding: 44px 20px;
  text-align: center;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 800;
}

.page-header p {
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 10px;
}

.breadcrumb a {
  color: #fff;
  text-decoration: underline;
}

/* ---------- Sections ---------- */

.section {
  padding: 56px 0;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
}

/* ---------- Cards grid (tools & blog) ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.card a.card-link {
  display: inline-block;
  margin-top: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.card a.card-link::after {
  content: " →";
}

/* ---------- Calculator boxes ---------- */

.calc-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  max-width: 620px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.92rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.checkbox-group input {
  width: auto;
}

.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 13px 26px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: #f0fdfa;
}

.result-box {
  margin-top: 22px;
  padding: 20px;
  border-radius: var(--radius);
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  display: none;
}

.result-box.visible {
  display: block;
}

.result-box .result-main {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.result-box .result-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px dashed #99f6e4;
  font-size: 0.95rem;
}

.result-box .result-line:first-of-type {
  border-top: none;
}

.hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.copy-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.copy-row .btn {
  width: auto;
  flex: 1;
}

/* ---------- Ad placeholder ---------- */

.ad-slot {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--color-text-muted);
  text-align: center;
  padding: 22px;
  font-size: 0.85rem;
  margin: 32px auto;
  max-width: 728px;
}

.ad-slot strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text);
}

/* ---------- Blog ---------- */

.article-meta {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.article-body {
  max-width: 720px;
  margin: 0 auto;
  background: var(--color-surface);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-body h2 {
  margin-top: 34px;
  font-size: 1.4rem;
}

.article-body h3 {
  margin-top: 26px;
  font-size: 1.15rem;
}

.article-body ul,
.article-body ol {
  padding-left: 22px;
}

.article-body li {
  margin-bottom: 8px;
}

.affiliate-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.88rem;
  color: #92400e;
  margin: 20px 0;
}

.cta-box {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  margin: 30px 0;
}

.cta-box a {
  font-weight: 700;
}

/* ---------- Footer ---------- */

.site-footer {
  background: #0b1120;
  color: #cbd5e1;
  padding: 40px 20px 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto 24px;
}

.footer-grid h4 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  border-top: 1px solid #1e293b;
  padding-top: 18px;
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
}

/* ---------- Utility ---------- */

.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: 40px;
}
