@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500&family=Manrope:wght@400;500;600;700&display=swap");

/* ===== Colori del brand: modifica qui per adattarli a Focus Training Lab ===== */
:root {
  --bg: #0e0e0d;
  --bg-2: #161614;
  --surface: #1b1b19;
  --line: #2c2b28;
  --text: #f2eee6;
  --muted: #9b968c;
  --accent: #c8a46a;        /* oro caldo */
  --accent-ink: #17140e;
  --ok: #8fb58a;
  --danger: #d9826f;
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans); color: var(--text); background: var(--bg);
  line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.display { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; }
.display-sm { font-size: clamp(1.7rem, 3.5vw, 2.4rem); line-height: 1.1; }
.stack > * + * { margin-top: 1rem; }

/* ===== Accesso / form ===== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side {
  position: relative; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(120% 80% at 0% 100%, rgba(200,164,106,.18), transparent 60%),
    linear-gradient(160deg, #1a1916 0%, #0e0e0d 70%);
  border-right: 1px solid var(--line); overflow: hidden;
}
.auth-side::after {
  content: "12"; position: absolute; right: -20px; bottom: -70px; font-family: var(--serif);
  font-size: 340px; line-height: 1; color: rgba(242,238,230,.035); pointer-events: none;
}
.auth-side .quote { max-width: 30ch; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; }
.auth-main .card { width: 100%; max-width: 430px; background: transparent; border: 0; padding: 0; }
.narrow { max-width: 460px; margin: 0 auto; }

label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; }
input {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit; transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--accent); }
.field + .field { margin-top: 16px; }
.hint { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: 600 0.92rem var(--sans);
  cursor: pointer; transition: transform .1s, opacity .15s, background .15s; text-decoration: none !important;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.sm { padding: 8px 14px; font-size: 0.8rem; }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(217,130,111,.4); }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.link:hover { color: var(--text); }
.alert { padding: 12px 14px; border-radius: 10px; font-size: 0.88rem; margin-top: 16px; display: none; }
.alert.show { display: block; }
.alert.err { background: rgba(217,130,111,.1); color: var(--danger); border: 1px solid rgba(217,130,111,.25); }
.alert.ok { background: rgba(143,181,138,.1); color: var(--ok); border: 1px solid rgba(143,181,138,.25); }

/* ===== Barra superiore ===== */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 4vw, 48px); background: rgba(14,14,13,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none !important; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent); font-family: var(--serif); font-size: 1.1rem;
}
.brand strong { display: block; font-size: 0.9rem; font-weight: 600; letter-spacing: .02em; }
.brand small { display: block; font-size: 0.72rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.topbar nav { display: flex; align-items: center; gap: 26px; font-size: 0.88rem; }
.topbar nav a { color: var(--muted); }
.topbar nav a.on, .topbar nav a:hover { color: var(--text); text-decoration: none; }

.page { max-width: 1180px; margin: 0 auto; padding: 48px clamp(20px, 4vw, 48px) 96px; }

/* ===== Area cliente ===== */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; margin-bottom: 48px; }
.progress-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.progress-num { font-family: var(--serif); font-size: 2.6rem; line-height: 1; }
.progress-num span { font-size: 1.1rem; color: var(--muted); }
.bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 16px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.block-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 210px;
  padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none !important; transition: border-color .2s, transform .2s;
}
a.block-card:hover { border-color: rgba(200,164,106,.55); transform: translateY(-2px); }
.block-card .num { font-family: var(--serif); font-size: 3rem; line-height: .9; color: var(--accent); font-weight: 300; }
.block-card h3 { font-size: 1.3rem; }
.block-card .sub { color: var(--muted); font-size: 0.86rem; }
.block-card .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 0.76rem; color: var(--muted); letter-spacing: .04em; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; border: 1px solid var(--line); }
.pill.done { color: var(--ok); border-color: rgba(143,181,138,.35); }
.pill.lock { color: var(--muted); }
.pill.new { color: var(--accent); border-color: rgba(200,164,106,.4); }
.block-card.locked { background: transparent; border-style: dashed; }
.block-card.locked .num, .block-card.locked h3, .block-card.locked .sub { opacity: .55; }
.block-card.locked .num { color: var(--muted); }
.pill.buy { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); text-decoration: none !important; }
.pill.buy:hover { opacity: .9; }
.section-title { font-size: 1.5rem; margin: 0 0 18px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 56px 0 18px; }
.section-head .section-title { margin: 0; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; background: rgba(255,255,255,.03); border: 1px solid var(--line); padding: 4px; border-radius: 999px; cursor: pointer; font: 700 .9rem var(--sans); letter-spacing: .1em; }
.lang-switch span { padding: 8px 14px; border-radius: 999px; color: var(--muted); transition: background .2s, color .2s; }
.lang-switch span.on { background: var(--accent); color: var(--accent-ink); }
.lang-switch:hover span:not(.on) { color: var(--text); }
.lang-switch.floating { position: fixed; top: 18px; right: 18px; z-index: 20; background: rgba(14,14,13,.8); backdrop-filter: blur(8px); }
.bundle { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 26px 28px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid rgba(200,164,106,.45); background: linear-gradient(120deg, rgba(200,164,106,.14), rgba(200,164,106,.03)); }
@media (max-width: 860px) { .bundle { grid-template-columns: 1fr; } }
.chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: grid; place-items: center; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); font-family: var(--serif); font-size: 1.1rem; color: var(--muted); transition: all .15s; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips-all { margin-top: 10px; font-size: .82rem; }

