/* ==========================================
 Guide Diététique - Mobile First (refonte)
 Base = 320px, enrichissement par min-width
 ========================================== */
:root {
  /* Palette Méditerranéenne Chaleureuse */
  --primary-color: #1a936f;
  --primary-hover: #14785c;
  --primary-light: #e6f4ef;
  --secondary-color: #114b5f;
  --secondary-light: #e0eef4;
  --accent-color: #e76f51;
  --accent-dark: #c85a3e;
  --accent-light: #fef3e2;
  --accent-warm: #f4a261;
  --light-color: #e9f5f0;
  --dark-color: #114b5f;
  --text-color: #2b2d42;
  --bg-color: #fdfbf7;
  --success-color: #1a936f;
  --success-light: #e6f4ef;
  --success-border: #88c9b8;
  --error-color: #c1121f;
  --error-light: #fdecea;
  --error-border: #f0a0a0;
  --warning-color: #f4a261;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --box-shadow: 0 4px 12px rgba(17, 75, 95, 0.08);
  --box-shadow-lg: 0 8px 24px rgba(17, 75, 95, 0.14);
  --tap-min: 48px;
  --nav-height: 64px;
  --content-max: 1000px;
  --space: 16px;
  --space-lg: 24px;
}
/* Reset mobile */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0 0 calc(var(--nav-height) + env(safe-area-inset-bottom, 0px)) 0;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}
/* Visually hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Container - mobile first : 100% + padding */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}
/* Header - compact mobile - visible only on #introduction (toggled via JS .is-hidden) */
header {
  background:
    radial-gradient(
      ellipse at 20% 20%,
      rgba(244, 162, 97, 0.18) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 80%,
      rgba(255, 255, 255, 0.12) 0%,
      transparent 50%
    ),
    linear-gradient(135deg, #1a936f 0%, #114b5f 100%);
  color: white;
  text-align: center;
  padding: calc(22px + env(safe-area-inset-top, 0px)) 16px 22px;
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
header.is-hidden {
  display: none !important;
}
header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  line-height: 1.2;
  font-weight: 700;
}
header p {
  margin: 8px 0 0;
  opacity: 0.95;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  line-height: 1.4;
}
/* Desktop nav .menu - hidden on mobile, visible >=768px */
.menu {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 16px;
  margin-bottom: 16px;
  display: none;
}
.menu h2 {
  color: var(--primary-color);
  margin-top: 0;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 10px;
}
.menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.menu li {
  margin: 0;
}
.menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 10px 14px;
  background-color: var(--light-color);
  color: var(--dark-color);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
}
.menu a:hover {
  background-color: var(--primary-color);
  color: white;
}
.menu a:active {
  transform: scale(0.98);
}
.menu a.active,
.menu a[aria-current="page"] {
  background-color: var(--secondary-color);
  color: white;
}
/* Bottom nav - visible mobile, hidden desktop */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: white;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 150;
}
.bottom-nav__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: #666;
  font-size: 0.68rem;
  font-weight: 600;
  min-width: 0;
  padding: 6px 2px;
  border: none;
  background: none;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav__link:active {
  background-color: var(--light-color);
}
.bottom-nav__link.active,
.bottom-nav__link[aria-current="page"] {
  color: var(--secondary-color);
}
.bottom-nav__icon {
  font-size: 1.35rem;
  line-height: 1;
}
.bottom-nav__label {
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bottom-nav__link--more {
  color: var(--accent-color);
}
.bottom-nav__link--more.active {
  color: var(--accent-dark);
  background-color: var(--accent-light);
}
/* Drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
.nav-drawer.is-open {
  display: block;
}
.nav-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}
.nav-drawer__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  max-height: min(78dvh, 560px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--box-shadow-lg);
  animation: slideUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}
.nav-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.nav-drawer__title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--dark-color);
  font-weight: 700;
}
.nav-drawer__close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  color: #666;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.nav-drawer__close:active {
  background: #e0e0e0;
}
.nav-drawer__list {
  list-style: none;
  margin: 0;
  padding: 12px 12px 16px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
}
.nav-drawer__list a,
.nav-drawer__list button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--light-color);
  color: var(--dark-color);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.nav-drawer__list a:active,
.nav-drawer__list button:active {
  background: #c8e6c9;
}
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Sections - mobile first: reduced padding - Méditerranéen */
section {
  background-color: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow);
  padding: 20px 16px;
  margin-bottom: 16px;
  scroll-margin-top: 16px;
  border: 1px solid #eceee9;
}
section h2 {
  color: var(--secondary-color);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 12px;
  margin-top: 0;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  line-height: 1.25;
}
section h3 {
  color: var(--primary-color);
  margin-top: 22px;
  font-size: clamp(1.05rem, 4vw, 1.25rem);
}
section h4 {
  font-size: 1rem;
  margin-top: 16px;
}
section p,
section li {
  font-size: 1rem;
  line-height: 1.6;
}
section ul,
section ol {
  padding-left: 20px;
}
/* Buttons - 48px tap target */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary-color), #168a66);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s ease;
  margin: 8px 6px 8px 0;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(26, 147, 111, 0.25);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  background: linear-gradient(135deg, var(--primary-hover), #12664d);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 147, 111, 0.32);
}
.btn:active {
  transform: scale(0.97);
}
.btn-secondary {
  background: linear-gradient(135deg, var(--accent-color), #d45a3e);
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.28);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, var(--accent-dark), #b94a33);
  box-shadow: 0 4px 12px rgba(231, 111, 81, 0.35);
}
.btn-secondary:active {
  background: #a33d00;
}
.btn-ghost {
  background: white;
  color: var(--secondary-color);
  border: 2px solid #dde8e2;
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: none;
  transform: none;
}
.btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-print {
  background: linear-gradient(135deg, #114b5f, #1a6d8a);
  width: 100%;
  border-radius: var(--border-radius-sm);
}
.btn-print:hover {
  background: linear-gradient(135deg, #0d3a4a, #155a71);
}
.btn--full {
  width: 100%;
}
/* Quiz - Interactif une question à la fois - Méditerranéen */
.quiz-shell {
  margin: 18px 0 8px;
}
.quiz-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary-light), #fdf6e3);
  border: 1px solid #dde8e2;
  border-radius: var(--border-radius);
}
.quiz-counter {
  font-weight: 800;
  color: var(--secondary-color);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz-counter__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 0.85rem;
}
.quiz-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid #dde8e2;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--secondary-color);
  box-shadow: 0 2px 6px rgba(17, 75, 95, 0.06);
}
.quiz-score__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-warm);
  animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(0.9);
  }
}
.quiz-progress {
  width: 100%;
  height: 10px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
  flex-basis: 100%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.quiz-progress__bar {
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, var(--primary-color), #2ec4a5);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
.quiz-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.quiz-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dde8e2;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}
.quiz-dot.is-active {
  background: var(--primary-color);
  transform: scale(1.25);
  box-shadow: 0 0 0 3px rgba(26, 147, 111, 0.18);
}
.quiz-dot.is-done {
  background: #88c9b8;
  border-color: var(--primary-color);
}
.quiz-dot.is-done.is-correct {
  background: var(--success-color);
}
.quiz-dot.is-done.is-incorrect {
  background: var(--error-color);
}
.quiz-container {
  margin: 0;
  position: relative;
  min-height: 260px;
}
.quiz-question {
  display: none;
  background: white;
  padding: 18px 16px;
  border-radius: var(--border-radius);
  border: 1px solid #e6e8e6;
  border-left: 5px solid var(--primary-color);
  box-shadow: var(--box-shadow);
  animation: quizIn 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.quiz-question.is-active {
  display: block;
}
@keyframes quizIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.quiz-question.is-answered {
  border-left-color: var(--secondary-color);
}
.quiz-question.is-answered.is-correct {
  border-left-color: var(--success-color);
  background: linear-gradient(135deg, white 85%, var(--success-light));
}
.quiz-question.is-answered.is-incorrect {
  border-left-color: var(--error-color);
  background: linear-gradient(135deg, white 85%, #fff5f5);
}
.quiz-question h4 {
  margin: 0 0 14px;
  color: var(--secondary-color);
  font-size: 1.05rem;
  line-height: 1.45;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.quiz-question__badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--secondary-light);
  color: var(--secondary-color);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 1px;
}
.quiz-options {
  margin: 14px 0 10px;
  display: grid;
  gap: 10px;
}
.quiz-option {
  margin: 0;
  min-height: 52px;
  padding: 14px 16px;
  border: 2px solid #dde8e2;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 700;
  font-size: 1rem;
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: white;
  color: var(--text-color);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(26, 147, 111, 0.12);
}
.quiz-option:active:not(:disabled) {
  transform: scale(0.98);
}
.quiz-option:disabled {
  cursor: default;
  opacity: 1;
}
.quiz-option.selected {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}
/* États après réponse */
.quiz-option.is-correct {
  background: linear-gradient(135deg, #e6f4ef, #d1ece3) !important;
  border-color: var(--success-color) !important;
  color: #0d5a42 !important;
  box-shadow: 0 4px 12px rgba(26, 147, 111, 0.18);
}
.quiz-option.is-incorrect {
  background: linear-gradient(135deg, #fdecea, #f9d6d0) !important;
  border-color: var(--error-color) !important;
  color: #7a1a1a !important;
}
.quiz-option.is-dimmed {
  opacity: 0.55;
}
/* Icone check/cross via pseudo */
.quiz-option.is-correct::after {
  content: "✓";
  font-weight: 900;
  margin-left: 6px;
}
.quiz-option.is-incorrect::after {
  content: "✕";
  font-weight: 900;
  margin-left: 6px;
}
/* Vrai / Faux nuances subtiles (avant réponse) */
.quiz-option--true {
}
.quiz-option--false {
}
.quiz-feedback {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  align-items: center;
  gap: 8px;
}
.quiz-feedback.is-visible {
  display: flex;
  animation: fadeIn 0.25s ease;
}
.quiz-feedback--success {
  background: var(--success-light);
  color: #0d5a42;
  border: 1px solid var(--success-border);
}
.quiz-feedback--error {
  background: var(--error-light);
  color: #7a1a1a;
  border: 1px solid var(--error-border);
}
.quiz-answer {
  display: none;
  margin-top: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eef7ff, #f0f9ff);
  border-radius: var(--border-radius-sm);
  border: 1px solid #cfe4ff;
  border-left: 4px solid #1a6d8a;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1a3440;
}
.quiz-answer.show {
  display: block;
  animation: fadeIn 0.3s ease;
}
.quiz-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: nowrap;
}
.quiz-nav .btn {
  flex: 1 1 0;
  margin: 0;
  min-width: 0;
  white-space: nowrap;
}
/* Résultat final */
.quiz-result {
  display: none;
  text-align: center;
  padding: 24px 18px;
  background: linear-gradient(135deg, white, var(--primary-light));
  border: 1px solid #dde8e2;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-lg);
  animation: quizIn 0.4s ease;
}
.quiz-result.is-visible {
  display: block;
}
.quiz-result__icon {
  font-size: 3rem;
  margin-bottom: 8px;
}
.quiz-result__score {
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 900;
  color: var(--secondary-color);
  line-height: 1;
  margin: 8px 0 6px;
}
.quiz-result__score span {
  color: var(--primary-color);
}
.quiz-result__message {
  font-size: 1.05rem;
  color: #334155;
  margin: 10px 0 18px;
  line-height: 1.5;
}
.quiz-result__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.quiz-result__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid #dde8e2;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 14px;
}
/* Calculator - Méditerranéen */
.calculator {
  background: linear-gradient(135deg, var(--primary-light), #fdfbf7);
  padding: 18px;
  border-radius: var(--border-radius);
  margin: 16px 0;
  border: 1px solid #dde8e2;
  box-shadow: var(--box-shadow);
}
.calculator h3 {
  margin-top: 0;
  color: var(--dark-color);
  font-size: 1.1rem;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--dark-color);
  font-size: 0.95rem;
}
.form-group input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 12px 14px;
  border: 2px solid #ddd;
  border-radius: var(--border-radius-sm);
  font-size: 16px; /* anti-zoom iOS */
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  background: white;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}
.form-error {
  margin-top: 10px;
  padding: 12px 14px;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-left: 4px solid #c62828;
  border-radius: var(--border-radius-sm);
  color: #b71c1c;
  font-size: 0.92rem;
  font-weight: 600;
  display: none;
}
.form-error.is-visible {
  display: block;
}
.result {
  margin-top: 16px;
  padding: 16px;
  background-color: white;
  border-radius: var(--border-radius-sm);
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.5;
  display: none;
  border: 1px solid #e0e0e0;
}
.result.show {
  display: block;
}
.result.maigre {
  background-color: #e3f2fd;
  color: #0d47a1;
  border-color: #90caf9;
}
.result.normal {
  background-color: #e8f5e9;
  color: var(--dark-color);
  border-color: #a5d6a7;
}
.result.surpoids {
  background-color: #fff3e0;
  color: #bf360c;
  border-color: #ffcc80;
}
.result.obesite-modere {
  background-color: #ffebee;
  color: #c62828;
  border-color: #ef9a9a;
}
.result.obesite-severe {
  background-color: #ffcdd2;
  color: #b71c1c;
  border-color: #ef5350;
}
/* Resource grids - 1 col mobile */
.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}
.resource-card {
  background: white;
  padding: 16px;
  border-radius: var(--border-radius);
  border: 1px solid #e6e8e6;
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--box-shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.resource-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}
.resource-card h4 {
  margin-top: 0;
  color: var(--dark-color);
  font-size: 1rem;
}
.resource-card p {
  font-size: 0.95rem;
  margin: 8px 0;
}
.resource-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
}
.resource-card a:hover {
  text-decoration: underline;
}
/* Modals - fullscreen mobile, centered desktop */
.modal {
  display: none;
  position: fixed;
  z-index: 300;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  padding: 0;
  backdrop-filter: blur(2px);
}
.modal.is-open {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-content {
  background-color: white;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--box-shadow-lg);
  position: relative;
  animation: slideUp 0.28s ease;
}
.close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: bold;
  color: #777;
  cursor: pointer;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  line-height: 1;
}
.close:hover {
  color: var(--dark-color);
  background: #e0e0e0;
}
/* Printables hidden */
.printable {
  display: none;
}
@media print {
  body * {
    visibility: hidden;
  }
  .printable,
  .printable * {
    visibility: visible;
  }
  .printable {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
  }
  .no-print {
    display: none !important;
  }
  section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
/* Info cards - Méditerranéen */
.positive-message {
  background: linear-gradient(135deg, var(--success-light), #fef9ec);
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  margin: 14px 0;
  border-left: 4px solid var(--primary-color);
  font-style: italic;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(26, 147, 111, 0.07);
}
.tip {
  background: linear-gradient(135deg, var(--accent-light), #fff7ed);
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  margin: 14px 0;
  border-left: 4px solid var(--accent-warm);
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(244, 162, 97, 0.08);
}
.waist-info {
  background: linear-gradient(135deg, var(--secondary-light), #f0f9ff);
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  margin: 14px 0;
  border-left: 4px solid var(--secondary-color);
}
/* Tables - mobile card transform */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px -16px;
  padding: 0 16px;
  scrollbar-width: thin;
}
.table-wrapper::-webkit-scrollbar {
  height: 6px;
}
.table-wrapper::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.info-table,
.program-table,
.tracking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}
.info-table {
  min-width: 520px;
}
.info-table th,
.info-table td,
.program-table th,
.program-table td,
.tracking-table th,
.tracking-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}
.info-table th,
.program-table th,
.tracking-table th {
  background-color: var(--light-color);
  font-weight: 700;
  color: var(--dark-color);
  white-space: nowrap;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.info-table tr:nth-child(even),
.tracking-table tr:nth-child(even) {
  background-color: #fafafa;
}
/* Transform .info-table into cards on very small screens */
@media (max-width: 640px) {
  .info-table--cards {
    min-width: 0;
    display: block;
  }
  .info-table--cards thead {
    display: none;
  }
  .info-table--cards tbody,
  .info-table--cards tr,
  .info-table--cards td {
    display: block;
    width: 100%;
  }
  .info-table--cards tr {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius-sm);
    padding: 8px 0;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }
  .info-table--cards td {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px;
    text-align: right;
    font-size: 0.92rem;
  }
  .info-table--cards td:last-child {
    border-bottom: none;
  }
  .info-table--cards td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--dark-color);
    text-align: left;
    flex-shrink: 0;
    max-width: 45%;
  }
}
/* Day menu table (regime) - mobile cards */
.day-menu-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.95rem;
}
.day-menu-table th,
.day-menu-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}
.day-menu-table th {
  background-color: var(--light-color);
  font-weight: 700;
  color: var(--dark-color);
}
@media (max-width: 640px) {
  .day-menu-table thead {
    display: none;
  }
  .day-menu-table,
  .day-menu-table tbody,
  .day-menu-table tr,
  .day-menu-table td {
    display: block;
    width: 100%;
  }
  .day-menu-table tr {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
  }
  .day-menu-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
  }
  .day-menu-table td:first-child {
    background: var(--light-color);
    font-weight: 700;
    color: var(--dark-color);
    justify-content: flex-start;
    text-align: left;
  }
  .day-menu-table td:last-child {
    border-bottom: none;
  }
}
.instruction-steps {
  background-color: #fff;
  padding: 16px;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--primary-color);
  margin: 14px 0;
}
.instruction-steps ol {
  padding-left: 18px;
}
.instruction-steps li {
  margin-bottom: 8px;
  font-size: 0.95rem;
}
/* Printable styles */
.print-header {
  text-align: center;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}
