/* OrIA — sito. Stessi colori, misure e forme dell'app (Theme/Color+Oria.swift, Metrics.swift).
   Nessun framework. Tema chiaro/scuro dal telefono; data-theme="light|dark" lo forza. */

@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/PlusJakartaSans-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* come l'app, tema chiaro */
  --page: #FFFFFF;
  --surface: #FBF8FC;
  --neutral: #F0EDF1;
  --neutral-2: #E4E1E6;
  --ink: #1B1B1E;
  --soft: #434655;
  --muted: #6E7080;
  --border: #E4E2E8;
  --blue: #2563EB;
  --blue-text: #1D4ED8;
  --blue-soft: #DBE1FF;
  --green: #15803D;
  --red: #B91C1C;
  --amber: #8A6317;

  /* tessere pastello */
  --lilac: #E8E5F8;
  --mint: #DDF3E6;
  --peach: #F6E9E1;
  --peach-ink: #9A5B3A;
  --sky: #E3ECFF;
  --warm: #F2F1EF;
  --rose: #FBE4EA;
  --chip: rgba(255, 255, 255, .7);

  --toast: #1B1B1E;
  --on-toast: #FFFFFF;
  --shadow: 0 1px 2px rgba(27, 27, 30, .05), 0 6px 20px rgba(27, 27, 30, .06);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-card: 26px;
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0F0F12; --surface: #121114; --neutral: #242329; --neutral-2: #38373E;
    --ink: #F3F0F4; --soft: #C3C6D7; --muted: #8E90A0; --border: #2E2D35;
    --blue: #5B8CFF; --blue-text: #8FB0FF; --blue-soft: #1E3170;
    --green: #4ADE80; --red: #F5A3A3; --amber: #F0B24A;
    --lilac: #272143; --mint: #16301F; --peach: #3A2A22; --peach-ink: #E3B394; --sky: #1E2A4A; --warm: #24232A; --rose: #3A2029;
    --chip: rgba(255, 255, 255, .08);
    --toast: #F3F0F4; --on-toast: #1B1B1E;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0F0F12; --surface: #121114; --neutral: #242329; --neutral-2: #38373E;
  --ink: #F3F0F4; --soft: #C3C6D7; --muted: #8E90A0; --border: #2E2D35;
  --blue: #5B8CFF; --blue-text: #8FB0FF; --blue-soft: #1E3170;
  --green: #4ADE80; --red: #F5A3A3; --amber: #F0B24A;
  --lilac: #272143; --mint: #16301F; --peach: #3A2A22; --peach-ink: #E3B394; --sky: #1E2A4A; --warm: #24232A; --rose: #3A2029;
  --chip: rgba(255, 255, 255, .08);
  --toast: #F3F0F4; --on-toast: #1B1B1E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--blue-text); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }
.soft { color: var(--soft); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── testata ──────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.top.scrolled { border-bottom-color: var(--border); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: none; gap: 4px; margin-left: 18px; }
.nav a { color: var(--soft); font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--neutral); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--blue-text); background: var(--blue-soft); }
.top .get { margin-left: 0; }
/* Lingua, nella testata accanto a «Scarica l'app» (anche nel piè di pagina) */
.lang-pick { margin-left: auto; position: relative; display: inline-flex; align-items: center; gap: 4px; color: var(--soft); background: var(--neutral); border-radius: 999px; padding: 0 8px 0 9px; height: 34px; cursor: pointer; }
.lang-pick:hover { color: var(--ink); }
.lang-pick select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13.5px; font-weight: 800; letter-spacing: .02em; padding: 0 2px; cursor: pointer; outline: none; }
.lang-pick:focus-within { box-shadow: 0 0 0 2px var(--blue); }

