/* ============================================================
   style.css — Noleggio Gommoni
   Stile moderno "Soft UI Evolution": profondità morbida,
   tipografia Sora + DM Sans, accento acqua, micro-interazioni.
   ============================================================ */
:root {
  /* Tipografia */
  --font-head: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Colore */
  --navy-900: #0b2440;
  --navy-800: #0f2c4d;
  --navy-700: #143a63;
  --primary:  #1763a6;
  --primary-d:#114c80;
  --accent:   #12b5a6;
  --accent-d: #0e9c8f;

  --ink:    #122338;
  --ink-2:  #33445c;
  --muted:  #5d6c80;
  --line:   #e6ecf3;
  --line-2: #eff3f8;

  --green: #0f9d6b; --green-bg: #e7f6ef; --green-ink: #0a6e4b;
  --amber: #c9810c; --amber-bg: #fdf3e0; --amber-ink: #8a5a12;
  --red:   #d6453a; --red-bg: #fcebe9;   --red-ink: #9b2a22;

  --free-bg: #e7f6ef;  --free-bd: #c2e7d5;
  --busy-bg: #fcebe9;  --busy-bd: #f2cfca;
  --pend-bg: #fdf3e0;  --pend-bd: #f3ddb2;
  --block-bg:#eef2f7;  --block-bd:#d8e0ea;

  --surface: #ffffff;

  /* Ombre morbide stratificate */
  --shadow-sm: 0 1px 2px rgba(13, 35, 58, .06);
  --shadow:    0 6px 16px -6px rgba(13, 35, 58, .12), 0 2px 6px -2px rgba(13, 35, 58, .06);
  --shadow-md: 0 14px 30px -10px rgba(13, 35, 58, .18), 0 4px 10px -4px rgba(13, 35, 58, .08);
  --shadow-lg: 0 30px 60px -18px rgba(13, 35, 58, .30);
  --shadow-primary: 0 10px 22px -8px rgba(23, 99, 166, .55);
  --shadow-accent: 0 10px 22px -8px rgba(18, 181, 166, .5);

  --r-lg: 22px; --r: 16px; --r-sm: 11px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 88% -8%, rgba(18, 181, 166, .10), transparent 60%),
    radial-gradient(1000px 600px at -5% 0%, rgba(23, 99, 166, .10), transparent 55%),
    linear-gradient(180deg, #f4f8fc 0%, #eef3f9 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.02em; }
a { color: var(--primary); }
::selection { background: rgba(18, 181, 166, .25); }
hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(120deg, var(--navy-900) 0%, var(--navy-700) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), var(--shadow);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: #fff; text-decoration: none; font-family: var(--font-head);
  font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none; position: relative;
  background: linear-gradient(150deg, var(--accent) 0%, var(--primary) 100%);
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark::before {
  content: ""; position: absolute; left: 50%; top: 7px; transform: translateX(-50%);
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 15px solid #fff;
  opacity: .95;
}
.brand-mark::after {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: 8px; height: 2.5px; border-radius: 2px;
  background: rgba(255, 255, 255, .85);
}
.topbar nav { display: flex; gap: 6px; }
.topbar nav a {
  color: #c5d4e4; text-decoration: none; font-size: .9rem; font-weight: 600;
  padding: 8px 15px; border-radius: 10px; transition: background .2s, color .2s, box-shadow .2s;
}
.topbar nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.topbar nav a.active {
  color: #fff; background: linear-gradient(120deg, var(--primary), var(--primary-d));
  box-shadow: var(--shadow-primary);
}

.demo-bar {
  background: linear-gradient(90deg, #fff6e3, #fdf0d6); border-bottom: 1px solid #f0dcb2; color: #8a5a12;
  font-size: .82rem; text-align: center; padding: 9px 16px;
}
.demo-bar code { background: rgba(0, 0, 0, .07); padding: 1px 6px; border-radius: 5px; font-size: .92em; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 26px 22px 72px; }
.hero { text-align: center; padding: 30px 0 10px; }
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem); margin: 0 0 12px; font-weight: 800; line-height: 1.08;
  background: linear-gradient(120deg, var(--navy-900), var(--primary) 70%, var(--accent-d));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); max-width: 580px; margin: 0 auto; font-size: 1.05rem; }

.grid { display: grid; gap: 20px; }
.mt { margin-top: 20px; } .mb { margin-bottom: 14px; } .mt-sm { margin-top: 12px; }
.center { text-align: center; }
@media (min-width: 800px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 22px; transition: box-shadow .25s, transform .25s;
}
.card h2 { margin: 0 0 16px; font-size: 1.18rem; font-weight: 700; color: var(--navy-800); }
.card h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); font-size: .9rem; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; font-family: var(--font-body);
  padding: 11px 19px; border-radius: 12px; line-height: 1.1; text-decoration: none;
  background: linear-gradient(120deg, var(--primary), var(--primary-d)); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .2s, background .2s, border-color .2s, opacity .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-primary); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(23, 99, 166, .35); }
