/* ==========================================================================
   TRAILRUNNINGCOACH.IT — sito di presentazione di TrailCore
   Stessi colori, forme e font della WebApp (vedi trailcore-layout.css del plugin).

   1. Token
   2. Base
   3. Intestazione e piè di pagina
   4. Bottoni
   5. Sezioni e card
   6. Apertura (hero) e telefono
   7. Contenuti delle sezioni
   8. Prezzi
   9. Chi siamo
   10. FAQ
   11. Contatti
   12. Schermi grandi
   ========================================================================== */

/* 1. TOKEN ================================================================ */
:root {
    --primary: #564538;       /* Marrone terra */
    --primary-dark: #292524;
    --accent: #D14E4B;        /* Rosso */
    --bg: #FAF8F6;            /* Sabbia */
    --bg-card: #FFFFFF;
    --bg-subtle: #F5F2EF;
    --text-dark: #292524;
    --text: #57534E;
    --text-muted: #8A817C;
    --border: #E7E5E4;
    --border-strong: #D6D3D1;
    --success: #15803D;  --success-bg: #F0FDF4;  --success-border: #BBF7D0;
    --danger: #B91C1C;   --danger-bg: #FEF2F2;   --danger-border: #FECACA;
    --target-bg: #FEFCE8; --target-border: #FDE68A;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(86, 69, 56, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(86, 69, 56, 0.08);
    --shadow-lg: 0 30px 60px -20px rgba(41, 37, 36, 0.35);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --max: 1100px;
    --gutter: 16px;
}