.studio-cta {
  margin-top: 56px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 36px; border-radius: var(--radius); border: 1px solid rgba(200,164,106,.3);
  background: linear-gradient(120deg, rgba(200,164,106,.10), rgba(200,164,106,.02));
}

/* ===== Pagina blocco ===== */
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 24px; }
.crumbs a { color: var(--muted); }
.block-head { display: flex; align-items: flex-end; gap: 28px; margin-bottom: 32px; }
.block-head .big { font-family: var(--serif); font-size: clamp(5rem, 10vw, 8rem); line-height: .8; color: var(--accent); font-weight: 300; }
.block-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 28px; align-items: start; }
.video {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden;
  background: #000 radial-gradient(circle at 50% 50%, #1d1c19, #080807); border: 1px solid var(--line);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.play { width: 68px; height: 68px; border-radius: 50%; border: 1px solid var(--accent); display: grid; place-items: center; margin: 0 auto 14px; }
.play::after { content: ""; border-left: 16px solid var(--accent); border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 5px; }
.side .card { padding: 26px; }
.side .card + .card { margin-top: 16px; }
.pdf-icon { width: 44px; height: 54px; border: 1px solid var(--line); border-radius: 6px; display: grid; place-items: end center; padding-bottom: 8px; font-size: .62rem; font-weight: 700; color: var(--accent); letter-spacing: .1em; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.pager { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }

/* ===== Gestione (admin) ===== */
.tabs { display: flex; gap: 6px; margin: 28px 0 20px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; color: var(--muted); font: 600 0.9rem var(--sans); padding: 12px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.tabs .count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 7px; font-size: .7rem; margin-left: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th { text-align: left; font-weight: 600; font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; background: var(--bg-2); }
td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
td .actions { display: flex; gap: 8px; justify-content: flex-end; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .84rem; }
.flag { color: var(--danger); font-weight: 700; }
.empty { padding: 48px; text-align: center; color: var(--muted); }
.copy { cursor: pointer; border-bottom: 1px dashed var(--muted); }

/* ===== Varie ===== */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  transition: all .25s; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #1a0d0a; }
.demo-banner { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: .78rem; font-weight: 600; padding: 7px 12px; }
.skeleton { background: linear-gradient(90deg, var(--surface), #23221f, var(--surface)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 210px; }
@keyframes sk { to { background-position: -200% 0; } }
footer.foot { text-align: center; font-size: .78rem; color: var(--muted); padding: 32px 20px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 24px; min-height: auto; gap: 40px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-side::after { font-size: 200px; bottom: -40px; }
  .hero, .block-layout, .studio-cta { grid-template-columns: 1fr; }
  .topbar nav { gap: 16px; }
  .topbar .brand span:not(.brand-mark) { display: none; }
  .topbar nav a, .topbar nav button { white-space: nowrap; }
  .block-head { gap: 18px; }
}
footer.foot .etsy-notice { margin-top: 8px; font-size: .72rem; opacity: .75; }
footer.foot .etsy-notice:first-child { margin-top: 0; }
/* Spazio sotto il piè di pagina: il badge "Powered by Netlify" (fisso in basso a destra) non copre la frase Etsy */
footer.foot { padding-bottom: 88px; }
