/*
Theme Name: Buscaglione Caffè – Blue
Theme URI: https://buscaglioncaffe.it
Author: Buscaglione Caffè
Author URI: https://buscaglioncaffe.it
Description: Landing page agenti Buscaglione Caffè – variante blu
Version: 1.3.0
License: GNU General Public License v2 or later
Text Domain: buscaglione-blue
*/

:root {
  --brown: #2B3990;
  --brown-mid: #3547B5;
  --brown-light: #6B7FD4;
  --cream: #F0F3FF;
  --gold: #4A72FF;
  --gold-light: #C5D4FF;
  --text: #111540;
  --muted: #4A5598;
  --white: #fff;
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); background: var(--cream); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* NAV */
.site-header { background: var(--brown); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; }
.nav-logo { color: var(--gold-light); font-size: 1.2rem; font-weight: 700; letter-spacing: 1px; }
.nav-cta { background: var(--gold); color: var(--brown); padding: .5rem 1.25rem; border-radius: 50px; font-weight: 600; font-size: .9rem; cursor: pointer; border: none; transition: opacity .2s; }
.nav-cta:hover { opacity: .85; }

/* HERO */
.hero { background: linear-gradient(135deg, var(--brown) 0%, var(--brown-mid) 60%, #5C2E0A 100%); color: var(--white); padding: 4rem 2rem; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .03; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; }
.hero-badge { display: inline-block; background: rgba(201,151,58,.2); border: 1px solid var(--gold); color: var(--gold-light); padding: .35rem 1rem; border-radius: 50px; font-size: .85rem; font-weight: 600; letter-spacing: .5px; margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.15; margin-bottom: 1.25rem; }
.hero h1 span { color: var(--gold-light); }
.hero-text p { font-size: 1.05rem; color: rgba(255,255,255,.8); margin-bottom: 2rem; }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2rem; flex-wrap: wrap; padding-top: 2rem; margin-top: 2rem; border-top: 1px solid rgba(255,255,255,.15); }
.stat-n { font-size: 1.7rem; font-weight: 800; color: var(--gold-light); }
.stat-l { font-size: .8rem; color: rgba(255,255,255,.6); margin-top: .1rem; }

/* HERO FORM */
.hero-form-wrap { background: var(--white); border-radius: var(--radius); padding: 2rem; color: var(--text); box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.hero-form-wrap h3 { font-size: 1.15rem; font-weight: 800; color: var(--brown); margin-bottom: .25rem; }
.hero-form-wrap > p { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.hf-label { display: block; font-size: .8rem; font-weight: 600; color: var(--brown-mid); margin-bottom: .2rem; }
.hf-input, .hf-select { display: block; width: 100%; padding: .65rem .9rem; margin-bottom: .85rem; border: 1px solid #D9C9B4; border-radius: var(--radius-sm); font-family: inherit; font-size: .9rem; background: var(--cream); color: var(--text); }
.hf-input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.hf-select { appearance: none; cursor: pointer; }
.hf-consent-wrap { margin-bottom: .85rem; }
.hf-consent-label { display: flex; align-items: flex-start; gap: .5rem; font-size: .78rem; color: var(--muted); cursor: pointer; line-height: 1.5; }
.hf-consent-label input[type="checkbox"] { margin-top: .2rem; flex-shrink: 0; accent-color: var(--brown); width: 14px; height: 14px; cursor: pointer; }
.hf-consent-label a { color: var(--brown-mid); text-decoration: underline; }
.hf-submit { display: block; width: 100%; background: var(--gold); color: var(--brown); padding: .85rem; border-radius: 50px; font-weight: 700; font-size: 1rem; cursor: pointer; border: none; transition: all .2s; }
.hf-submit:hover { background: var(--gold-light); transform: translateY(-2px); }
.hf-privacy { font-size: .75rem; color: var(--muted); text-align: center; margin-top: .75rem; }
.footer-links { margin-top: .35rem; }
.footer-links a { color: rgba(255,255,255,.45); font-size: .8rem; text-decoration: underline; }
.footer-links a:hover { color: rgba(255,255,255,.75); }

/* BUTTONS */
.btn-primary { background: var(--gold); color: var(--brown); padding: .85rem 2rem; border-radius: 50px; font-weight: 700; font-size: 1rem; cursor: pointer; border: none; transition: all .2s; display: inline-flex; align-items: center; gap: .5rem; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--white); padding: .85rem 2rem; border-radius: 50px; font-weight: 600; font-size: 1rem; cursor: pointer; border: 2px solid rgba(255,255,255,.4); transition: all .2s; display: inline-flex; align-items: center; gap: .5rem; }
.btn-secondary:hover { border-color: var(--white); background: rgba(255,255,255,.05); }

/* SECTIONS */
.site-section { padding: 5rem 2rem; }
.container { max-width: 1000px; margin: 0 auto; }
.section-label { font-size: .8rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--brown-mid); margin-bottom: .75rem; }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; line-height: 1.2; color: var(--brown); margin-bottom: 1rem; }
.section-sub { font-size: 1.05rem; color: var(--muted); max-width: 600px; }

/* PAGINE STANDARD (Privacy, Termini, ecc.) */
.page-content-section { background: var(--white); }
.page-content { max-width: 760px; margin-top: 1.5rem; font-size: 1.02rem; color: var(--muted); line-height: 1.85; }
.page-content h2, .page-content h3 { color: var(--brown); margin: 1.75rem 0 .75rem; line-height: 1.3; }
.page-content p { margin-bottom: 1.1rem; }
.page-content ul, .page-content ol { margin: 0 0 1.1rem 1.4rem; }
.page-content li { margin-bottom: .4rem; }
.page-content a { color: var(--brown-mid); text-decoration: underline; }

/* BENEFITS */
.benefits { background: var(--white); }
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 3rem; }
.benefit-card { background: var(--cream); border-radius: var(--radius); padding: 1.5rem; border-left: 4px solid var(--gold); transition: transform .2s; }
.benefit-card:hover { transform: translateY(-3px); }
.benefit-icon { width: 40px; height: 40px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.1rem; }
.benefit-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--brown); margin-bottom: .4rem; }
.benefit-card p { font-size: .9rem; color: var(--muted); line-height: 1.6; }

