/* public/styles/site.css */

/* ---------- Base ---------- */
:root{
  --bg: #f7f7f4;
  --card: #ffffff;
  --text: #0f1115;
  --muted: #6a6f76;
  --border: #e6e6df;

  --primary: #121418;
  --primaryText: #ffffff;
  --accent: #c34b4b;
  --accentSoft: #f7e8e8;

  --soft: #f2f2ec;
  --soft2: #fbfbf8;

  --shadow: 0 18px 40px rgba(20, 24, 26, 0.08);
  --radius: 18px;
}

*{ box-sizing: border-box; }

html, body{
  margin:0;
  padding:0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  line-height: 1.55;
}

body.public{
  background:
    radial-gradient(1200px 600px at -10% -10%, #f3f0ea 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 0%, #f4f0ea 0%, transparent 55%),
    var(--bg);
  position: relative;
}

/* ---------- Public Header ---------- */
.publicHeader{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 247, 244, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.headerInner{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brandBlock{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration: none;
}
.brandAvatar{
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(18, 20, 24, 0.18);
}
.brandText{
  display:flex;
  flex-direction: column;
  gap: 2px;
}
.brandTitle{
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
}
.brandSubtitle{
  font-size: 12px;
  color: var(--muted);
}
.navLinks{
  display:flex;
  gap: 12px;
  align-items:center;
}
.navLinks a{
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}
.navLinks a:hover{
  background: var(--soft2);
  border-color: var(--border);
}
.navLinks a.isActive{
  background: var(--accentSoft);
  border-color: var(--border);
}
.navToggle{ display:none; }
.navBurger{
  display:none;
  width: 42px;
  height: 36px;
  align-items:center;
  justify-content:center;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.navBurger span{
  display:block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}
body.public::before,
body.public::after{
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0.35;
  filter: blur(12px);
}
body.public::before{
  width: 420px;
  height: 420px;
  right: -140px;
  top: 120px;
  background: linear-gradient(135deg, #eef0f3, #f7ecec);
}
body.public::after{
  width: 360px;
  height: 360px;
  left: -120px;
  bottom: 80px;
  background: linear-gradient(135deg, #f3eee6, #edf2f1);
}

a{
  color: inherit;
  text-decoration: none;
}
a:hover{ text-decoration: underline; }

.muted{ color: var(--muted); }
hr{ border:0; border-top:1px solid var(--border); margin:16px 0; }

/* ---------- Layout ---------- */
.container{
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 18px 48px;
}

h1, h2, h3{
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: -0.01em;
}
h1{
  font-size: 34px;
  margin: 8px 0 8px;
}
h2{
  font-size: 24px;
  margin: 18px 0 10px;
}
h3{
  font-size: 18px;
  margin: 14px 0 10px;
}

.topbar{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(6px);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brandDot{
  width:12px;height:12px;border-radius:999px;background:var(--accent);
  box-shadow: 0 0 0 6px rgba(193, 124, 106, 0.18);
}

/* ---------- Cards ---------- */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.cardSoft{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(18, 20, 24, 0.05);
}

.section{
  margin-top: 14px;
}

.hero{
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  background: linear-gradient(120deg, #ffffff 0%, #f7f2ed 100%);
  box-shadow: var(--shadow);
}
.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}

.heroGrid{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items:center;
}
.heroTitle{
  font-size: 40px;
  margin: 0 0 8px 0;
}
.heroLead{
  font-size: 15px;
  color: var(--muted);
  max-width: 540px;
}
.heroCard{
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(18, 20, 24, 0.08);
}
.heroStat{
  display:flex;
  gap: 12px;
  align-items:center;
  margin-top: 10px;
}
.heroStat b{ font-size: 18px; }

.sectionHeader{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
  margin: 18px 0 10px;
}
.sectionHeader .muted{ font-size: 13px; }

.ctaBand{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items:center;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: #fff;
}

/* ---------- Forms ---------- */
.formGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field{
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.input,
.textarea{
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus,
.textarea:focus{
  border-color: rgba(195, 75, 75, 0.35);
  box-shadow: 0 0 0 4px rgba(195, 75, 75, 0.12);
}
.textarea{
  min-height: 160px;
  resize: vertical;
}
.fieldError .input,
.fieldError .textarea{
  border-color: #d97777;
  box-shadow: 0 0 0 3px rgba(217, 119, 119, 0.12);
}
.fieldMsg{
  font-size: 12px;
  color: #b45353;
}
.notice{
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.notice.ok{
  border-color: #b7d7c6;
  background: #f2fbf6;
}
.notice.err{
  border-color: #e5b6b6;
  background: #fff4f4;
}

/* ---------- Buttons ---------- */
.btnPrimary,
.btnSecondary,
.btnGhost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}

.btnPrimary{
  background: var(--primary);
  color: var(--primaryText);
  box-shadow: 0 10px 20px rgba(18, 20, 24, 0.18);
}
.btnPrimary:hover{ filter: brightness(1.05); }

.btnSecondary{
  background: var(--soft);
  border-color: var(--border);
  color: var(--text);
}
.btnSecondary:hover{ background: #eceff3; }

.btnGhost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btnGhost:hover{ background: var(--soft2); }

/* ---------- Pill / Badges ---------- */
.pill{
  display:inline-flex;
  align-items:center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(18, 20, 24, 0.15);
  background: #f3f2ee;
  color: #2a2f35;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}
.badge--accent{ background:#eef2ff; border-color:#c7d2fe; }
.badge--info{ background:#eff6ff; border-color:#bfdbfe; }
.badge--warning{ background:#fffbeb; border-color:#fde68a; }
.badge--danger{ background:#fef2f2; border-color:#fecaca; }
.badge--neutral{ background:#f3f4f6; border-color:#e5e7eb; }

/* ---------- Sections ---------- */
.cards{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.courseCardImage{
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--soft2);
}
.courseCardImageWrap{
  margin-bottom: 10px;
}
.courseCardCompact{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.courseGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 980px){
  .courseGrid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  .courseGrid{
    grid-template-columns: 1fr;
  }
}

/* ---------- Wizard results cards ---------- */
.resultCard{
  display:grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items:start;
}
.resultImage{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--soft2);
}
.resultBody{
  min-width: 0;
}
@media (max-width: 820px){
  .resultCard{
    grid-template-columns: 1fr;
  }
}
.offer{
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #fff 0%, #f7f1eb 100%);
  box-shadow: var(--shadow);
}
.offerRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}
.offerImg{
  width:140px;
  height:140px;
  border-radius:16px;
  object-fit:cover;
  border:1px solid var(--border);
  background:#fff;
}

/* ---------- Quick List (elenco rapido) ---------- */
.calendarWrap{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}
.eventList{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.04);
}
.quickItem{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 10px 0;
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.04);
}

.quickTop{ display:flex; gap:12px; align-items:flex-start; }
.quickDot{
  width:10px; height:10px; border-radius:999px; margin-top:6px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 6px rgba(195, 75, 75, 0.12);
}
.quickMain{ flex:1; }

.quickHeadline{
  font-size: 14px;
  margin-bottom: 4px;
}
.quickTitleRow{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items:center;
}
.quickTitleRow a{
  font-weight: 800;
}
.quickSubline{
  margin-top: 6px;
  font-size: 13px;
}

/* ---------- Calendar ---------- */
.months{
  display: grid;
  gap: 14px;
}

.monthCard{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 18px rgba(17, 24, 39, 0.04);
  padding: 12px;
  overflow: hidden;
}

.monthTitle{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.monthTitle b{ font-size: 16px; }
.monthTitle .muted{ font-size: 12px; }

.grid{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.dow{
  font-size: 12px;
  color: var(--muted);
  text-align:center;
  padding: 4px 0;
}

.cell{
  position: relative;
  background: var(--soft2);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 50px;
  padding: 6px 6px 8px;
}

.cell.out{
  opacity: 0.35;
  background: transparent;
}

.dayNum{
  font-weight: 800;
  font-size: 11px;
  color: #111827;
}

.cell.hasEvents{
  background: #fff;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cell.hasEvents:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(18,20,24,0.12);
}
.cell.hasEvents.dark .dayNum{
  color: #fff;
}
.cell.hasEvents.dark .moreBadge{
  color: #fff;
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.18);
}

.dots{
  margin-top: 8px;
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
}

.evtDot{
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display:inline-block;
  border: 1px solid rgba(17,24,39,0.10);
  box-shadow: 0 1px 2px rgba(17,24,39,0.10);
}
.evtDot:hover{
  transform: translateY(-1px);
}

.moreBadge{
  position:absolute;
  right: 8px;
  bottom: 8px;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  color: var(--text);
}

/* ---------- Dialog (popup) ---------- */
dialog{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  width: min(620px, calc(100vw - 24px));
  box-shadow: 0 30px 80px rgba(17,24,39,0.20);
}

dialog::backdrop{
  background: rgba(17,24,39,0.50);
}

.dlgHead{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.dlgTitle{
  margin:0;
  font-size: 18px;
}
.dlgMeta{
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.dlgBody{
  padding: 12px 14px;
  background: #fff;
}

.dlgActions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}

/* ---------- Small responsive tweaks ---------- */
@media (max-width: 640px){
  .heroGrid{
    grid-template-columns: 1fr;
  }
  .heroTitle{ font-size: 32px; }
  .ctaBand{
    grid-template-columns: 1fr;
  }
  .formGrid{
    grid-template-columns: 1fr;
  }
  .headerInner{ padding: 10px 0; }
  .brandSubtitle{ display:none; }
  .navBurger{ display:flex; }
  .navLinks{
    position: absolute;
    top: 68px;
    right: 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    box-shadow: var(--shadow);
    min-width: 200px;
    display: none;
  }
  .navToggle:checked ~ .navLinks{
    display:flex;
  }
  .calendarWrap{
    grid-template-columns: 1fr;
  }
  .grid{ gap: 5px; }
  .cell{ min-height: 44px; }
  h1{ font-size: 24px; }
}