/* ── barra in basso, come l'app (solo telefono) ───────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: space-around; align-items: center;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 6px 0;
}
.tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--blue); }
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

@media (min-width: 820px) {
  .nav { display: flex; }
  .tabbar { display: none; }
  body.has-tabbar { padding-bottom: 0; }
}

/* dentro l'app: niente barre del sito */
html.in-app .top, html.in-app .tabbar, html.in-app .foot, html.in-app .stores, html.in-app .only-web { display: none !important; }
html.in-app body.has-tabbar { padding-bottom: 24px; }

/* ── pulsanti ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: 14.5px; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--neutral); color: var(--ink); }
.btn.line { background: transparent; color: var(--blue-text); box-shadow: inset 0 0 0 1.5px var(--blue); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.link { background: none; border: 0; padding: 0; color: var(--blue-text); font-weight: 800; }

.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px 0 14px;
  border-radius: 14px; background: var(--ink); color: var(--page);
}
.store:hover { text-decoration: none; }
.store svg { width: 24px; height: 24px; flex: none; }
.store small { display: block; font-size: 11px; font-weight: 600; opacity: .75; line-height: 1.1; }
.store b { display: block; font-size: 16px; line-height: 1.15; }
.store.soon { background: var(--neutral); color: var(--soft); }

/* ── selettore a segmenti (OriaSegmented) ─────────────────────────────── */
.seg { display: flex; background: var(--neutral); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 9px; min-height: 38px; padding: 0 10px;
  font-weight: 700; font-size: 14.5px; color: var(--soft); white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--page); color: var(--blue-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* ── titoli di sezione ────────────────────────────────────────────────── */
.sech { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 12px; }
.sec { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ── card e tessere ───────────────────────────────────────────────────── */
.card { background: var(--lilac); border-radius: var(--r-card); padding: 18px; }
.card.white { background: var(--page); box-shadow: inset 0 0 0 1px var(--border); }
.card.mint { background: var(--mint); }
.card.peach { background: var(--peach); }
.card.sky { background: var(--sky); }
.card.warm { background: var(--warm); }
.card.rose { background: var(--rose); }
.card .k { font-size: 15px; color: var(--soft); font-weight: 600; }
.card .big { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin-top: 2px; }

.petal { width: 44px; height: 44px; border-radius: 13px; background: var(--page); display: grid; place-items: center; flex: none; }
.petal img { width: 30px; height: 30px; }
.petal.sm { width: 34px; height: 34px; border-radius: 10px; }
.petal.sm img { width: 23px; height: 23px; }
.petal.round { border-radius: 50%; }

.bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: var(--neutral-2); gap: 2px; margin-top: 14px; }
.bar i { display: block; height: 100%; }

.tiles3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.mini { background: var(--chip); border-radius: 14px; padding: 8px 10px; min-width: 0; }
.mini .l { font-size: 12px; color: var(--soft); font-weight: 700; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.mini .l i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.mini b { display: block; font-size: 16px; font-weight: 800; margin-top: 2px; white-space: nowrap; }

/* card evento B1: ora a sinistra nel colore della categoria */
.ev { display: flex; align-items: center; gap: 12px; background: var(--page); border-radius: 18px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--border); }
.ev .h { font-size: 17px; font-weight: 800; width: 50px; flex: none; }
.ev .t { font-weight: 800; font-size: 15.5px; line-height: 1.2; }
.ev .s { font-size: 13px; color: var(--soft); }
.ev .go { margin-left: auto; }
.dayh { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 8px; }

/* righe persona */
.who { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.who + .who { border-top: 1px solid rgba(0, 0, 0, .06); }
.face { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.who .n { font-weight: 800; font-size: 15px; line-height: 1.2; }
.who .g { font-size: 12.5px; color: var(--soft); }
.who .a { margin-left: auto; font-weight: 800; white-space: nowrap; }
.pos { color: var(--green); } .neg { color: var(--red); }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.pill.new { background: var(--neutral); color: var(--soft); }
.pill.planned { background: var(--sky); color: var(--blue-text); }
.pill.doing { background: #FFF1D6; color: var(--amber); }
.pill.done { background: var(--mint); color: var(--green); }
.pill.answered { background: var(--mint); color: var(--green); }
.pill.closed { background: var(--neutral); color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.doing { background: #3A2E14; } }
:root[data-theme="dark"] .pill.doing { background: #3A2E14; }

/* righe che si aprono sul posto (come il Profilo) */
.group { background: var(--surface); border-radius: var(--r-xl); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: 0; text-align: left; color: var(--ink); }
.row + .row, .row + .rowbody + .row, .acc + .acc { border-top: 1px solid var(--border); }
.row .t { font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.row .s { font-size: 13.5px; color: var(--soft); font-weight: 500; }
.row .chev { margin-left: auto; color: var(--muted); flex: none; transition: transform .2s; }
.acc[open] .chev { transform: rotate(180deg); }
.acc[open] > summary .t { color: var(--blue-text); }
.acc > summary { list-style: none; cursor: pointer; }
.acc > summary::-webkit-details-marker { display: none; }
.acc .body { padding: 0 16px 16px 16px; color: var(--soft); font-size: 15px; }
.acc .body p + p { margin-top: 8px; }

/* vuoto: illustrazione e un'azione (OriaEmptyState) */
.empty { text-align: center; padding: 36px 16px; }
.empty .petal { width: 72px; height: 72px; border-radius: 50%; background: var(--lilac); margin: 0 auto 14px; }
.empty .petal img { width: 44px; height: 44px; }
.empty h3 { font-size: 19px; }
.empty p { color: var(--soft); margin: 6px auto 16px; max-width: 320px; }

/* campi */
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--soft); margin: 0 0 6px 2px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--neutral); border: 1.5px solid transparent; font-size: 16px; outline: none;
}
.input:focus { border-color: var(--blue); background: var(--page); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.45; }

/* avviso scuro con Annulla */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--toast); color: var(--on-toast); border-radius: 14px; padding: 12px 16px; z-index: 50;
  display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; width: max-content; max-width: calc(100% - 32px);
}
html.in-app .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--blue-soft); font-weight: 800; padding: 0; }
@media (min-width: 820px) { .toast { bottom: 24px; } }

/* foglio dal basso (telefono) / finestra (computer) */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet-bg.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--page);
  border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .25s ease; max-height: 92vh; overflow: auto;
}
.sheet.on { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--neutral-2); margin: 0 auto 12px; }
@media (min-width: 820px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; border-radius: 24px; transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; padding: 20px 24px 24px; }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .sheet .grab { display: none; }
}

