/* =====================================================================
   HABITUS / ESSENCEHAB — Design System
   Tema "ORO AL TRAMONTO" — chiaro, caldo, premium.
   Sfondo crema, accenti oro/bronzo, tocco scuro solo su footer/pre.
   I nomi storici delle variabili (--olive*, --rose-gold*, --coral*,
   --mint*, --sand*, --ink, --grey, --line) sono MANTENUTI per
   compatibilità con tutte le pagine esistenti, ma ora contengono
   i valori del nuovo tema chiaro.
   ===================================================================== */

:root {
  /* ---- Accento principale: ORO/AMBRA (nomi storici --rose-gold* / --coral*) ---- */
  --rose-gold: #C9862E;
  --rose-gold-light: #E3A857;
  --rose-gold-soft: #F2C879;
  --coral: #C9862E;
  --coral-light: #E3A857;
  --coral-soft: #FBEBCB;

  /* ---- Colore "guida": BRONZO (nomi storici --olive* / --mint*) ---- */
  --olive: #8A5A2B;
  --olive-dark: #6E4620;
  --olive-light: #C99A5E;
  --mint: #B4703A;
  --mint-soft: #FBE3D2;

  /* ---- Neutri (tema chiaro) ---- */
  --sand: #FDF6EA;
  --sand-dark: #F2DBA8;
  --line: #F2DBA8;
  --surface: #FFFFFF;
  --ink: #2B1E14;
  --grey: #8A7A63;
  --white: #FFFFFF;

  /* Semantici (su chiaro) */
  --success: #4CAF6D;
  --error: #E4574A;
  --warning: #E8B23D;

  /* Tipografia */
  --font-head: 'Sora', 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Outfit', 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Misure */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px rgba(43, 30, 20, 0.14);
  --shadow-sm: 0 8px 24px rgba(43, 30, 20, 0.10);
  --maxw: 1140px;
  --gap: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  color: var(--ink); background-color: var(--sand); -webkit-font-smoothing: antialiased;
  background-image: linear-gradient(rgba(253,246,234,.86), rgba(253,246,234,.94)), url('../../img/home/hero-tramonto-mobile.webp');
  background-size: cover;
  background-position: center 55%;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
@media (min-width: 900px) {
  body { background-image: linear-gradient(rgba(253,246,234,.86), rgba(253,246,234,.94)), url('../../img/home/hero-tramonto.webp'); }
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose-gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--rose-gold-light); }

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.5px; font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 3px; font-size: .75rem; color: var(--rose-gold); font-weight: 700; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.center { text-align: center; }
.muted { color: var(--grey); }

.topbar { position: sticky; top: 0; z-index: 50; background: rgba(253, 246, 234, 0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--sand-dark); }
.topbar .inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 700; letter-spacing: 2px; color: var(--ink); }
.brand img { width: 38px; height: 38px; }
.nav-links { display: flex; gap: 1.4rem; align-items: center; }
.nav-links a { color: var(--ink); font-size: .95rem; }
.nav-links a:hover { color: var(--rose-gold); }

