/* ==========================================================================
   THE CODE — ModelleItalia® | Quiet Luxury & Bio-Hacking Chic Design System
   ========================================================================== */

:root {
  --ivory: #F8F6F1;
  --ivory-soft: #F1EDE4;
  --surface: #FFFFFF;
  --ink: #18181B;
  --ink-muted: #52525B;
  --ink-soft: #71717A;
  --gold: #B89352;
  --gold-light: #E8D5B5;
  --gold-soft: rgba(184, 147, 82, 0.12);
  --sage: #6D8B74;
  --sage-soft: rgba(109, 139, 116, 0.14);
  --rose: #B4535A;
  --rose-soft: rgba(180, 83, 90, 0.12);
  --border: #E6E1D6;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 16px rgba(24, 24, 27, 0.05);
  --shadow-md: 0 12px 32px rgba(24, 24, 27, 0.08);
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

button, input, select, textarea {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   BOOK-GATE LOGIN SCREEN
   ========================================================================== */
.gate-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(circle at 20% 15%, rgba(184, 147, 82, 0.14), transparent 50%),
              radial-gradient(circle at 85% 85%, rgba(109, 139, 116, 0.12), transparent 50%),
              var(--ivory);
}

.gate-card {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}

.gate-brand {
  text-align: center;
  margin-bottom: 24px;
}

.gate-kicker {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.gate-title {
  margin: 0 0 6px;
  font-size: 32px;
  color: var(--ink);
}

.gate-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.gate-question-box {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.gate-question-lbl {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.gate-question-text {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: #FFFFFF;
  color: var(--ink);
  transition: border-color 0.2s;
}

.gate-input:focus {
  outline: none;
  border-color: var(--gold);
}

.gate-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 13px;
  font-weight: 500;
}

.gate-privacy-box {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--sage-soft);
  border: 1px solid rgba(109, 139, 116, 0.3);
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}

.gate-privacy-box strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: 13px;
}

/* ==========================================================================
   APP SHELL (SIDEBAR DESKTOP + BOTTOM TAB BAR MOBILE)
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--ink);
  color: #F8F6F1;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 4px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.sidebar-logo-title {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  margin: 0;
}

.sidebar-logo-sub {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-light);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(248, 246, 241, 0.72);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-btn.is-active {
  background: linear-gradient(90deg, rgba(184, 147, 82, 0.28), rgba(184, 147, 82, 0.08));
  color: var(--gold-light);
  font-weight: 600;
  border-left: 3px solid var(--gold);
}

.sidebar-foot {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 28px clamp(16px, 3vw, 40px) 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.mobile-topbar {
  display: none;
}

.bottom-tabbar {
  display: none;
}

/* ==========================================================================
   COMPONENTS & CARDS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #2e2e34;
}

.btn-gold {
  background: var(--gold);
  color: #FFFFFF;
}

.btn-gold:hover {
  filter: brightness(1.06);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: var(--rose-soft);
  border-color: rgba(180, 83, 90, 0.35);
  color: var(--rose);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card-gold {
  border-top: 3px solid var(--gold);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.section-kicker {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.section-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--ink);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.pill-gold {
  background: var(--gold-soft);
  color: #8b6b32;
}

.pill-sage {
  background: var(--sage-soft);
  color: #3f5e47;
}

.pill-rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--ink);
  font-size: 14px;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
}

/* Welcome Banner */
.welcome-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.welcome-modal {
  max-width: 580px;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--gold);
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

/* Breathwork Pacer Circle */
.breath-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  min-height: 360px;
  background: radial-gradient(circle at center, rgba(184, 147, 82, 0.14), transparent 65%);
  border-radius: var(--radius-md);
}

.breath-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e8d5b5, #b89352);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 0 40px rgba(184, 147, 82, 0.35);
  transition: transform 0.9s ease-in-out, box-shadow 0.9s ease-in-out;
}

.breath-circle.expand {
  transform: scale(1.38);
  box-shadow: 0 0 65px rgba(184, 147, 82, 0.55);
}

.breath-circle.hold {
  transform: scale(1.38);
}

.breath-circle.contract {
  transform: scale(0.92);
}

/* Checklist rows */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--ivory);
  cursor: pointer;
  transition: border-color 0.2s;
}

.check-row:hover {
  border-color: var(--gold);
}

.check-row input[type="checkbox"],
.check-row input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  margin-top: 2px;
  flex-shrink: 0;
}

.check-row.is-selected,
.check-row:has(input:checked) {
  border-color: var(--gold);
  background: rgba(184, 147, 82, 0.08);
}

/* Wizard Stepper & Detailed Form Blocks */
.wizard-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.wizard-step-pill {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--ivory);
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}

.wizard-step-pill.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
  font-weight: 700;
}

.wizard-step-pill.is-done {
  border-color: var(--sage);
  background: var(--sage-soft);
  color: #2f4b36;
  font-weight: 600;
}

