/* ============================
   IL CLIENTE FANATICO AI LAB 2026
   Design System v2
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #EDE8E0;
  --bg-subtle: #E3DDD4;
  --card: #FFFFFF;
  --card-border: rgba(0,0,0,0.06);

  --dark: #1A1A2E;
  --dark-secondary: #252540;
  --dark-card: rgba(255,255,255,0.06);
  --dark-border: rgba(255,255,255,0.08);

  --crimson: #8B1A2B;
  --crimson-light: #A62240;
  --crimson-dark: #6D1422;
  --crimson-bg: rgba(139,26,43,0.08);

  --silver: #7A7A8A;
  --blue-accent: #5BA4D4;

  --text: #1A1A2E;
  --text-secondary: #5A5A6A;
  --text-muted: #8A8A9A;

  --green: #1B8A50;
  --green-bg: rgba(27,138,80,0.1);
  --amber: #B8860B;
  --amber-bg: rgba(184,134,11,0.1);
  --red: #B83030;
  --red-bg: rgba(184,48,48,0.1);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
  --max-width: 720px;
  --max-width-narrow: 620px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }

h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: clamp(1rem, 2vw, 1.15rem); }

p { font-size: clamp(0.95rem, 2vw, 1.05rem); }

.text-crimson { color: var(--crimson); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding: 60px 0;
}

.section--sm {
  padding: 40px 0;
}

/* ---- Header ---- */
.site-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo {
  height: 56px;
  width: auto;
}

.site-header__nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.site-header__nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color var(--transition);
}

.site-header__nav a:hover {
  color: var(--crimson);
}

/* Hamburger toggle */
.site-header__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 110;
}

.site-header__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px auto;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.site-header__toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.site-header__toggle.open span:nth-child(2) {
  opacity: 0;
}
.site-header__toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .site-header__logo { height: 44px; }

  .site-header__toggle {
    display: block;
  }

  .site-header__nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    z-index: 105;
  }

  .site-header__nav.open {
    display: flex;
  }

  .site-header__nav a {
    font-size: 1.2rem;
    font-weight: 700;
  }
}

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card--lg {
  padding: 40px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  line-height: 1.4;
}

.btn--primary {
  background: var(--crimson);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139,26,43,0.25);
}

.btn--primary:hover {
  background: var(--crimson-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,26,43,0.35);
}

.btn--outline {
  background: transparent;
  color: var(--crimson);
  border: 2px solid var(--crimson);
}

.btn--outline:hover {
  background: var(--crimson-bg);
}

.btn--lg {
  padding: 18px 40px;
  font-size: 1.1rem;
}

.btn--full {
  width: 100%;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-weight: 500;
}

.btn--ghost:hover {
  color: var(--text);
}

/* ---- Badge / Tag ---- */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge--crimson {
  background: var(--crimson-bg);
  color: var(--crimson);
}

.badge--green {
  background: var(--green-bg);
  color: var(--green);
}

.badge--amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge--red {
  background: var(--red-bg);
  color: var(--red);
}

/* ---- Grid helpers ---- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Lente card (4 Lenti) ---- */
.lente-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--crimson);
  transition: transform var(--transition), box-shadow var(--transition);
}

.lente-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.lente-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--crimson-bg);
  color: var(--crimson);
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.lente-card__title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.lente-card__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---- Output list ---- */
.output-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--card-border);
}

.output-item:last-child {
  border-bottom: none;
}

.output-item__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--crimson-bg);
  color: var(--crimson);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
}

.output-item__text {
  flex: 1;
}

.output-item__title {
  font-weight: 700;
  margin-bottom: 2px;
}

.output-item__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---- Stat blocks ---- */
.stat-block {
  text-align: center;
  padding: 24px 16px;
}

.stat-block__number {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 900;
  color: var(--crimson);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-block__label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---- Hero section ---- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero__badge {
  margin-bottom: 20px;
}

.hero__title {
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.hero__cta {
  margin-top: 8px;
}

/* ---- Steps ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}

.step {
  text-align: center;
  position: relative;
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--crimson);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.step__title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.step__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; gap: 32px; }
}

/* ---- Gauge (quiz results) ---- */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gauge-svg {
  width: 120px;
  height: 120px;
}

.gauge-bg {
  fill: none;
  stroke: var(--bg-subtle);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

.gauge-text {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 24px;
  fill: var(--text);
  dominant-baseline: central;
  text-anchor: middle;
}

/* ---- Progress bar (quiz) ---- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-bar__fill {
  height: 100%;
  background: var(--crimson);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ---- Quiz option buttons ---- */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 24px;
  margin-bottom: 12px;
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  line-height: 1.5;
}

.quiz-option:hover {
  border-color: var(--crimson);
  background: var(--crimson-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.quiz-option--selected {
  border-color: var(--crimson);
  background: var(--crimson-bg);
  font-weight: 600;
}

.quiz-option__letter {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.quiz-option:hover .quiz-option__letter {
  background: var(--crimson);
  color: #fff;
}

.quiz-option--selected .quiz-option__letter {
  background: var(--crimson);
  color: #fff;
}

.quiz-option__text {
  flex: 1;
}

/* ---- Input fields ---- */
.input-field {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  transition: border-color var(--transition);
  outline: none;
}

.input-field:focus {
  border-color: var(--crimson);
}

.input-field::placeholder {
  color: var(--text-muted);
}

/* ---- Priority box (quiz results) ---- */
.priority-box {
  background: var(--crimson-bg);
  border: 2px solid var(--crimson);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.priority-box__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--crimson);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.priority-box__area {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.priority-box__desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ---- Footer ---- */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Divider ---- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--crimson);
  border-radius: 2px;
  margin: 0 auto 24px;
}

/* ---- Animate in ---- */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- CTA banner ---- */
.cta-banner {
  background: var(--crimson);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}

.cta-banner h2 {
  color: #fff;
  margin-bottom: 12px;
}

.cta-banner p {
  color: rgba(255,255,255,0.85);
  margin-bottom: 24px;
}

.cta-banner .btn {
  background: #fff;
  color: var(--crimson);
}

.cta-banner .btn:hover {
  background: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ---- Dark sections ---- */
.section--dark {
  background: var(--dark);
  color: #fff;
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark strong {
  color: #fff;
}

.section--dark p,
.section--dark li {
  color: rgba(255,255,255,0.8);
}

.section--dark .badge--crimson {
  background: rgba(139,26,43,0.3);
  color: #fff;
}

.section--dark .stat-block__number {
  color: var(--crimson-light);
}

.section--dark .stat-block__label {
  color: rgba(255,255,255,0.7);
}

/* ---- Screen reader only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