/* ABOUT */
.about { background: var(--brown); color: var(--white); }
.about .section-label { color: var(--gold-light); }
.about .section-title { color: var(--white); }
.about-body { font-size: 1.05rem; color: rgba(255,255,255,.8); line-height: 1.9; max-width: 740px; margin-top: 1.5rem; }
.about-body strong { color: var(--gold-light); }

/* TIMELINE */
.timeline-section { background: var(--cream); }
.timeline { margin-top: 3rem; position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 20px; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--gold), var(--brown-mid)); }
.step { position: relative; padding-left: 2.5rem; margin-bottom: 2.5rem; }
.step-dot { position: absolute; left: -2.05rem; top: .2rem; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); border: 3px solid var(--cream); z-index: 1; }
.step-num { font-size: .75rem; font-weight: 800; color: var(--gold); letter-spacing: 1px; margin-bottom: .3rem; }
.step h3 { font-size: 1.1rem; font-weight: 700; color: var(--brown); margin-bottom: .3rem; }
.step p { font-size: .9rem; color: var(--muted); margin-bottom: .4rem; }
.step-benefit { display: inline-block; background: rgba(201,151,58,.15); color: var(--brown-mid); font-size: .8rem; font-weight: 600; padding: .25rem .75rem; border-radius: 50px; border: 1px solid rgba(201,151,58,.3); }

/* EARN */
.earn { background: var(--white); text-align: center; }
.earn .section-sub { margin: 0 auto 2rem; }
.earn-visual { background: linear-gradient(135deg, var(--brown), var(--brown-mid)); border-radius: var(--radius); padding: 3rem 2rem; color: var(--white); max-width: 600px; margin: 0 auto; }
.earn-visual h3 { font-size: 1.8rem; font-weight: 800; color: var(--gold-light); margin-bottom: .5rem; }
.earn-visual p { color: rgba(255,255,255,.7); margin-bottom: 2rem; }
.btn-earn { background: var(--gold); color: var(--brown); padding: 1rem 2.5rem; border-radius: 50px; font-weight: 700; font-size: 1.05rem; cursor: pointer; border: none; transition: all .2s; }
.btn-earn:hover { background: var(--gold-light); transform: translateY(-2px); }

/* TRY */
.try { background: var(--cream); }
.try-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.5rem; }
.try-card { background: var(--white); border-radius: var(--radius); padding: 2rem; text-align: center; }
.try-card .cup { font-size: 2.5rem; margin-bottom: 1rem; }
.try-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--brown); margin-bottom: .5rem; }
.try-card p { font-size: .9rem; color: var(--muted); margin-bottom: 1.25rem; }
.btn-try { background: var(--brown); color: var(--white); padding: .7rem 1.5rem; border-radius: 50px; font-weight: 600; font-size: .9rem; cursor: pointer; border: none; transition: all .2s; }
.btn-try:hover { background: var(--brown-mid); }