.btn.full { width: 100%; }
.btn.sm { padding: 8px 13px; font-size: .85rem; border-radius: 10px; }
.btn.ghost { background: #fff; color: var(--primary); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--line-2); box-shadow: var(--shadow); }
.btn.green { background: linear-gradient(120deg, #16ad77, var(--green)); }
.btn.green:hover { box-shadow: 0 10px 22px -8px rgba(15, 157, 107, .55); }
.btn.amber { background: linear-gradient(120deg, #e3970f, var(--amber)); }
.btn.amber:hover { box-shadow: 0 10px 22px -8px rgba(201, 129, 12, .5); }
.btn.red { background: linear-gradient(120deg, #e2554a, var(--red)); }
.btn.red:hover { box-shadow: 0 10px 22px -8px rgba(214, 69, 58, .5); }
.btn.red.ghost { background: #fff; color: var(--red); border-color: var(--busy-bd); }
.btn.red.ghost:hover { background: var(--busy-bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }

/* ---------- Form ---------- */
.field { margin-bottom: 15px; }
.field > label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 7px; color: var(--ink-2); }
label.inline { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: .92rem; cursor: pointer; }
label.inline input { width: auto; accent-color: var(--primary); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-family: var(--font-body); background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: #9aa7b6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23, 99, 166, .12);
}
.color-in { height: 46px; padding: 4px; cursor: pointer; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

/* Selettore modalità prezzo */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice.single { grid-template-columns: 1fr; }
.choice label {
  border: 1.5px solid var(--line); border-radius: var(--r); padding: 15px; cursor: pointer;
  text-align: center; display: flex; flex-direction: column; gap: 3px; background: #fff;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .18s;
}
.choice label:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label.active {
  border-color: var(--primary);
  background: linear-gradient(160deg, #f1f7fd, #eef9f7);
  box-shadow: 0 0 0 3px rgba(23, 99, 166, .14), var(--shadow);
}
.choice .ttl { font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.choice .price { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.choice .muted { font-size: .78rem; }

/* ---------- Calendario ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head .title { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--navy-800); }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  height: 36px; min-width: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font: inherit; font-size: .88rem; color: var(--primary); font-weight: 600;
  box-shadow: var(--shadow-sm); transition: background .2s, transform .15s, box-shadow .2s;
}
.cal-nav button:hover { background: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1; border: 1.5px solid var(--line); border-radius: 13px; background: #fff;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 500; padding: 2px; transition: border-color .15s, box-shadow .18s, transform .15s, background .15s;
}
.cal-cell.empty { border: none; background: transparent; cursor: default; }
.cal-cell.past { opacity: .38; cursor: not-allowed; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell:not(.empty):not(.past):not(.selected):hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.cal-cell.free { background: var(--free-bg); border-color: var(--free-bd); }
.cal-cell.full { background: var(--busy-bg); border-color: var(--busy-bd); }
.cal-cell.partial { background: var(--pend-bg); border-color: var(--pend-bd); }
.cal-cell.blocked { background: var(--block-bg); border-color: var(--block-bd); }
/* selected per ultimo: vince su free/full/partial/blocked (stessa specificità) */
.cal-cell.selected {
  background: linear-gradient(150deg, var(--primary), var(--primary-d)); color: #fff; border-color: transparent;
  box-shadow: var(--shadow-primary); transform: translateY(-1px);
}
.cal-cell .dots { display: flex; gap: 3px; margin-top: 3px; height: 6px; }
.cal-cell .dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-conf { background: var(--red); } .dot-pend { background: var(--amber); }

.legend { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sq { width: 14px; height: 14px; border-radius: 5px; display: inline-block; border: 1.5px solid; }
.sq-free { background: var(--free-bg); border-color: var(--free-bd); }
.sq-busy { background: var(--busy-bg); border-color: var(--busy-bd); }
.sq-pending { background: var(--pend-bg); border-color: var(--pend-bd); }
.sq-block { background: var(--block-bg); border-color: var(--block-bd); }

/* ---------- Chip / stato ---------- */
.chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; letter-spacing: .01em; }
.chip.pending { background: var(--pend-bg); color: var(--amber-ink); }
.chip.confirmed { background: var(--free-bg); color: var(--green-ink); }
.chip.cancelled { background: var(--busy-bg); color: var(--red-ink); }
.badge-inline { margin-left: 7px; font-size: .68rem; padding: 2px 8px; }

/* ---------- Liste prenotazioni ---------- */
.booking {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 11px; background: #fff;
  transition: box-shadow .2s, transform .2s;
}
.booking:hover { box-shadow: var(--shadow); }
.booking .info { min-width: 0; }
.booking .info strong { display: block; font-size: .97rem; font-weight: 700; }
.booking .actions { display: flex; gap: 7px; flex-shrink: 0; flex-wrap: wrap; align-items: center; }
.boat-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(0, 0, 0, .04); }
@media (max-width: 600px) {
  .booking { flex-direction: column; align-items: stretch; }
  .booking .actions { justify-content: flex-start; }
}

/* ---------- Statistiche ---------- */
.stat { text-align: center; padding: 22px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--primary)); opacity: .9; }
.stat .num { font-family: var(--font-head); font-size: 2.1rem; font-weight: 800; color: var(--navy-800); line-height: 1; letter-spacing: -.03em; }
.stat .lbl { color: var(--muted); font-size: .85rem; margin-top: 9px; font-weight: 500; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 66px; align-items: center; gap: 12px; font-size: .85rem; }
.bar-track { background: var(--line); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--primary)); min-width: 3px; transition: width .6s cubic-bezier(.2,.7,.3,1); }
.bar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Admin head / tabs ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 5px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.admin-tabs .tab {
  border: none; background: transparent; cursor: pointer; font: inherit; font-family: var(--font-body); font-weight: 600; font-size: .88rem;
  color: var(--muted); padding: 9px 15px; border-radius: 10px; display: inline-flex; align-items: center; transition: background .2s, color .2s, box-shadow .2s;
}
.admin-tabs .tab:hover { color: var(--ink); background: var(--line-2); }
.admin-tabs .tab.active { background: linear-gradient(120deg, var(--primary), var(--primary-d)); color: #fff; box-shadow: var(--shadow-primary); }

/* ---------- Gommoni ---------- */
.boat-card { border-left: 4px solid var(--primary); box-shadow: var(--shadow-sm); }
.boat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- Modale ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 36, 64, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 18px; z-index: 100; }
.modal-bg.open { display: flex; animation: fade .2s ease; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 470px; padding: 26px; max-height: 90vh; overflow: auto; animation: pop .22s cubic-bezier(.2,.7,.3,1); }
.modal h3 { margin-top: 0; color: var(--navy-800); }
.modal .close { float: right; background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); transition: color .2s; }
.modal .close:hover { color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: linear-gradient(120deg, var(--navy-800), var(--navy-700)); color: #fff; padding: 13px 22px; border-radius: 13px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .3s cubic-bezier(.2,.7,.3,1); z-index: 200; font-size: .9rem; font-weight: 500; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Gate login ---------- */
.gate { max-width: 400px; margin: 56px auto; }
.gate h2 { color: var(--navy-800); }
.login-err {
  margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--red-bg); color: var(--red-ink); font-size: .85rem; font-weight: 600;
  border: 1px solid var(--busy-bd);
}

/* ---------- Badge tipo gommone ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; letter-spacing: .01em; line-height: 1.2;
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.tag-skipper { background: rgba(23, 99, 166, .1); color: var(--primary-d); }
.tag-skipper::before { background: var(--primary); }
.tag-nolicense { background: rgba(18, 181, 166, .12); color: var(--accent-d); }
.tag-nolicense::before { background: var(--accent); }

/* scala tariffe a persona sotto i prezzi */
.scala { margin: 8px 2px 0; font-size: .82rem; }

/* editor scaglioni prezzo a persona */
.tier-lbl { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 8px; color: var(--ink-2); }
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; margin-bottom: 15px; }
.tier { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 8px; background: #fff; }
.tier span { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.tier input { width: 100%; border: none; padding: 4px 2px; font: inherit; font-weight: 700; color: var(--primary); background: transparent; }
.tier input:focus { outline: none; box-shadow: none; }

/* prezzo speciale per data */
.cal-cell.has-price::after {
  content: "€"; position: absolute; top: 2px; left: 6px; font-size: .64rem; font-weight: 800; color: var(--accent-d); line-height: 1;
}
.cal-cell.selected.has-price::after { color: #d4f3ef; }
.sq-special { background: #fff; border-color: var(--accent); position: relative; }
.special-note { margin: 8px 2px 0; font-size: .82rem; font-weight: 700; color: var(--accent-d); }
.special-box { margin-top: 4px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: #fafcff; }
.special-head { font-weight: 700; color: var(--navy-800); margin-bottom: 4px; }

.hidden { display: none !important; }
footer.site { text-align: center; color: var(--muted); font-size: .82rem; padding: 30px; }

/* ---------- Riduzione movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
