/* ==========================================================================
   un jour - Design System & Stylesheet (App Version 2.0)
   Minimalisme Nordique / Zen, Ergonomie Professionnelle & Haute Performance
   ========================================================================== */

:root {
  /* Palette Mode Clair (Bege / Crème Naturel) */
  --bg-app: #F8F6F0;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1EFE8;
  --bg-card: rgba(255, 255, 255, 0.92);
  --border-subtle: #E6E2D8;
  --border-hover: #D0CBBF;
  --border-focus: #7E907B;

  --text-primary: #262927;
  --text-secondary: #636862;
  --text-muted: #8E948C;

  /* Accents Zen & Terres */
  --accent-sage: #7E907B;
  --accent-sage-dark: #637360;
  --accent-sage-soft: rgba(126, 144, 123, 0.14);
  --accent-slate: #6C7E8D;
  --accent-slate-soft: rgba(108, 126, 141, 0.12);
  --accent-warm: #C88D6A;
  --accent-warm-soft: rgba(200, 141, 106, 0.12);

  --shadow-xs: 0 1px 3px rgba(38, 41, 39, 0.03);
  --shadow-sm: 0 3px 10px rgba(38, 41, 39, 0.04);
  --shadow-md: 0 8px 24px rgba(38, 41, 39, 0.06);
  --shadow-lg: 0 16px 40px rgba(38, 41, 39, 0.08);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 160ms var(--ease-spring);
  --transition-normal: 260ms var(--ease-spring);

  --sidebar-width: 250px;
  --header-height: 68px;
}

[data-theme="dark"] {
  /* Palette Mode Sombre (Anthracite / Vert Olive Doux) */
  --bg-app: #131413;
  --bg-surface: #1B1D1B;
  --bg-surface-elevated: #242724;
  --bg-card: rgba(27, 29, 27, 0.88);
  --border-subtle: #2B2F2A;
  --border-hover: #3D423C;
  --border-focus: #8FA28C;

  --text-primary: #F0EDE6;
  --text-secondary: #A0A69D;
  --text-muted: #6E756B;

  --accent-sage: #8FA28C;
  --accent-sage-dark: #788A75;
  --accent-sage-soft: rgba(143, 162, 140, 0.16);
  --accent-slate: #8397A7;
  --accent-slate-soft: rgba(131, 151, 167, 0.15);
  --accent-warm: #D49D7E;
  --accent-warm-soft: rgba(212, 157, 126, 0.15);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* ==========================================================================
   HEADER PRINCIPAL DE L'APPLICATION
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(248, 246, 240, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal);
}

[data-theme="dark"] .app-header {
  background: rgba(19, 20, 19, 0.88);
}

.header-container {
  max-width: 1320px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-glyph {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-sage), var(--accent-slate));
  display: grid;
  place-items: center;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(126, 144, 123, 0.3);
}

.live-time-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-sage);
  box-shadow: 0 0 6px var(--accent-sage);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Barres d'ondes audio animées */
.audio-status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.audio-status-pill:hover {
  border-color: var(--accent-sage);
  color: var(--text-primary);
}

.soundwave-bars {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 12px;
}

.wave-bar {
  width: 2.5px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: height 0.2s ease, background-color 0.2s ease;
}

.soundwave-bars.active .wave-bar {
  background: var(--accent-sage);
  animation: wavePulse 1s infinite alternate ease-in-out;
}

.soundwave-bars.active .wave-bar:nth-child(1) { animation-delay: 0.1s; }
.soundwave-bars.active .wave-bar:nth-child(2) { animation-delay: 0.3s; }
.soundwave-bars.active .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.soundwave-bars.active .wave-bar:nth-child(4) { animation-delay: 0.4s; }

@keyframes wavePulse {
  0% { height: 3px; }
  100% { height: 12px; }
}

.icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--accent-sage);
  transform: translateY(-1px);
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-primary);
}

.avatar-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-sage);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.72rem;
}

/* ==========================================================================
   APP SHELL : SIDEBAR + MAIN CONTENT
   ========================================================================= */
.app-shell {
  display: flex;
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  gap: 1.75rem;
}

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-card);
  padding: 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.95rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.nav-item:hover svg {
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-sage-soft);
  color: var(--accent-sage-dark);
  font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
  color: var(--accent-sage);
}

.nav-item.active svg {
  color: var(--accent-sage);
}

.sidebar-quote-card {
  margin-top: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.sidebar-quote-card strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
}