.print-title {
  color: var(--primary-color);
  margin: 0;
  font-size: 1.4rem;
}
.print-subtitle {
  color: var(--secondary-color);
  margin: 5px 0 0;
  font-style: italic;
}
.recipe-card {
  border: 1px solid #ddd;
  border-radius: var(--border-radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  page-break-inside: avoid;
}
.recipe-title {
  color: var(--primary-color);
  margin-top: 0;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  font-size: 1.05rem;
}
.recipe-meta {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 0.85rem;
  color: #666;
  gap: 12px;
  flex-wrap: wrap;
}
.ingredients-list {
  background-color: #f9f9f9;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  margin: 10px 0;
}
.ingredients-list ul {
  margin: 0;
  padding-left: 18px;
}
.instructions-list {
  padding-left: 18px;
}
.instructions-list li {
  margin-bottom: 6px;
}
.shopping-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.shopping-category {
  background-color: #f9f9f9;
  padding: 14px;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--primary-color);
}
.shopping-category h4 {
  margin-top: 0;
  color: var(--secondary-color);
  font-size: 0.98rem;
}
.shopping-category ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.shopping-category li {
  margin: 4px 0;
  font-size: 0.92rem;
}
.program-table th,
.program-table td {
  padding: 8px 10px;
  border: 1px solid #ddd;
  text-align: center;
  font-size: 0.85rem;
}
.program-table th {
  background-color: var(--light-color);
}
.tracking-table th,
.tracking-table td {
  padding: 8px 10px;
  border: 1px solid #ddd;
  text-align: left;
  font-size: 0.85rem;
}
.tracking-table th {
  background-color: var(--light-color);
}
.quotes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.quote-card {
  background-color: #fafafa;
  padding: 16px;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--accent-color);
  font-style: italic;
  page-break-inside: avoid;
  font-size: 0.95rem;
}
.quote-author {
  text-align: right;
  font-style: normal;
  font-weight: 700;
  margin-top: 8px;
  color: var(--secondary-color);
  font-size: 0.85rem;
}
/* Footer */
footer {
  text-align: center;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  color: #666;
  font-size: 0.85rem;
  line-height: 1.5;
}
/* Utilities */
.no-print {
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
/* ==========================================
 BREAKPOINTS - Mobile First (min-width)
 ========================================== */
/* 640px - large phones / phablets */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding: 0 20px;
  }
  section {
    padding: 24px 20px;
  }
  .calculator {
    padding: 20px;
  }
  .quiz-question {
    padding: 18px;
  }
  .shopping-list {
    grid-template-columns: 1fr 1fr;
  }
  .quotes-grid {
    grid-template-columns: 1fr 1fr;
  }
  .btn-print {
    width: auto;
  }
  .table-wrapper {
    margin: 16px 0;
    padding: 0;
  }
  .info-table {
    min-width: 0;
  }
  .program-table,
  .tracking-table {
    min-width: 0;
  }
  .modal-content {
    width: 90%;
    max-width: 640px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    max-height: 85dvh;
  }
  .modal.is-open {
    align-items: center;
    padding: 20px;
  }
}
/* 768px - tablets : show desktop menu, hide bottom nav */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
  .container {
    max-width: 720px;
    padding: 0 20px;
  }
  header {
    padding: 30px 20px;
    margin-bottom: 24px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
  }
  section {
    padding: 28px 24px;
    margin-bottom: 24px;
  }
  .menu {
    display: block;
    position: sticky;
    top: 16px;
    z-index: 100;
  }
  .menu ul {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
  }
  .bottom-nav {
    display: none;
  }
  .nav-drawer {
    display: none !important;
  }
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
  .quiz-options {
    grid-template-columns: 1fr 1fr;
  }
  .quiz-option {
    margin: 0;
  }
  html {
    scroll-padding-top: 16px;
  }
}
/* 1024px - desktop */
@media (min-width: 1024px) {
  .container {
    max-width: var(--content-max);
    padding: 0 20px;
  }
  .menu ul {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .quotes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .modal-content {
    max-width: 800px;
    padding: 28px;
  }
}
