/* Guida pubblica (guide.php): stessi colori della home, pagina leggera senza il tema del sito */
:root {
    --g-ink: #1e1b4b;
    --g-text: #3f3d56;
    --g-muted: #6b7280;
    --g-line: #e6e8f5;
    --g-soft: #f5f6ff;
    --g-primary: #6d28d9;
    --g-primary-2: #4f46e5;
    --g-tip: #ecfdf5;
    --g-tip-line: #a7f3d0;
    --g-warn: #fff7ed;
    --g-warn-line: #fed7aa;
    --g-radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: #fff; color: var(--g-text); font: 16px/1.65 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--g-primary-2); }
h1, h2, h3 { color: var(--g-ink); line-height: 1.25; }

/* barra in alto */
.g-top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--g-line); }
.g-top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.g-brand { display: flex; align-items: center; gap: 8px; color: var(--g-ink); font-weight: 800; text-decoration: none; }
.g-top-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.g-lang { font-weight: 700; color: var(--g-muted); text-decoration: none; padding: 6px 8px; }
.g-btn, .g-btn-ghost { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: .92rem; text-decoration: none; white-space: nowrap; }
.g-btn { background: linear-gradient(90deg, #7c3aed, var(--g-primary-2)); color: #fff; }
.g-btn-ghost { background: var(--g-soft); color: var(--g-ink); border: 1px solid var(--g-line); }

/* testata con ricerca e scorciatoie */
.g-hero { background: linear-gradient(120deg, #3b2a8f 0%, #6d28d9 55%, #9333ea 100%); color: #fff; }
.g-hero-in { max-width: 1180px; margin: 0 auto; padding: 40px 16px 28px; }
.g-hero h1 { color: #fff; margin: 0 0 8px; font-size: 2.1rem; }
.g-hero p { margin: 0 0 18px; max-width: 720px; color: rgba(255, 255, 255, .88); }
.g-search input { width: 100%; max-width: 560px; padding: 12px 16px; border: 0; border-radius: 12px; font: inherit; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5); }
.g-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.g-quick-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--g-radius); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff; text-decoration: none; }
.g-quick-card:hover { background: rgba(255, 255, 255, .2); }
.g-quick-card b { font-size: 1rem; }
.g-quick-card span:last-child { font-size: .85rem; color: rgba(255, 255, 255, .8); line-height: 1.4; }
.g-quick-ico { font-size: 1.4rem; }

/* indice + contenuto */
.g-wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; display: grid; grid-template-columns: 260px 1fr; gap: 36px; }
.g-toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow: auto; }
.g-toc-toggle { display: none; }
.g-toc ol { list-style: none; margin: 0; padding: 0; }
.g-toc a { display: flex; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--g-text); text-decoration: none; font-size: .92rem; line-height: 1.35; }
.g-toc a:hover { background: var(--g-soft); }
.g-toc a.on { background: #ede9fe; color: var(--g-primary); font-weight: 700; }
.g-main { min-width: 0; max-width: 780px; }
.g-sec { padding: 8px 0 26px; border-bottom: 1px solid var(--g-line); margin-bottom: 18px; }
.g-sec h2 { font-size: 1.5rem; margin: 10px 0 12px; display: flex; align-items: center; gap: 10px; }
.g-sec h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.g-sec-ico { font-size: 1.4rem; }
.g-anchor { margin-left: auto; color: #c4c7dd; text-decoration: none; font-size: 1rem; }
.g-sec p, .g-sec li { max-width: 72ch; }
.g-sec code { background: var(--g-soft); border: 1px solid var(--g-line); border-radius: 6px; padding: 1px 6px; font-size: .9em; overflow-wrap: anywhere; }

/* passi numerati */
.g-steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0; }
.g-steps > li { counter-increment: s; position: relative; padding: 2px 0 12px 44px; }
.g-steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: #ede9fe; color: var(--g-primary); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.g-steps > li b:first-child { color: var(--g-ink); }

/* riquadri */
.g-tip, .g-note { padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-size: .95rem; }
.g-tip { background: var(--g-tip); border: 1px solid var(--g-tip-line); }
.g-note { background: var(--g-warn); border: 1px solid var(--g-warn-line); }
.g-cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
/* pulsanti diretti sotto il titolo di ogni sezione */
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.g-actions .g-btn, .g-actions .g-btn-ghost { padding: 9px 14px; }
.g-btn:hover { filter: brightness(1.08); }
.g-btn-ghost:hover { background: #ede9fe; border-color: #ddd6fe; }
.g-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .93rem; }
.g-table th, .g-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--g-line); vertical-align: top; }
.g-table th { color: var(--g-ink); background: var(--g-soft); }
.g-faq details { border: 1px solid var(--g-line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.g-faq summary { cursor: pointer; font-weight: 700; color: var(--g-ink); }

.g-empty { padding: 16px; background: var(--g-soft); border-radius: 12px; }
.g-help { padding: 22px; border-radius: var(--g-radius); background: var(--g-soft); border: 1px solid var(--g-line); }
.g-help h2 { margin: 0 0 6px; font-size: 1.3rem; }
.g-help-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.g-foot { text-align: center; padding: 26px 16px 36px; color: var(--g-muted); font-size: .9rem; border-top: 1px solid var(--g-line); }
.g-foot a { color: var(--g-muted); }

/* telefono: indice a tendina sopra il testo, scorciatoie su due colonne */
@media (max-width: 900px) {
    .g-wrap { grid-template-columns: 1fr; gap: 12px; padding-top: 14px; }
    .g-toc { position: static; max-height: none; border: 1px solid var(--g-line); border-radius: 12px; }
    .g-toc-toggle { display: flex; width: 100%; justify-content: space-between; padding: 12px 14px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--g-ink); }
    .g-toc ol { display: none; padding: 0 6px 8px; }
    .g-toc.open ol { display: block; }
    .g-quick { grid-template-columns: 1fr 1fr; }
    .g-hero h1 { font-size: 1.6rem; }
    .g-brand span { display: none; }
    /* tabelle larghe (piani): scorrono di lato invece di allargare la pagina */
    .g-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .g-table th, .g-table td { white-space: nowrap; }
    .g-table td:last-child { white-space: normal; min-width: 180px; }
}

/* percorso a passaggi con i pulsanti dentro (guide.php: $step, $btn, $go, $cards) */
.g-flow { margin: 18px 0 8px; }
.g-step { display: grid; grid-template-columns: 38px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.g-step:not(:last-child)::before { content: ""; position: absolute; left: 18px; top: 42px; bottom: 4px; width: 2px; background: #ede9fe; border-radius: 2px; }
.g-step-n { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #7c3aed, var(--g-primary-2)); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px -6px rgba(109, 40, 217, .6); }
.g-step-body { min-width: 0; padding-top: 4px; }
.g-step-body h4 { margin: 0 0 6px; font-size: 1.08rem; color: var(--g-ink); }
.g-step-body p { margin: 0 0 10px; }
.g-step-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.g-step-body .g-note, .g-step-body .g-tip { margin: 8px 0; }
.g-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.g-card { border: 1px solid var(--g-line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.g-card b { display: block; color: var(--g-ink); margin-bottom: 3px; }
.g-card span { display: block; font-size: .9rem; color: var(--g-muted); line-height: 1.45; }
.g-card.is-rec { border-color: #c4b5fd; background: #faf5ff; }
.g-go { font-weight: 700; color: var(--g-primary); text-decoration: none; white-space: nowrap; }
.g-go:hover { text-decoration: underline; }
.g-lead { font-size: 1.05rem; color: var(--g-ink); }

/* "Avanti: <sezione dopo>" in fondo a ogni sezione */
.g-next { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: var(--g-soft); border: 1px solid var(--g-line); color: var(--g-ink); font-weight: 700; text-decoration: none; }
.g-next:hover { background: #ede9fe; border-color: #ddd6fe; }
.g-next span { margin-left: auto; color: var(--g-primary); }