/* Conteneur principal des vues */
.app-content {
  flex: 1;
  min-width: 0;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s var(--ease-spring);
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   NAVIGATION MOBILE (BOTTOM APP BAR)
   ========================================================================== */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(248, 246, 240, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 45;
  padding: 0.4rem 0.5rem 0.6rem;
  justify-content: space-around;
}

[data-theme="dark"] .mobile-nav-bar {
  background: rgba(19, 20, 19, 0.94);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.mobile-nav-item.active {
  color: var(--accent-sage);
  font-weight: 600;
}

@media (max-width: 860px) {
  .app-sidebar {
    display: none;
  }
  .mobile-nav-bar {
    display: flex;
  }
  .app-shell {
    padding-bottom: 5.5rem;
  }
}

/* ==========================================================================
   COMPOSANTS DE CARTES & TYPOGRAPHIE
   ========================================================================== */
.card-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.card-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-sage-soft) 0%, transparent 70%);
  pointer-events: none;
}

.view-header {
  margin-bottom: 1.6rem;
}

.view-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.8rem;
  background: var(--accent-sage-soft);
  color: var(--accent-sage-dark);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .view-badge {
  color: var(--accent-sage);
}

.view-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.view-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 650px;
}

/* ==========================================================================
   TAB 1: RESPIRATION RYTHMÉE
   ========================================================================== */
.breathing-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0;
}

.breathing-mode-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: flex-start;
  max-width: 100%;
  width: auto;
  gap: 0.4rem;
  background: var(--bg-surface-elevated);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.breathing-mode-chips::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.chip-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.breath-visual-wrapper {
  position: relative;
  width: min(280px, 76vw);
  height: min(280px, 76vw);
  display: grid;
  place-items: center;
  margin: 1rem auto 2rem;
}

.breath-ring-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 4;
}

.ring-fill {
  fill: none;
  stroke: var(--accent-sage);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}

.breath-orb {
  width: min(170px, 46vw);
  height: min(170px, 46vw);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFFFFF, var(--accent-sage-soft) 45%, rgba(108, 126, 141, 0.25) 100%);
  box-shadow: 0 10px 35px rgba(126, 144, 123, 0.28), inset 0 2px 8px rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: scale(0.85);
  transition: transform 1s var(--ease-spring);
  z-index: 2;
}

[data-theme="dark"] .breath-orb {
  background: radial-gradient(circle at 35% 35%, #353B34, var(--accent-sage-soft) 55%, rgba(131, 151, 167, 0.15) 100%);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4), inset 0 1px 4px rgba(255, 255, 255, 0.15);
}

.breath-phase-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.breath-timer-text {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--accent-sage);
  font-variant-numeric: tabular-nums;
}

.breath-hint-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cycle-counter-badge {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-subtle);
}

.breath-action-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* ==========================================================================
   TAB 2: MINUTEUR POMODORO & INTENTION
   ========================================================================== */
.timer-hero-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0;
}

.focus-intention-input {
  width: 100%;
  max-width: 440px;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1.8rem;
  outline: none;
  transition: all var(--transition-fast);
}

.focus-intention-input:focus {
  border-color: var(--accent-sage);
  box-shadow: 0 0 0 3px var(--accent-sage-soft);
}

.timer-big-digits {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.timer-mode-pill {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.8rem;
}

.timer-mode-pill.work {
  background: var(--accent-sage-soft);
  color: var(--accent-sage-dark);
}

[data-theme="dark"] .timer-mode-pill.work {
  color: var(--accent-sage);
}

.timer-mode-pill.break {
  background: var(--accent-warm-soft);
  color: var(--accent-warm);
}

.timer-interval-selector {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 2rem;
}

/* ==========================================================================
   TAB 3: AMBIANCE SONORE (STUDIO MIXER 6 PISTES)
   ========================================================================== */
.mixer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}

.sound-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: all var(--transition-fast);
}

.sound-card.is-playing {
  border-color: var(--accent-sage);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.sound-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sound-card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sound-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  color: var(--accent-sage);
  border: 1px solid var(--border-subtle);
}

.sound-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.sound-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sound-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border-subtle);
  outline: none;
  cursor: pointer;
}

.sound-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-sage);
  border: 2px solid var(--bg-surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.sound-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.sound-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-sage);
  border: 2px solid var(--bg-surface);
  cursor: pointer;
}

.slider-val {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  width: 32px;
  text-align: right;
  color: var(--text-secondary);
}

/* ==========================================================================
   TAB 4: DÉCHARGE MENTALE (BLOC-NOTES VIDAGE D'ESPRIT)
   ========================================================================== */
.dump-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .dump-layout {
    grid-template-columns: 1fr;
  }
}

.dump-notepad {
  width: 100%;
  min-height: 280px;
  padding: 1.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
}

.dump-notepad:focus {
  border-color: var(--accent-sage);
  box-shadow: 0 0 0 3px var(--accent-sage-soft);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface-elevated);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.task-item.done {
  text-decoration: line-through;
  opacity: 0.55;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-sage);
}

/* ==========================================================================
   TAB 5: MICRO-ÉTIREMENTS BUREAU
   ========================================================================== */
.stretch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.stretch-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.stretch-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-sage);
  box-shadow: var(--shadow-sm);
}

.stretch-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.stretch-card p {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.stretch-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-sage-dark);
}