.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-family: var(--font-head); font-weight: 700; font-size: .95rem; padding: .8rem 1.5rem; border-radius: var(--radius-sm); border: 1.5px solid transparent; cursor: pointer; transition: all .2s; text-align: center; line-height: 1; }
.btn-primary { background: linear-gradient(135deg, var(--rose-gold), var(--olive)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-outline { background: transparent; border-color: var(--olive); color: var(--olive); }
.btn-outline:hover { background: var(--olive); color: #fff; }
.btn-olive { background: var(--olive); color: #fff; }
.btn-olive:hover { background: var(--olive-dark); color: #fff; }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: var(--rose-gold-light); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--sand-dark); }
.btn-ghost:hover { border-color: var(--coral); color: var(--coral); }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem 1rem; font-size: .85rem; }

/* effetto metallo/shimmer sui pulsanti "oro" (primary e coral) in tutto il sito */
.btn-primary::after, .btn-coral::after {
  content: ""; position: absolute; top: 0; left: 0; width: 60%; height: 100%;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.55) 45%, transparent 65%);
  background-size: 200% 100%;
  animation: hb-shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.75rem; border: 1px solid var(--sand-dark); }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.5rem 2rem; width: 100%; max-width: 440px; border: 1px solid var(--sand-dark); }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { width: 72px; height: 72px; margin: 0 auto .5rem; }
.auth-logo .name { font-family: var(--font-head); letter-spacing: 4px; color: var(--rose-gold); font-weight: 700; font-size: 1.1rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink); }
.field input, .field select, .field textarea { width: 100%; padding: .8rem .9rem; font-size: 1rem; font-family: var(--font-body); border: 1.5px solid var(--sand-dark); border-radius: var(--radius-sm); background: #FFFFFF; color: var(--ink); transition: border-color .2s; }
.field input::placeholder, .field textarea::placeholder { color: #A99A82; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--rose-gold); }
.field .hint { font-size: .78rem; color: var(--grey); margin-top: .35rem; }
.field-error { font-size: .8rem; color: var(--error); margin-top: .35rem; }

.otp-inputs { display: flex; gap: .6rem; justify-content: center; margin: 1.2rem 0; }
.otp-inputs input { width: 48px; height: 56px; text-align: center; font-size: 1.5rem; font-weight: 700; border: 1.5px solid var(--sand-dark); border-radius: var(--radius-sm); background: #FFFFFF; color: var(--ink); }
.otp-inputs input:focus { outline: none; border-color: var(--rose-gold); }

.alert { padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert-success { background: rgba(76,175,109,.15); color: #2F7D4F; border-color: rgba(76,175,109,.4); }
.alert-error { background: rgba(228,87,74,.15); color: #B23327; border-color: rgba(228,87,74,.4); }
.alert-info { background: rgba(138,90,43,.12); color: var(--olive-dark); border-color: rgba(138,90,43,.35); }

.divider { display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0; color: var(--grey); font-size: .82rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--sand-dark); }

.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; font-family: var(--font-head); }
.badge-super { background: var(--olive); color: #fff; }
.badge-admin { background: var(--olive-dark); color: #fff; }
.badge-trainer { background: var(--olive-light); color: var(--ink); }
.badge-client { background: var(--sand-dark); color: var(--ink); }

.footer { background: #2B1E14; color: #C9B594; padding: 2.5rem 0; margin-top: 3rem; font-size: .9rem; border-top: 1px solid #4A3319; text-align: center; }
.footer a { color: var(--rose-gold-soft); }
.footer .links { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }

.cookie-banner { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1000; max-width: 720px; margin: 0 auto; background: var(--surface); border: 1px solid var(--sand-dark); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem 1.5rem; }
.cookie-banner h3 { margin-top: 0; }
.cookie-banner p { font-size: .9rem; margin: .4rem 0 1rem; color: var(--grey); }
.cookie-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.cookie-actions .btn { flex: 1 1 auto; }

.cookie-modal-backdrop { position: fixed; inset: 0; background: rgba(43,30,20,.55); z-index: 1001; display: none; align-items: center; justify-content: center; padding: 1.25rem; }
.cookie-modal-backdrop.open { display: flex; }
.cookie-modal { background: var(--surface); border-radius: var(--radius); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 1.75rem; box-shadow: var(--shadow); }
.cookie-cat { border: 1px solid var(--sand-dark); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: .9rem; }
.cookie-cat .row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cookie-cat h4 { margin: 0; font-size: 1rem; }
.cookie-cat p { font-size: .82rem; color: var(--grey); margin: .4rem 0 0; }

.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--sand-dark); border-radius: 999px; transition: .25s; }
.switch .slider::before { content: ''; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.switch input:checked + .slider { background: var(--olive); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: .6; cursor: not-allowed; }

.grid { display: grid; gap: var(--gap); }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.hide-mobile { display: none; }
@media (min-width: 800px) { .hide-mobile { display: flex; } }

.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.text-sm { font-size: .88rem; } .text-center { text-align: center; }

.nav-badge { display: inline-block; min-width: 18px; padding: 0 .35rem; margin-left: .35rem; font-family: var(--font-head); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; color: #fff; background: var(--error); border-radius: 999px; vertical-align: middle; }
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0; background: transparent; border: none; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 0 auto; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 799px) {
  .topbar .inner { position: relative; }
  .nav-toggle { display: flex; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--sand-dark); box-shadow: var(--shadow); padding: .5rem 0; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .85rem 1.25rem; border-bottom: 1px solid var(--sand-dark); font-size: 1rem; }
  .nav-links a:last-child { border-bottom: none; }
}

/* =====================================================================
   HERO HOMEPAGE — foto spiaggia al tramonto animata + pulsanti metallo
   Usato solo in public/index.php
   ===================================================================== */
.hb-hero { position: relative; overflow: hidden; isolation: isolate; padding: 72px 24px 64px; text-align: center; }
.hb-hero__bg { position: absolute; inset: 0; z-index: -2; background-image: url('../../img/home/hero-tramonto-mobile.webp'); background-size: cover; background-position: center 60%; animation: hb-kenburns 22s ease-in-out infinite alternate; }
@media (min-width: 900px) { .hb-hero__bg { background-image: url('../../img/home/hero-tramonto.webp'); } }
.hb-hero__overlay { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(43,30,20,0) 0%, rgba(43,30,20,0) 55%, rgba(253,246,234,0.85) 96%); }
@keyframes hb-kenburns { 0% { transform: scale(1) translateY(0); } 100% { transform: scale(1.08) translateY(-1.5%); } }
.hb-hero__sparkle { position: absolute; border-radius: 50%; background: #FFF3D6; opacity: 0; animation: hb-twinkle 3.5s ease-in-out infinite; pointer-events: none; }
@keyframes hb-twinkle { 0%, 100% { opacity: 0; transform: scale(0.6); } 50% { opacity: 0.9; transform: scale(1); } }
.hb-hero__content { position: relative; max-width: 640px; margin: 0 auto; }

.hb-hero__panel { display: inline-block; max-width: 600px; margin: 0 auto 26px; padding: 30px 36px; border-radius: 20px; background: radial-gradient(ellipse 100% 100% at 50% 45%, rgba(20,12,6,0.62) 0%, rgba(20,12,6,0.5) 55%, rgba(20,12,6,0.22) 100%); -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.hb-hero__content .hb-hero__panel .hb-eyebrow { color: #F5D9A8; }
.hb-hero__content .hb-hero__panel h1 { color: #FFFFFF; text-shadow: 0 2px 14px rgba(0,0,0,0.55); margin-top: 0; }
.hb-hero__content .hb-hero__panel .hb-hero__lead { color: #F2E7D6; text-shadow: 0 1px 8px rgba(0,0,0,0.5); margin-bottom: 0; max-width: none; }
.hb-eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: #2B1E14; margin: 0 0 14px; }
.hb-hero__content h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.25; color: #2B1E14; text-shadow: 0 1px 0 rgba(255,255,255,0.35); margin: 0 0 16px; }
.hb-hero__lead { font-size: 15px; color: #4A3319; max-width: 460px; margin: 0 auto 26px; }
.hb-hero__cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn-gold-metal { position: relative; overflow: hidden; display: inline-block; background: linear-gradient(135deg, #7A4A1E, #D89A4E 30%, #F2C879 50%, #D89A4E 70%, #7A4A1E); background-size: 220% 100%; color: #2B1E14; font-weight: 600; font-size: 14px; padding: 13px 28px; border-radius: 9px; text-decoration: none; box-shadow: 0 2px 6px rgba(120,70,20,0.35), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn-gold-metal::after { content: ""; position: absolute; top: 0; left: 0; width: 60%; height: 100%; background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.75) 45%, transparent 65%); background-size: 200% 100%; animation: hb-shimmer 3s ease-in-out infinite; }
@keyframes hb-shimmer { 0% { background-position: -150% 0; } 100% { background-position: 250% 0; } }
.btn-outline-cream { display: inline-block; background: rgba(253,246,234,0.9); color: #2B1E14; font-weight: 500; font-size: 14px; padding: 13px 28px; border-radius: 9px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .hb-hero__bg, .hb-hero__sparkle, .btn-gold-metal::after, .btn-primary::after, .btn-coral::after { animation: none; }
}
