/* Portale corsi David Valmori: stile comune (area corsisti + pannello) */

@font-face { font-family: 'Bebas'; src: url('/assets/font/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/assets/font/gotham-book.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/assets/font/gotham-medium.otf') format('opentype'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/assets/font/gotham-bold.otf') format('opentype'); font-weight: 700 900; font-display: swap; }

:root {
  --sfondo: #111111;
  --sup: #1a1a1a;
  --sup2: #222222;
  --sup3: #2b2b2b;
  --bordo: #2f2f2f;
  --bordo2: #3a3a3a;
  --testo: #f4efe9;
  --tenue: #a7a19a;
  --tenue2: #77726c;
  --salmone: #EC8666;
  --salmone-forte: #e2714d;
  --salmone-velo: rgba(236, 134, 102, .12);
  --verde: #7fd1a0;
  --verde-velo: rgba(127, 209, 160, .12);
  --rosso: #f07a7a;
  --rosso-velo: rgba(240, 122, 122, .12);
  --giallo: #EEB846;
  --giallo-velo: rgba(238, 184, 70, .12);
  --raggio: 14px;
  --raggio-s: 9px;
  --ombra: 0 18px 50px rgba(0, 0, 0, .45);
  --morbido: cubic-bezier(.22, .8, .24, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sfondo); color: var(--testo);
  font-family: 'Gotham', 'Montserrat', system-ui, sans-serif; font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--salmone); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .bebas { font-family: 'Bebas', Impact, sans-serif; font-weight: 400; letter-spacing: .02em; line-height: 1; margin: 0; }
h1 { font-size: clamp(38px, 6vw, 64px); }
h2 { font-size: clamp(28px, 4vw, 38px); }
h3 { font-size: 24px; }
p { margin: 0 0 .8em; }
::selection { background: var(--salmone); color: #111; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- bottoni (con l'effetto lucido) */
.btn {
  --c: var(--salmone);
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  font: 600 13px/1 'Gotham', sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #1a0f0b; background: linear-gradient(180deg, #f39a7d 0%, var(--c) 55%, var(--salmone-forte) 100%);
  box-shadow: 0 6px 20px rgba(236, 134, 102, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .25s var(--morbido), box-shadow .25s var(--morbido), opacity .2s;
  text-decoration: none !important; white-space: nowrap;
}
.btn::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); transition: left .7s var(--morbido);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(236, 134, 102, .38), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn:hover::after { left: 130%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.piccolo svg { width: 14px; height: 14px; }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.secondario {
  color: var(--testo); background: linear-gradient(180deg, #2f2f2f, #242424);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 0 1px var(--bordo2);
}
.btn.secondario:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 0 1px var(--salmone); }
.btn.pericolo { color: #fff; background: linear-gradient(180deg, #e98585, #c94f4f); box-shadow: 0 6px 18px rgba(201, 79, 79, .25), inset 0 1px 0 rgba(255,255,255,.3); }
.btn.piccolo { padding: 8px 14px; font-size: 11px; }
.btn.largo { width: 100%; padding: 15px 22px; }
.link-btn { background: none; border: 0; color: var(--salmone); cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.icona-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--bordo2);
  background: var(--sup2); color: var(--testo); cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--morbido);
}
.icona-btn:hover { border-color: var(--salmone); color: var(--salmone); }
.icona-btn svg { width: 18px; height: 18px; }

/* bottone chiudi on-brand, mai la x bianca del browser */
.chiudi {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(236, 134, 102, .45); background: var(--salmone-velo); color: var(--salmone); cursor: pointer;
  transition: transform .3s var(--morbido), background .2s;
}
.chiudi:hover { background: var(--salmone); color: #1a0f0b; transform: rotate(90deg); }
.chiudi svg { width: 16px; height: 16px; }

/* ---------- campi */
.campo { display: grid; gap: 7px; margin-bottom: 16px; }
.campo > span, .etichetta { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tenue); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--sup2); color: var(--testo); border: 1px solid var(--bordo2); border-radius: var(--raggio-s);
  padding: 12px 14px; font: 15px/1.4 'Gotham', sans-serif; outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--salmone); box-shadow: 0 0 0 3px var(--salmone-velo); }
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23EC8666' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input[type=checkbox] { accent-color: var(--salmone); width: 17px; height: 17px; cursor: pointer; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--tenue); cursor: pointer; padding: 8px; }
.pw-wrap button:hover { color: var(--salmone); }

/* ---------- distintivi e barre */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.verde { color: var(--verde); background: var(--verde-velo); }
.badge.salmone { color: var(--salmone); background: var(--salmone-velo); }
.badge.giallo { color: var(--giallo); background: var(--giallo-velo); }
.badge.rosso { color: var(--rosso); background: var(--rosso-velo); }
.badge.grigio { color: var(--tenue); background: rgba(255, 255, 255, .06); }
.barra { height: 6px; background: var(--sup3); border-radius: 99px; overflow: hidden; }
.barra > i { display: block; height: 100%; background: linear-gradient(90deg, var(--salmone-forte), var(--salmone)); border-radius: 99px; transition: width .8s var(--morbido); }

/* ---------- avvisi */
#avvisi { position: fixed; z-index: 1000; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.avviso {
  background: #262626; border: 1px solid var(--bordo2); border-left: 3px solid var(--salmone); border-radius: 12px;
  padding: 13px 16px; box-shadow: var(--ombra); font-size: 14px; pointer-events: auto;
  animation: entra .4s var(--morbido);
}
.avviso.errore { border-left-color: var(--rosso); }
.avviso.esce { animation: esce .35s var(--morbido) forwards; }
@keyframes entra { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes esce { to { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- finestre */
.velo {
  position: fixed; inset: 0; z-index: 500; background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .3s var(--morbido);
}
.velo.aperto { opacity: 1; }
.finestra {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--sup); border: 1px solid var(--bordo2);
  border-radius: 18px; box-shadow: var(--ombra); transform: translateY(18px) scale(.97); transition: transform .4s var(--morbido);
}
.finestra.larga { width: min(860px, 100%); }
.velo.aperto .finestra { transform: none; }
.finestra-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.finestra-testa h3 { font-size: 30px; }
.finestra-corpo { padding: 14px 22px 22px; }
.finestra-piede { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; flex-wrap: wrap; }

.carica { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--salmone); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.vuoto { text-align: center; color: var(--tenue); padding: 40px 16px; }
.tenue { color: var(--tenue); }
.piccolo { font-size: 13px; }
.dissolvi { animation: dissolvi .45s var(--morbido); }
@keyframes dissolvi { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* logo ufficiale */
.logo { display: block; width: 220px; height: auto; }
.logo-grande { width: min(255px, 66vw); }
@media (max-width: 600px) { .logo { width: 185px; } }

/* marchi ® © ™ piccoli e in alto */
sup.marchio-sup { font-size: .42em; line-height: 0; vertical-align: 0; position: relative; top: -.95em; margin-left: .06em; font-family: 'Gotham', sans-serif; font-weight: 500; letter-spacing: 0; }
h1 sup.marchio-sup, h2 sup.marchio-sup, h3 sup.marchio-sup, .bebas sup.marchio-sup { font-size: .5em; top: -.8em; }
