/* =========================
   RESET + THEME
========================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

:root {
  --primary: #2E7D32;
  --primary-dark: #1B5E20;
  --secondary: #FF6F00;

  --bg: #F5F5F5;
  --surface: #FFFFFF;

  --text: #212121;
  --muted: #757575;

  --border: #E0E0E0;

  --success: #2E7D32;
  --danger: #D32F2F;
  --warning: #FF6F00;
  --info: #1976D2;

  --badge-boutique: #7B1FA2;
  --badge-massages: #2E7D32;
  --badge-sante: #1976D2;
  --badge-evenement: #FF6F00;

  --radius: 16px;
  --shadow: 0 6px 24px rgba(0,0,0,.08);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}

/* Accessibilité */
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  border: 2px solid var(--primary);
  padding: 10px 12px;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus { left: 12px; }

.hidden { display: none !important; }

button, input {
  font: inherit;
}

button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(102, 187, 106, 0.55);
  outline-offset: 2px;
}

.muted { color: var(--muted); }
.h2 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.h3 { font-size: 22px; font-weight: 900; }

/* =========================
   SCREENS (loading/auth)
========================= */
.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.screen--loading {
  background: var(--primary);
  color: white;
  padding-top: calc(20px + var(--safe-top));
}

.loading { display: grid; gap: 14px; place-items: center; }
.spinner {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.35);
  border-top-color: white;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

/* Auth card */
.auth {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth__header { text-align: center; margin-bottom: 18px; }
.auth__logo { font-size: 54px; }
.auth__title { font-size: 32px; color: var(--primary); font-weight: 900; }
.auth__subtitle { color: var(--muted); margin-top: 4px; }
.auth__form { display: grid; gap: 16px; margin-top: 18px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }

.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 700; }
.field input {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
}
.field input:focus { border-color: var(--primary); }

/* Buttons */
.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s ease, opacity .2s ease, background .2s ease;
}
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--block { width: 100%; }

.btn--primary { background: var(--primary); color: white; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn--outline:hover { background: rgba(46, 125, 50, 0.08); }

/* =========================
   APP LAYOUT
========================= */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg);
}