[data-theme="dark"] .stretch-timer-badge {
  color: var(--accent-sage);
}

/* ==========================================================================
   BOUTONS & COMMANDES UNIFIÉES
   ========================================================================== */
.btn-primary {
  background-color: var(--accent-sage);
  color: #FFFFFF;
  border: none;
  padding: 0.75rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  box-shadow: 0 3px 12px rgba(126, 144, 123, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-sage-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(126, 144, 123, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

/* ==========================================================================
   AUTHENTIFICATION / ÉCRAN D'ACCÈS
   ========================================================================== */
#auth-view {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  text-align: center;
  animation: fadeIn 0.35s var(--ease-spring);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.4rem 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ==========================================================================
   FOOTER & MODALES
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 2.2rem 0;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.footer-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 16, 15, 0.45);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-normal);
}

.modal-backdrop.is-open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.3rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.6rem;
  overflow-y: auto;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.modal-footer {
  padding: 1rem 1.6rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  background: var(--bg-surface-elevated);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   OPTIMISATIONS RESPONSIVES MOBILES POUSSÉES (SMARTPHONES & TABLETTES)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 58px;
  }

  /* Header mobile compact et épuré */
  .header-container {
    padding: 0 0.85rem;
    gap: 0.4rem;
  }

  .brand-section {
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .brand-logo {
    font-size: 1.12rem;
    gap: 0.45rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .brand-glyph {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .live-time-sep,
  .live-time-label {
    display: none;
  }

  .live-time-chip {
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  .header-tools {
    gap: 0.35rem;
  }

  .icon-btn {
    width: 33px;
    height: 33px;
  }

  /* Conteneur principal */
  .app-shell {
    padding: 0.75rem 0.85rem calc(5.2rem + env(safe-area-inset-bottom, 0px));
    gap: 0;
  }

  .card-hero {
    padding: 1.35rem 1.1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
  }

  .view-header {
    margin-bottom: 1.1rem;
  }

  .view-badge {
    padding: 0.2rem 0.65rem;
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
  }

  .view-title {
    font-size: 1.32rem;
    letter-spacing: -0.02em;
  }

  .view-sub {
    font-size: 0.83rem;
    line-height: 1.45;
  }

  /* Module Respiration mobile */
  .breathing-box {
    padding: 0.3rem 0;
  }

  .breathing-mode-chips {
    justify-content: flex-start;
    max-width: 100%;
    width: 100%;
    margin-bottom: 1.2rem;
    padding: 0.25rem;
  }

  .chip-btn {
    font-size: 0.75rem;
    padding: 0.38rem 0.8rem;
  }

  .breath-visual-wrapper {
    width: min(230px, 68vw);
    height: min(230px, 68vw);
    margin: 0.4rem auto 1.2rem;
  }

  .breath-orb {
    width: min(140px, 42vw);
    height: min(140px, 42vw);
  }

  .breath-phase-text {
    font-size: 1.05rem;
  }

  .breath-timer-text {
    font-size: 1.55rem;
  }

  .breath-hint-text {
    font-size: 0.68rem;
  }

  .breath-action-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
  }

  .btn-primary, .btn-secondary {
    padding: 0.65rem 1.15rem;
    font-size: 0.86rem;
  }

  /* Module Minuteur mobile */
  .timer-hero-box {
    padding: 0.4rem 0;
  }

  .focus-intention-input {
    font-size: 0.84rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1.2rem;
  }

  .timer-big-digits {
    font-size: clamp(2.8rem, 13vw, 3.8rem);
    margin-bottom: 0.5rem;
  }

  .timer-mode-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    margin-bottom: 1.2rem;
  }

  .timer-interval-selector {
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 0.3rem;
    margin-bottom: 1.3rem;
  }

  /* Module Mixer mobile */
  .mixer-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
  }

  .sound-card {
    padding: 0.95rem 1rem;
    gap: 0.65rem;
  }

  /* Module Décharge Mentale mobile */
  .dump-layout {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .dump-notepad {
    min-height: 180px;
    font-size: 0.88rem;
    padding: 0.9rem;
  }

  /* Module Étirements mobile */
  .stretch-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stretch-card {
    padding: 1.1rem;
  }

  /* Barre de navigation mobile */
  .mobile-nav-bar {
    padding: 0.35rem 0.3rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav-item {
    font-size: 0.65rem;
    padding: 0.3rem 0.4rem;
  }

  .mobile-nav-item svg {
    width: 18px;
    height: 18px;
  }

  /* Carte de connexion mobile */
  .auth-card {
    padding: 2.2rem 1.4rem;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 480px) {
  .audio-status-pill .sound-pill-text {
    display: none;
  }

  .audio-status-pill {
    padding: 0.38rem 0.55rem;
  }

  .user-profile-chip {
    padding: 0.2rem 0.45rem;
  }

  #user-email-display {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }
}