.wizard-progress-bar {
  height: 5px;
  width: 100%;
  background: var(--ivory-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #d6b67d);
  transition: width 0.25s ease;
}

.wizard-intro {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--ivory);
  border-left: 3px solid var(--gold);
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.q-block {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  margin-bottom: 16px;
}

.q-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.q-hint {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-hint {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.tc-feedback {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: #2f4b36;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 8px;
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.diag-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--ivory);
  border: 1px solid var(--border);
}

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

.cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: var(--ivory);
}

.cal-cell.is-done {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: #2f4b36;
  font-weight: 700;
}

.cal-cell.is-today {
  outline: 2px solid var(--gold);
}

/* ==========================================================================
   RESPONSIVE MOBILE-FIRST
   ========================================================================== */
@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    display: none;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--ink);
    color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .app-main {
    width: 100%;
    padding: 18px 14px 90px;
  }

  .grid-2, .grid-3, .diag-grid {
    grid-template-columns: 1fr;
  }

  .wizard-stepper {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .wizard-step-pill {
    font-size: 10px;
    padding: 6px 2px;
  }

  .bottom-tabbar {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.06);
    z-index: 950;
    padding: 6px 6px env(safe-area-inset-bottom);
    gap: 2px;
  }

  .bottom-tabbar::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 0 0 auto;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    font-size: 10.5px;
    padding: 6px 4px;
    cursor: pointer;
    white-space: nowrap;
  }

  .tab-btn.is-active {
    color: var(--gold);
    font-weight: 700;
  }
}

/* ==========================================================================
   MODULO ESERCIZI — SILHOUETTE YOGA PLAYER
   ========================================================================== */
@keyframes yogaAura {
  0%, 100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.45; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.85; }
}

@keyframes yogaBreath {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.022) translateY(-4px); }
}

@keyframes yogaBreathMirror {
  0%, 100% { transform: scaleX(-1) scale(1) translateY(0); }
  50% { transform: scaleX(-1) scale(1.022) translateY(-4px); }
}

@keyframes yogaSway {
  0%, 100% { transform: rotate(-1.6deg) translateY(0); }
  50% { transform: rotate(1.6deg) translateY(-3px); }
}

.yoga-player-stage {
  position: relative;
  background: radial-gradient(circle at 50% 48%, rgba(200, 169, 126, 0.16), transparent 64%), var(--ivory);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 90px 16px 46px;
  overflow: hidden;
}

.yoga-stage-top {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  z-index: 4;
}

.yoga-aura {
  position: absolute;
  top: 52%;
  left: 50%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 169, 126, 0.34) 0%, transparent 70%);
  animation: yogaAura 4.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.yoga-silhouette-img {
  position: relative;
  z-index: 3;
  max-width: min(560px, 92%);
  max-height: 255px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.35s ease;
  animation: yogaBreath 4.8s ease-in-out infinite;
}

.yoga-silhouette-img.is-motion-sway,
.yoga-silhouette-img.is-motion-side {
  animation: yogaSway 4.8s ease-in-out infinite;
}

.yoga-silhouette-img.is-mirrored {
  transform: scaleX(-1);
  animation: yogaBreathMirror 4.8s ease-in-out infinite;
}

.yoga-mat-line {
  position: relative;
  z-index: 2;
  width: min(520px, 86%);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin-top: -12px;
}

.yoga-subtitle-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: rgba(24, 24, 27, 0.92);
  color: #F8F6F1;
  padding: 9px 16px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yoga-timeline {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--ivory-soft);
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 12px;
}

.yoga-timeline-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #d6b67d);
  transition: width 0.3s linear;
}

.yoga-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yoga-playlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 330px;
  overflow-y: auto;
}

.yoga-pl-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--ivory);
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.yoga-pl-item:hover {
  border-color: var(--gold);
}

.yoga-pl-item.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  font-weight: 600;
}

@media (max-width: 767px) {
  .yoga-player-stage {
    min-height: 315px;
    padding-top: 96px;
  }
  .yoga-silhouette-img {
    max-height: 205px;
  }
  .yoga-routine-switcher {
    grid-template-columns: 1fr;
  }
}

.yoga-routine-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.yoga-routine-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.yoga-routine-tab:hover {
  border-color: var(--gold);
}

.yoga-routine-tab.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 4px 14px rgba(183, 146, 86, 0.14);
}

.yoga-rt-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.yoga-rt-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.yoga-prep-banner {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ivory);
  border-left: 3px solid var(--gold);
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.yoga-prep-banner.is-evening {
  background: #F4F1F8;
  border-left-color: #8E7FA8;
}

.yoga-player-stage.is-evening {
  background: radial-gradient(circle at 50% 48%, rgba(162, 148, 186, 0.22), transparent 64%), #F3F0EB;
}

.yoga-player-stage.is-evening .yoga-aura {
  background: radial-gradient(circle, rgba(162, 148, 186, 0.22) 0%, rgba(200, 169, 126, 0.16) 45%, transparent 72%);
  animation-duration: 6.4s;
}

.yoga-player-stage.is-evening .yoga-silhouette-img {
  animation-duration: 6.4s;
}