.app-header{
  /* Mobile-first: compact, "native app" top bar */
  position: sticky;
  top: 0;
  z-index: 50;
  padding: calc(12px + var(--safe-top)) 16px 10px;
  color: var(--text);
  background: rgba(255,255,255,0.86);
  border-bottom: 1px solid rgba(17,24,39,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* On retire le gros décor vert (trop "site web") */
.app-header::before,
.app-header::after{ content:none; }

.app-header__brand{
  position: relative;
  display:flex;
  align-items:center;
  gap:14px;
  z-index: 2;
}

.app-header__actions{
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  margin-top: 0;
  margin-left: auto;
  align-items: center;
}

.header-btn{
  pointer-events: auto;
}

.app-header__logo{
  width:42px;
  height:42px;
  object-fit: contain;
  background: linear-gradient(180deg, rgba(16,185,129,0.12), rgba(16,185,129,0.04));
  border: 1px solid rgba(16,185,129,0.18);
  border-radius: 14px;
  padding: 6px;
  flex: 0 0 auto;
}

.app-header__text{ min-width: 0; }

.app-header__title{
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .2px;
  line-height: 1.1;
}

.app-header__subtitle{
  opacity: .75;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
}

.app-header__meta{
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(17,24,39,0.70);
}

/* =========================
   HEADER ACTIONS (compact)
========================= */
.header-btn{
  border: 1px solid rgba(17,24,39,0.10);
  border-radius: 12px;
  padding: 9px 10px;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  background: rgba(17,24,39,0.03);
  color: var(--text);
  transition: transform .08s ease, opacity .2s ease, background .2s ease;
  white-space: nowrap;
}
.header-btn:active{ transform: scale(.99); }

.header-btn--primary{
  background: var(--primary);
  color: #fff;
  border-color: rgba(16,185,129,0.25);
}
.header-btn--primary:hover{ opacity: .95; }

.header-btn--ghost{
  background: rgba(17,24,39,0.02);
}
.header-btn--ghost:hover{ background: rgba(17,24,39,0.05); }


.app-main {
  flex: 1;
  padding-bottom: calc(74px + var(--safe-bottom));
  overflow-y: auto;
}

/* Tabs content */
.tab { display: none; }
.tab.active { display: block; }

/* Cards */
.card {
  background: var(--surface);
  margin: 12px 12px 0;
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.card__title { font-size: 18px; font-weight: 900; margin-bottom: 12px; }
.card--accent { border-left: 5px solid var(--secondary); }

.bullets { padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }

/* Lists */
.list {
  display: grid;
  gap: 12px;
}
.empty {
  padding: 16px;
  border-radius: 14px;
  background: rgba(0,0,0,.03);
  color: var(--muted);
  text-align: center;
}

/* =========================
   CHIPBAR (news filter)
========================= */
.chipbar {
  display: flex;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.chip {
  border: 1px solid var(--border);
  background: rgba(0,0,0,.03);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.chip--active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* =========================
   NEWS CARDS
========================= */
.news {
  display: grid;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.news:hover { transform: translateY(-1px); }
.news__img { width: 100%; height: 176px; object-fit: cover; background: var(--border); }
.news__body { padding: 14px; display: grid; gap: 8px; }
.news__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.news__title { font-size: 17px; font-weight: 900; }
.news__desc { color: var(--muted); font-size: 14px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: white;
}
.badge--Boutique { background: var(--badge-boutique); }
.badge--Massages { background: var(--badge-massages); }
.badge--Offres { background: var(--secondary); }
.badge--Santé { background: var(--badge-sante); }
.badge--Événement { background: var(--badge-evenement); }

/* =========================
   PROMOS
========================= */
.promo {
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  display: grid;
  gap: 10px;
}
.promo--inactive { opacity: .65; }

.promo__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.promo__badges { display: flex; gap: 8px; flex-wrap: wrap; }
.promo__type {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: white;
}
.promo__type--massage { background: var(--primary); }
.promo__type--boutique { background: var(--badge-boutique); }

.promo__active {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: var(--success);
  color: white;
}
.promo__save {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.promo__title { font-weight: 900; font-size: 18px; }
.promo__desc { color: var(--muted); font-size: 14px; }
.promo__box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(102, 187, 106, 0.18);
}
.promo__pct { font-size: 26px; font-weight: 1000; color: var(--primary); }
.promo__code {
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 900;
  color: var(--primary);
  background: white;
}
.promo__meta { color: var(--muted); font-size: 13px; }
.promo__cond { color: var(--muted); font-size: 12px; font-style: italic; }

/* =========================
   KEY-VALUE (schedule)
========================= */
.kv { display: grid; gap: 10px; }
.kv__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.kv__k { font-weight: 800; }
.kv__v { color: var(--muted); }

/* =========================
   APPOINTMENTS
========================= */
.apt {
  background: rgba(0,0,0,.03);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.apt__top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.apt__type { font-weight: 900; }

.status {
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  color: white;
}
.status--confirmé { background: var(--success); }
.status--annulé { background: var(--danger); }

/* =========================
   ACCORDION
========================= */
.accordion { padding: 12px; display: grid; gap: 10px; }
.acc {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  overflow: hidden;
}
.acc__btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.acc__title { font-weight: 900; font-size: 16px; }
.acc__icon { font-size: 22px; color: var(--primary); transition: transform .2s ease; }
.acc[aria-expanded="true"] .acc__icon { transform: rotate(180deg); }
.acc__panel {
  padding: 0 16px 16px;
  color: var(--muted);
  white-space: pre-line;
}

/* =========================
   CONTACT
========================= */
.contact { display: grid; gap: 10px; }
.contact__item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0,0,0,.03);
}
.contact__item a { color: var(--primary); text-decoration: none; font-weight: 900; }

/* =========================
   PROFILE
========================= */
.profile {
  margin: 12px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.profile__avatar { font-size: 64px; }
.profile__name { font-size: 22px; font-weight: 1000; margin-top: 6px; }
.profile__email { opacity: .92; }

/* =========================
   GAMES / QUIZ
========================= */
.games-view { display: none; }
.games-view--active { display: block; }

.progress { padding: 12px; }
.progress__bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress__fill { height: 100%; width: 0%; background: var(--primary); transition: width .2s ease; }
.progress__text { text-align: center; font-weight: 800; color: var(--muted); margin-top: 8px; }

.choices { display: grid; gap: 10px; }
.choice {
  border: 2px solid var(--border);
  background: white;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
}
.choice--selected { border-color: var(--primary); background: rgba(102,187,106,.1); }
.choice__dot {
  width: 22px; height: 22px; border: 2px solid var(--border);
  border-radius: 50%;
  display: grid; place-items: center;
}
.choice--selected .choice__dot { border-color: var(--primary); }
.choice__dot::after {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
}
.choice--selected .choice__dot::after { opacity: 1; }
.choice__text { font-weight: 700; }

.footer-actions {
  padding: 12px;
  display: grid;
  gap: 10px;
}

/* Results */
.result {
  background: var(--primary);
  color: white;
  margin: 12px;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.result__title { font-size: 20px; font-weight: 1000; }
.result__score {
  margin: 14px auto 8px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: white;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 1000;
  box-shadow: var(--shadow);
}
.result__scoreNum { font-size: 46px; }
.result__scoreTotal { color: var(--muted); font-size: 20px; }
.result__percent { font-weight: 900; }

/* Answer recap */
.answer {
  background: rgba(0,0,0,.03);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.answer__q { font-weight: 900; }
.answer__badge {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 1000;
}
.answer__badge--ok { background: var(--success); }
.answer__badge--no { background: var(--danger); }
.answer__meta { display: flex; justify-content: space-between; gap: 12px; }
.answer__wrong { color: var(--danger); font-weight: 800; }
.answer__right { color: var(--success); font-weight: 800; }
.answer__exp { color: var(--muted); font-style: italic; }

/* =========================
   BOTTOM TABS
========================= */
.tabs {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  display: flex;
  justify-content: space-around;
  z-index: 1000;
}

.tabbtn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
}
.tabbtn__icon { font-size: 22px; }
.tabbtn__label { font-size: 11px; font-weight: 800; }
.tabbtn--active { color: var(--primary); }

/* =========================
   MODAL
========================= */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0,0,0,.65);
  z-index: 2000;
  padding: 18px;
  overflow-y: auto;
}
.modal[aria-hidden="false"] { display: grid; place-items: start center; }
.modal__content {
  width: min(720px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: calc(10px + var(--safe-top));
  box-shadow: var(--shadow);
  position: relative;
}
.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.55);
  color: white;
  font-size: 24px;
  cursor: pointer;
}
.modal__img { width: 100%; height: 260px; object-fit: cover; background: var(--border); }
.modal__body { padding: 18px; }
.modal__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal__title { font-size: 24px; font-weight: 1000; margin-top: 10px; }
.modal__text { margin-top: 12px; }

/* Divider */
.divider { height: 3px; width: 64px; background: var(--primary); margin-top: 10px; border-radius: 999px; }

/* =========================
   TOAST
========================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(0,0,0,.84);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 3000;
}
.toast--show { opacity: 1; }

/* =========================
   DESKTOP
========================= */
@media (min-width: 900px) {
  .app { box-shadow: 0 0 24px rgba(0,0,0,.08); }
  .tabs { max-width: 520px; left: 50%; transform: translateX(-50%); }
}

/* =========================
   PROMOS — TOOLS (filters + search)
========================= */
.promo-tools{
  margin: 12px;
  display: grid;
  gap: 10px;
}

.promo-filters{
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.promo-tools__row{
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.promo-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.promo-toggle input{
  width: 18px;
  height: 18px;
}

.promo-search{
  flex: 1 1 220px;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.03);
  border: 1px solid var(--border);
  min-width: 220px;
}

.promo-search__icon{
  opacity: .8;
  font-weight: 900;
}

.promo-search__input{
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-weight: 800;
}

/* =========================
   PROMOS — COPY BUTTON
========================= */
.promo__codeWrap{
  display: flex;
  align-items: center;
  gap: 10px;
}

.promo__copy{
  border: 0;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 900;
  cursor: pointer;
  background: var(--primary);
  color: white;
}
.promo__copy:hover{ background: var(--primary-dark); }



/* =========================
   HOME (mobile-first)
========================= */
.home-quick{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px;
}
.quick-tile{
  border:none;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 12px 8px;
  color:#fff;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  font-weight: 900;
  cursor:pointer;
}
.quick-tile:active{ transform: scale(.99); }
.quick-tile__icon{ font-size: 18px; }
.quick-tile__label{ font-size: 12px; line-height: 1.1; }

.home-featured{ padding: 0 12px 8px; }

.home-tools{
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding-top: 10px;
}

.home-search{
  margin: 0 12px 10px;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  position: relative;
}
.home-search__icon{ color: var(--muted); font-weight: 900; }
.home-search__input{
  width:100%;
  border:none;
  outline:none;
  background: transparent;
  font-weight: 800;
}
.iconbtn{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.03);
  font-weight: 900;
  cursor: pointer;
}

.suggest{
  position:absolute;
  left: 10px;
  right: 10px;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  overflow: hidden;
}
.suggest__item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  width:100%;
  padding: 12px 12px;
  border:none;
  background: transparent;
  text-align:left;
  cursor:pointer;
}
.suggest__item + .suggest__item{ border-top: 1px solid var(--border); }
.suggest__title{ font-weight: 900; }
.suggest__meta{ color: var(--muted); font-size: 12px; font-weight: 800; }

/* Featured / large news card */
.news--featured{
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.news--featured .news__body{ padding: 16px; }
.news__metaRow{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.news__action{
  font-weight: 950;
  color: var(--primary-dark);
  background: rgba(46,125,50,0.10);
  border: 1px solid rgba(46,125,50,0.20);
  border-radius: 999px;
  padding: 8px 10px;
}

/* Link row card (profile shortcut) */
.card--link{ padding: 0; }
.rowlink{
  width:100%;
  border:none;
  background: transparent;
  padding: 14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  cursor:pointer;
}
.rowlink__left{ display:flex; align-items:center; gap:12px; }
.rowlink__icon{ width: 36px; height:36px; border-radius: 14px; background: rgba(0,0,0,.04); display:flex; align-items:center; justify-content:center; }
.rowlink__title{ font-weight: 950; }
.rowlink__sub{ color: var(--muted); font-weight: 800; font-size: 12px; margin-top: 2px; }
.rowlink__right{ color: var(--muted); font-size: 22px; font-weight: 900; }