/* REVIEWS */
.social-proof { background: var(--white); }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.review { background: var(--cream); border-radius: var(--radius); padding: 1.5rem; }
.review-stars { color: var(--gold); font-size: 1rem; margin-bottom: .75rem; }
.review q { font-size: .95rem; color: var(--text); line-height: 1.7; font-style: italic; }
.review-author { margin-top: 1rem; font-size: .85rem; font-weight: 700; color: var(--brown-mid); }
.review-role { font-size: .8rem; color: var(--muted); }

/* FINAL CTA */
.final-cta { background: linear-gradient(135deg, var(--brown) 0%, var(--brown-mid) 100%); color: var(--white); text-align: center; }
.final-cta h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.final-cta h2 span { color: var(--gold-light); }
.final-cta p { color: rgba(255,255,255,.75); font-size: 1.05rem; margin-bottom: 2.5rem; }
.final-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* FOOTER */
.site-footer { background: var(--brown); color: rgba(255,255,255,.5); text-align: center; padding: 1.5rem; font-size: .85rem; }

/* POPUP */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; align-items: center; justify-content: center; padding: 1rem; }
.overlay.active { display: flex; }
.popup { background: var(--white); border-radius: var(--radius); padding: 2rem; max-width: 680px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.popup-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }
.popup h2 { font-size: 1.5rem; font-weight: 800; color: var(--brown); margin-bottom: .4rem; }
.popup-sub { font-size: .9rem; color: var(--muted); margin-bottom: 1.5rem; }
.popup table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.popup table th { background: var(--brown); color: var(--white); padding: .65rem 1rem; text-align: left; font-weight: 600; }
.popup table th:last-child { text-align: center; }
.popup table td { padding: .65rem 1rem; border-bottom: 1px solid #EDE0D0; color: var(--text); }
.popup table td:last-child { text-align: center; font-weight: 700; color: var(--brown-mid); }
.popup table tr:last-child td { border-bottom: none; }
.popup-note { font-size: .8rem; color: var(--muted); margin: 1rem 0; padding: .75rem; background: var(--cream); border-radius: var(--radius-sm); }
.btn-popup-cta { display: block; width: 100%; background: var(--gold); color: var(--brown); padding: .9rem; border-radius: 50px; font-weight: 700; font-size: 1rem; cursor: pointer; border: none; margin-top: 1rem; transition: all .2s; }
.btn-popup-cta:hover { background: var(--gold-light); }
.popup-form input, .popup-form textarea, .popup-form select { display: block; width: 100%; padding: .7rem 1rem; margin-bottom: .85rem; border: 1px solid #D9C9B4; border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem; background: var(--cream); color: var(--text); }
.popup-form textarea { resize: vertical; min-height: 90px; }
.popup-form label { display: block; font-size: .85rem; font-weight: 600; color: var(--brown-mid); margin-bottom: .25rem; }

/* NAV LOGO IMG */
.nav-logo { display: flex; align-items: center; }
.nav-logo-img { height: 70px; width: auto; object-fit: contain; }

/* TRUSTINDEX */
.trustindex-wrap { margin-top: 2.5rem; }

/* ADMIN NOTICE */
.admin-notice { background: #fff8e1; border: 1px solid #ffe082; border-radius: var(--radius-sm); padding: 1rem 1.25rem; font-size: .9rem; color: #5a4a00; }
.admin-notice a { color: var(--brown-mid); font-weight: 600; text-decoration: underline; }

/* STORIA SECTION */
.storia-section { background: var(--brown); color: var(--white); }
.storia-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.storia-section .section-label { color: var(--gold-light); }
.storia-section .section-title { color: var(--white); }
.storia-intro { font-size: 1.05rem; color: rgba(255,255,255,.8); line-height: 1.8; margin: 1rem 0 0; max-width: 480px; }

/* CAROUSEL (inline nella sezione storia) */
.storia-carousel-wrap { min-width: 0; }
.storia-carousel { margin-top: 0; }
.carousel { position: relative; }
.carousel-viewport { overflow: hidden; border-radius: var(--radius); background: rgba(0,0,0,.35); }
.carousel-track { display: flex; transition: transform .35s ease; }
.carousel-slide { min-width: 100%; }
.carousel-slide img { width: 100%; height: 360px; object-fit: contain; display: block; }
.slide-caption { text-align: center; font-size: .85rem; color: rgba(255,255,255,.6); margin-top: .65rem; font-style: italic; padding: 0 .5rem; }

.carousel-arrow { position: absolute; top: calc(50% - 1.2rem); transform: translateY(-50%); background: rgba(0,0,0,.5); color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 1.5rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; z-index: 2; }
.carousel-arrow:hover { background: rgba(0,0,0,.75); }
.carousel-prev { left: .5rem; }
.carousel-next { right: .5rem; }

.carousel-dots { display: flex; justify-content: center; gap: .45rem; margin-top: .85rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.3); border: none; cursor: pointer; padding: 0; transition: background .2s, transform .2s; }
.dot.active { background: var(--gold); transform: scale(1.3); }

/* TABLE SCROLL WRAPPER */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* EARN POPUP CARDS */
.earn-card { background: var(--cream); border-radius: var(--radius-sm); padding: 1.25rem; margin-bottom: 1rem; border: 1px solid #E8D8C0; }
.earn-card:last-of-type { margin-bottom: 0; }
.earn-card-header { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .85rem; }
.earn-tag { font-size: .7rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.earn-card-title { font-size: 1rem; font-weight: 800; color: var(--brown); }
.earn-example-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: .85rem; background: var(--white); border-radius: var(--radius-sm); padding: .7rem 1rem; }
.earn-ex-info { font-size: .8rem; color: var(--muted); }
.earn-ex-amount { font-size: .9rem; color: var(--text); white-space: nowrap; }
.earn-ex-amount strong { color: var(--brown-mid); font-size: 1rem; }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ─ 900px  tablet portrait
   ─ 760px  mobile
   ─ 420px  small phones
══════════════════════════════════════════════ */

/* ── TABLET PORTRAIT (≤ 900px) ── */
@media (max-width: 900px) {
  /* Storia: affiancato diventa troppo stretto, impila */
  .storia-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .storia-intro { max-width: 100%; }
  .carousel-slide img { height: 280px; }
}

/* ── MOBILE (≤ 760px) ── */
@media (max-width: 760px) {
  /* Spaziatura globale ridotta */
  .site-section { padding: 3rem 1.25rem; }
  .hero          { padding: 2.5rem 1.25rem; }
  .site-header   { padding: .75rem 1.25rem; }

  /* Navbar: logo immagine più piccolo */
  .nav-logo-img { height: 48px; }

  /* Hero: colonna singola */
  .hero-inner        { grid-template-columns: 1fr; gap: 2rem; }
  .hero-stats        { gap: 1.25rem; padding-top: 1.5rem; margin-top: 1.5rem; }
  .hero-form-wrap    { padding: 1.5rem 1.25rem; }

  /* Benefits */
  .benefits-grid { margin-top: 2rem; }

  /* Timeline: riduce il padding per non tagliare il testo */
  .timeline             { padding-left: 1.75rem; }
  .timeline::before     { left: 14px; }
  .step                 { padding-left: 2rem; }
  .step-dot             { left: -1.8rem; }

  /* Earn */
  .earn-visual { padding: 2rem 1.25rem; }

  /* Try */
  .try-grid { grid-template-columns: 1fr; }
  .try-card { padding: 1.5rem; }

  /* Storia (già gestita a 900px, qui rifiniture mobile) */
  .storia-inner      { gap: 2rem; }
  .carousel-slide img { height: 220px; }

  /* Popup */
  .popup             { padding: 1.5rem 1rem; border-radius: var(--radius-sm); }
  .popup h2          { font-size: 1.25rem; }
  .popup table th,
  .popup table td    { padding: .5rem .65rem; font-size: .82rem; }

  /* Final CTA: bottoni a colonna intera */
  .final-cta          { padding: 3rem 1.25rem; }
  .final-ctas         { flex-direction: column; align-items: center; }
  .final-ctas .btn-primary,
  .final-ctas .btn-secondary { width: 100%; max-width: 340px; justify-content: center; }
}

/* ── SMALL PHONES (≤ 420px) ── */
@media (max-width: 420px) {
  /* Hero: impila anche i bottoni CTA */
  .hero-ctas          { flex-direction: column; }
  .hero-ctas .btn-primary,
  .hero-ctas .btn-secondary { width: 100%; justify-content: center; }

  /* Form hero: padding minimo */
  .hero-form-wrap  { padding: 1.25rem 1rem; }
  .hf-input,
  .hf-select       { font-size: .85rem; }

  /* Statistiche hero più compatte */
  .stat-n { font-size: 1.35rem; }
  .stat-l { font-size: .73rem; }

  /* Titoli sezione */
  .section-title { font-size: 1.45rem; }

  /* Timeline ancora più stretta */
  .timeline         { padding-left: 1.5rem; }
  .timeline::before { left: 10px; }
  .step             { padding-left: 1.75rem; }
  .step-dot         { left: -1.55rem; }

  /* Benefit cards su singola colonna esplicita */
  .benefits-grid { grid-template-columns: 1fr; }

  /* Carousel immagine */
  .carousel-slide img { height: 190px; }

  /* Popup full-bleed su schermi minuscoli */
  .overlay { padding: .5rem; }
  .popup   { padding: 1.25rem .9rem; }
}