/* piè di pagina */
.foot { border-top: 1px solid var(--border); margin-top: 56px; padding: 24px 0 32px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot a { color: var(--soft); font-weight: 600; }
.foot .theme { margin-left: auto; }
.foot .langs { display: inline-flex; gap: 2px; }
.foot .langs button { padding: 2px 6px; border-radius: 6px; font-weight: 700; color: var(--muted); }
.foot .langs button[aria-current] { color: var(--ink); background: var(--neutral); }

/* testata delle pagine interne */
.phead { padding: 22px 0 18px; }
.phead h1 { font-size: 30px; }
.phead p { color: var(--soft); margin-top: 6px; font-size: 16px; }
@media (min-width: 820px) { .phead { padding: 40px 0 24px; } .phead h1 { font-size: 40px; } }

/* ── Lingue e telefoni (js/lingua.js mette lang e data-os su <html>) ── */
html[lang="it"] body [lang="en"], html[lang="it"] body [lang="es"],
html[lang="en"] body [lang="it"], html[lang="en"] body [lang="es"],
html[lang="es"] body [lang="it"], html[lang="es"] body [lang="en"] { display: none !important; }
html:not([data-os="ios"]) .os-ios, html:not([data-os="android"]) .os-android, html:not([data-os="altro"]) .os-altro,
html[data-os="android"] .no-android, html[data-os="ios"] .no-ios { display: none !important; }