/* 2. BASE ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--text-dark); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 5vw, 2.25rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
strong { color: var(--text-dark); }
ul { padding-left: 1.2em; }

.icon { width: 1.2em; height: 1.2em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--primary-dark); color: #fff; padding: 10px 16px; border-radius: var(--radius-md); }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Testi da completare prima della pubblicazione (vedi README): ben visibili apposta. */
.da-compilare { background: #FEF3C7; outline: 1px dashed #D97706; border-radius: 3px; padding: 0 3px; }

/* 3. INTESTAZIONE E PIÈ DI PAGINA ========================================= */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(250, 248, 246, 0.92);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner { max-width: var(--max); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 4px; text-decoration: none; color: var(--text-dark); margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.brand-name { font-size: 1.2rem; font-weight: 400; letter-spacing: -0.03em; }
.brand-name b { font-weight: 800; }
.site-nav { display: none; gap: 22px; }
.site-nav a, .header-login { color: var(--text-dark); text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.site-nav a:hover, .header-login:hover { color: var(--accent); }
.header-login { display: none; }

.site-footer { background: var(--primary-dark); color: #D6D3D1; margin-top: 0; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 32px; display: grid; gap: 28px; }
.site-footer .brand { color: #FAF8F6; }
.site-footer a { color: #FAF8F6; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; padding: 0; margin: 0; }
.footer-nav a { text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: #F2A7A5; }
.footer-legal { font-size: 0.85rem; line-height: 1.6; color: #A8A29E; border-top: 1px solid #44403C; padding-top: 20px; }
.footer-legal p { margin: 0 0 6px; }
.footer-legal .da-compilare { color: var(--text-dark); }

/* 4. BOTTONI ============================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 22px;
    border: 1px solid transparent; border-radius: var(--radius-md);
    font: 600 1rem/1.3 var(--font);
    text-decoration: none; text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-secondary:hover, .btn-secondary:focus-visible { background: var(--accent); color: #fff; }
.btn-small { padding: 9px 14px; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* 5. SEZIONI E CARD ======================================================= */
.section { padding: 64px 0; }
.section--alt { background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section-head { max-width: 720px; margin: 0 0 32px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { display: block; margin-bottom: 10px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.lead { font-size: 1.125rem; color: var(--text); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.section--alt .card { background: var(--bg); }
.card h3 { display: flex; align-items: center; gap: 10px; }
.card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-bottom: 14px;
    border-radius: 12px; background: var(--bg-subtle); color: var(--primary);
}
.section--alt .card-icon { background: var(--bg-card); }
.card-icon .icon { width: 22px; height: 22px; }
.grid { display: grid; gap: 16px; }

/* 6. APERTURA (HERO) E TELEFONO =========================================== */
.hero { padding: 40px 0 56px; background: radial-gradient(1200px 500px at 85% 0%, #F3ECE6 0%, rgba(250, 248, 246, 0) 70%); }
.hero-inner { display: grid; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 16px; }
.hero-text { font-size: 1.15rem; margin-bottom: 24px; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 0 0 12px; font-size: 0.95rem; font-weight: 600; color: var(--text-dark); }
.hero-facts li { display: flex; align-items: center; gap: 6px; }
.hero-facts .icon { color: var(--success); }
.plans-launch.plans-beta { border-color: var(--accent); background: #fff; margin-bottom: 14px; }
.plans-launch.plans-beta + .plans-launch { margin-top: 0; }
.plans-beta a { color: var(--accent); font-weight: 700; }
.hero-devices { font-size: 0.95rem; color: var(--text-muted); margin: 0 0 12px; }
.hero-login { font-size: 0.95rem; color: var(--text-muted); }

.phone {
    width: min(290px, 78vw);
    margin: 0 auto;
    border: 10px solid var(--primary-dark);
    border-radius: 40px;
    overflow: hidden;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
}
.phone img { width: 100%; }
.phone--hero { transform: rotate(2deg); }
.phone-caption { margin-top: 14px; text-align: center; font-size: 0.85rem; color: var(--text-muted); }

/* Riquadro "In breve": i fatti principali, utili anche ai motori con IA. */
.facts { margin: 0; display: grid; gap: 0; }
.facts div { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.facts dd { margin: 2px 0 0; color: var(--text-dark); font-weight: 500; }

/* 7. CONTENUTI DELLE SEZIONI ============================================== */
.not-for { margin-top: 20px; display: flex; gap: 12px; align-items: flex-start; background: var(--bg-subtle); border-radius: var(--radius-md); padding: 16px 18px; font-size: 0.975rem; }
.not-for .icon { color: var(--primary); margin-top: 3px; }

/* Passi numerati */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; counter-reset: step; }
.step { position: relative; padding-top: 56px; }
.step::before {
    counter-increment: step; content: counter(step);
    position: absolute; top: 20px; left: 24px;
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 800;
}

/* Funzioni: testo + telefono */
.feature { display: grid; gap: 28px; align-items: center; padding: 28px 0; }
.feature + .feature { border-top: 1px dashed var(--border-strong); }
.feature h3 { font-size: 1.4rem; }
.checklist { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .icon { color: var(--success); margin-top: 3px; }
.features-more { margin-top: 36px; }
.features-more .card { padding: 20px; }
.features-more h3 { font-size: 1.05rem; margin-bottom: 6px; }
.features-more p { font-size: 0.95rem; }

/* Tabella di confronto */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.compare { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.95rem; }
.compare th, .compare td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: 0; }
.compare thead th { background: var(--bg-subtle); color: var(--text-dark); font-size: 0.85rem; letter-spacing: 0.02em; }
.compare thead th.is-us { background: var(--primary); color: #fff; }
.compare tbody th { color: var(--text-dark); font-weight: 600; width: 32%; }
.compare td.is-us { background: #FBF7F4; color: var(--text-dark); font-weight: 600; }
.yes, .no, .mid { display: inline-flex; align-items: center; gap: 6px; }
.yes .icon { color: var(--success); }
.no .icon { color: var(--danger); }
.mid .icon { color: #A16207; }
.why { margin-top: 32px; }

/* 8. PREZZI =============================================================== */
.plans { display: grid; gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan h3 { font-size: 1.1rem; margin-bottom: 4px; }
.plan-price { margin: 10px 0 2px; font-size: 2.6rem; font-weight: 800; color: var(--text-dark); letter-spacing: -0.03em; line-height: 1.1; }
.plan-price small { font-size: 1rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.plan-month { font-size: 0.95rem; color: var(--text-muted); min-height: 1.6em; }
.plan-save { color: var(--success); font-weight: 700; }
.plan .checklist { margin: 18px 0 22px; font-size: 0.975rem; }
.plan .btn { margin-top: auto; }
.plan--best { border: 2px solid var(--accent); box-shadow: var(--shadow-md); }
.plan-badge {
    position: absolute; top: -13px; left: 24px;
    background: var(--accent); color: #fff;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 4px 12px; border-radius: 999px;
}
.plans-note { margin-top: 20px; text-align: center; font-size: 0.95rem; color: var(--text-muted); }

/* 9. CHI SIAMO ============================================================ */
.about { display: grid; gap: 28px; align-items: start; }
.photo-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    aspect-ratio: 4 / 5; width: 100%; max-width: 280px; margin: 0 auto;
    border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
    background: var(--bg-subtle); color: var(--text-muted);
    font-size: 0.9rem; font-weight: 600; text-align: center; padding: 16px;
}
.photo-box .icon { width: 40px; height: 40px; stroke-width: 1.5; }
.photo-box--wide { aspect-ratio: 16 / 9; max-width: none; }
/* Foto vere, al posto dei riquadri tratteggiati (vedi README). */
.photo { width: 100%; max-width: 280px; margin: 0 auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.photo--wide { max-width: none; aspect-ratio: 16 / 9; box-shadow: none; }
.about-role { color: var(--accent); font-weight: 700; margin-bottom: 16px; }
.about-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.about-list li { display: flex; gap: 10px; align-items: flex-start; }
.about-list .icon { color: var(--primary); margin-top: 3px; }
.about-cards { margin-top: 36px; }
.human { margin-top: 36px; border-top: 3px solid var(--accent); }
.human-head { margin-bottom: 20px; }
.human .grid { row-gap: 28px; }
.human-head h3 { font-size: 1.35rem; margin: 6px 0 8px; }
.human-option { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.human-option h4 { margin: 4px 0 0; font-size: 1.05rem; }
.human-option p { margin: 0 0 6px; }
.human-option .btn { margin-top: auto; }
.quote { font-size: 1.1rem; font-style: italic; color: var(--text-dark); border-left: 3px solid var(--accent); padding-left: 16px; margin: 20px 0 0; }

/* 10. FAQ ================================================================= */
.faq { display: grid; gap: 12px; max-width: 820px; margin: 0 auto; }
.faq details { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.section--alt .faq details { background: var(--bg); }
.faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 20px; cursor: pointer; list-style: none;
    font-weight: 700; color: var(--text-dark);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--text-muted); transition: transform 0.2s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .answer { margin: 0 20px; padding: 14px 0 18px; border-top: 1px dashed var(--border); }

/* 11. CONTATTI ============================================================ */
.contact { display: grid; gap: 24px; align-items: start; }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-weight: 600; color: var(--text-dark); font-size: 0.95rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    background: var(--bg-card); color: var(--text-dark);
    font: 400 1rem/1.4 var(--font);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(86, 69, 56, 0.15); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); flex-shrink: 0; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; } /* trappola anti-spam */
.form-status { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid; font-weight: 600; }
.form-status[hidden] { display: none; }
.form-status.is-ok { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.form-status.is-error { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.contact-info .card-icon { margin-bottom: 10px; }
.contact-info a { font-weight: 700; }

/* Pagine semplici (privacy, 404) */
.page { max-width: 780px; margin: 0 auto; padding: 48px var(--gutter) 64px; }
.page h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
.page h2 { font-size: 1.3rem; margin-top: 32px; }
.page-note { background: var(--target-bg); border: 1px solid var(--target-border); border-radius: var(--radius-md); padding: 14px 16px; font-size: 0.95rem; }

/* 12. SCHERMI GRANDI ====================================================== */
@media (min-width: 600px) {
    :root { --gutter: 24px; }
    .hero-actions { flex-direction: row; flex-wrap: wrap; }
    .header-login { display: inline; }
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .facts { grid-template-columns: repeat(2, 1fr); column-gap: 32px; }
    .facts div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}
@media (min-width: 900px) {
    .section { padding: 96px 0; }
    .site-nav { display: flex; }
    .hero { padding: 72px 0 88px; }
    .hero-inner { grid-template-columns: 1.15fr 0.85fr; gap: 56px; }
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
    .facts { grid-template-columns: repeat(3, 1fr); }
    .facts div:nth-last-child(-n+3) { border-bottom: 0; }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .feature { grid-template-columns: 1fr 1fr; gap: 64px; padding: 48px 0; }
    .feature--reverse .feature-media { order: -1; }
    .plans { grid-template-columns: repeat(3, 1fr); }
    .about { grid-template-columns: 0.8fr 1.2fr; gap: 48px; }
    .about > .photo-box, .about > .photo { max-width: 360px; }
    .contact { grid-template-columns: 1.3fr 0.7fr; gap: 32px; }
    .footer-inner { grid-template-columns: 1fr auto; align-items: center; }
    .footer-legal { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .phone--hero { transform: none; }
    * { transition: none !important; }
}

/* Tabella di confronto sul telefono: una card per ogni riga, niente scorrimento laterale. */
@media (max-width: 599px) {
    .table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .compare { min-width: 0; }
    .compare thead { display: none; }
    .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
    .compare tr { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
    .compare tbody th { width: 100%; padding: 14px 16px 8px; border-bottom: 0; font-size: 1rem; }
    .compare td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px dashed var(--border); text-align: right; }
    .compare td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); text-align: left; }
    .compare td.is-us::before { color: var(--primary); }
    .compare tr:last-child td { border-bottom: 1px dashed var(--border); }
    .compare tr td:last-child { border-bottom: 0; }
}

/* Prezzi di lancio (giallo come nell'app) */
.plans-launch { max-width: 720px; margin: -8px auto 28px; padding: 14px 18px; text-align: center; background: var(--target-bg); border: 1px solid var(--target-border); border-radius: var(--radius-md); color: var(--text); font-size: 0.975rem; }
.plan-launch-tag { display: inline-block; margin-right: 6px; padding: 2px 10px; border-radius: 999px; background: #A16207; color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 1px; }
