/* Home additions (Come funziona, demo gallery, hero call link) + /demo/<slug> pages + /admin + the Cal.com modal.
   Loaded after v2-light.css: uses its light tokens (--chalk = text, --ink = white, --paper = background). */

/* ---------- home: hero call link ---------- */
.hero-call { display: inline-block; margin: 14px 0 0 18px; vertical-align: middle; color: var(--dim); font-weight: 600; font-size: .95rem; text-underline-offset: 4px; }
.hero-call:hover { color: var(--violet); }
.hero-sub { color: var(--dim); font-size: clamp(1rem, 1.4vw, 1.12rem); margin: 14px 0 4px; max-width: 46ch; }

/* ---------- home: come funziona ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { background: #fff; border-radius: 26px; padding: 30px; display: grid; gap: 10px; align-content: start;
  box-shadow: 0 1px 2px rgba(21, 22, 28, .04), 0 12px 40px rgba(40, 30, 90, .07); }
.steps li::before { counter-increment: s; content: counter(s); width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--violet); color: #fff; font: 800 1.2rem/1 var(--display); }
.steps h3 { font-size: 1.35rem; }
.steps p { color: var(--dim); }
.steps .when { font-family: var(--body); font-size: .8rem; font-weight: 700; color: var(--violet); letter-spacing: .02em; }
.steps-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------- demo cards (home gallery + "altri siti come il tuo") ---------- */
.gtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.gtabs button { font: 600 .95rem/1 var(--body); padding: 12px 18px; border-radius: 999px; border: 1px solid var(--hair-d); background: #fff; color: var(--chalk); cursor: pointer; }
.gtabs button[aria-selected="true"] { background: var(--chalk); color: #fff; border-color: var(--chalk); }
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.dcard { display: grid; grid-template-columns: 1fr auto; text-decoration: none; background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(21, 22, 28, .04), 0 12px 40px rgba(40, 30, 90, .07); transition: transform .25s ease, box-shadow .25s ease; }
button.dcard { font: inherit; color: inherit; text-align: left; border: 0; padding: 0; cursor: pointer; width: 100%; }
.dcard:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(21, 22, 28, .04), 0 22px 60px rgba(40, 30, 90, .14); }
.dshot { grid-column: 1 / -1; aspect-ratio: 8 / 5; overflow: hidden; background: var(--paper-2); }
.dshot { position: relative; }
.dpill { position: absolute; top: 12px; left: 12px; font: 600 .74rem/1 var(--body); font-style: normal; padding: 7px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #15161c; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.dshot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.dcard:hover .dshot img { transform: scale(1.03); }
.dmeta { padding: 16px 0 18px 20px; display: grid; gap: 2px; }
.dmeta b { font: 700 1.08rem/1.2 var(--display); }
.dmeta small { color: var(--dim); font-size: .85rem; }
.dgo { align-self: center; padding-right: 20px; font-weight: 600; font-size: .9rem; color: var(--violet); }
.gallery-note { margin-top: 18px; }

/* ---------- demo page ---------- */
.demo-hero { padding-block: clamp(24px, 3.5vw, 44px) clamp(48px, 7vw, 88px); background: var(--paper); }
/* title left, "open the site" right, then the video at full container width (capped so it fits one screen) */
.demo-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: clamp(20px, 2.6vw, 28px); }
.demo-top .head { margin-bottom: 0; gap: 10px; max-width: none; }
.demo-top h1 { font-size: clamp(2rem, 3.6vw, 3.1rem); }
.demo-top .lede { font-size: 1.05rem; }
.demo-top .demo-actions { flex: none; width: min(100%, 380px); }
.loom { position: relative; aspect-ratio: 16 / 9; width: min(100%, calc((100svh - 96px) * 16 / 9)); margin-inline: auto;
  border-radius: 22px; overflow: hidden; background: #15161c; box-shadow: 0 30px 80px rgba(40, 30, 90, .18); }
.loom iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.demo-actions { display: grid; gap: 8px; }
.btn.big { min-height: 64px; font-size: 1.08rem; padding: 18px 26px; border-radius: 18px; }
/* the Cal.com calendar inline: height follows Cal's __dimensionChanged messages (demo.js) */
.demo-book { scroll-margin-top: 64px; }
.demo-book .head { margin-bottom: clamp(20px, 3vw, 32px); }
.cal-inline { margin-inline: -16px; } /* Cal.com draws its own card; the iframe keeps a 16px gutter inside */
.cal-inline iframe { display: block; width: 100%; height: 600px; border: 0; transition: height .25s ease; }
.demo-book .src { margin-top: 12px; }
.demo-more { background: var(--paper-2); }
.demo-end { text-align: center; }
.demo-end .container { display: grid; justify-items: center; gap: 28px; }
@media (max-width: 860px) {
  .demo-top { flex-direction: column; align-items: stretch; }
  .demo-top .demo-actions { width: 100%; }
  .loom { border-radius: 16px; }
  .cal-inline iframe { height: 820px; }
  .nav .tools .btn { padding: 11px 16px; font-size: .9rem; }
}

/* ---------- code gate + admin login ---------- */
.gate { min-height: calc(100svh - 64px - 140px); display: grid; place-items: center; padding: 48px 16px; background: var(--paper); }
.gate-card { width: min(100%, 480px); background: #fff; border-radius: 28px; padding: clamp(26px, 5vw, 40px); display: grid; gap: 16px;
  box-shadow: 0 1px 2px rgba(21, 22, 28, .04), 0 24px 70px rgba(40, 30, 90, .12); }
.gate-card h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.gate-card .muted { color: var(--dim); }
.gate-field { display: grid; gap: 8px; font-weight: 600; font-size: .9rem; }
.gate-field input { font: 600 1.25rem/1 var(--body); letter-spacing: .12em; padding: 16px 18px; border-radius: 14px; border: 1.5px solid var(--hair-d);
  background: var(--paper); color: var(--chalk); text-transform: uppercase; width: 100%; }
.gate-field input[type="password"] { text-transform: none; letter-spacing: .04em; }
.gate-field input:focus { outline: 0; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(123, 92, 255, .16); }
.gate-card .btn { min-height: 58px; }
.gate-msg { color: var(--leak); font-weight: 600; min-height: 1.4em; }
.gate-msg:empty { display: none; }

/* ---------- admin ---------- */
.admin { padding-block: 40px 80px; display: grid; gap: 20px; }
.admin h2 { font-size: 1.4rem; margin-top: 24px; }
.tbl { overflow-x: auto; background: #fff; border-radius: 18px; box-shadow: 0 12px 40px rgba(40, 30, 90, .07); }
.tbl table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--hair-d); vertical-align: top; white-space: nowrap; }
.tbl th { font-size: .78rem; color: var(--dim); font-weight: 600; }
.tbl td small { display: block; color: var(--dim); font-size: .8rem; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .hot { color: var(--keep); font-weight: 800; }
.tbl tr.never td { color: var(--dim); }
.tbl tr.t-unlock td:nth-child(3), .tbl tr.t-cta td:nth-child(3), .tbl tr.t-booked td:nth-child(3) { font-weight: 700; color: var(--chalk); }
.tbl tr.t-bad_code td:nth-child(3) { color: var(--leak); }

/* ---------- Cal.com modal ---------- */
.cal-modal { width: min(100% - 24px, 1000px); height: min(100svh - 24px, 760px); padding: 0; border: 0; border-radius: 22px; overflow: hidden;
  display: none; flex-direction: column; background: #fff; color: #15161c; box-shadow: 0 40px 120px rgba(0, 0, 0, .35); }
.cal-modal[open] { display: flex; }
.cal-modal::backdrop { background: rgba(15, 14, 30, .55); backdrop-filter: blur(4px); }
.cal-top { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 20px; border-bottom: 1px solid rgba(21, 22, 28, .1); }
.cal-top b { font-family: var(--display); font-size: 1.05rem; }
.cal-new { margin-left: auto; font-size: .85rem; color: #5d6272; }
.cal-x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #f3f0ea; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.cal-modal iframe { flex: 1; width: 100%; border: 0; }
.ex-note { margin-left: auto; font-size: .85rem; color: #5d6272; }
.ex-modal { width: min(100% - 24px, 1180px); height: min(100svh - 24px, 860px); }
@media (max-width: 600px) { .ex-note { display: none; } .cal-new { display: none; } .cal-top b { font-size: .95rem; } }
