/* =====================================================================
   Les Tisseuses d'Harmonies — Calculateur Ming Gua
   Design system "app mobile moderne" — palette des maquettes PDF
   ===================================================================== */

:root {
  /* Palette */
  --beige-bg:   #EFE8D9;
  --beige-deep: #E4DAC6;
  --card-bg:    #FAF6EC;
  --cream:      #F4EFE3;
  --sage-90:    #4A553F;
  --sage-80:    #5F6C50;
  --sage-70:    #7A8B6D;
  --sage-60:    #9BAA8D;
  --coral:      #E87A6A;
  --coral-dark: #C8513E;
  --text-dark:  #353A2E;
  --text-body:  #4A4E40;
  --text-muted: #8A8472;
  --line:       #E4DBC8;

  /* Rayons */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* Ombres douces et superposées */
  --sh-1: 0 1px 2px rgba(53,58,46,.06), 0 2px 6px rgba(53,58,46,.05);
  --sh-2: 0 2px 6px rgba(53,58,46,.06), 0 8px 22px rgba(53,58,46,.09);
  --sh-3: 0 6px 16px rgba(53,58,46,.10), 0 18px 48px rgba(53,58,46,.16);
  --sh-coral: 0 6px 18px rgba(232,122,106,.35);
  --sh-sage:  0 8px 24px rgba(74,85,63,.30);

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-body);
  /* Fond ambiant dégradé pour donner de la profondeur (effet "app") */
  background:
    radial-gradient(120% 80% at 50% -10%, #5F6C50 0%, #4A553F 38%, transparent 70%),
    linear-gradient(180deg, #586247 0%, #45503b 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0 12px;
}

/* ====== COQUE TYPE APP (colonne téléphone) ====== */
.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: calc(100vh - 24px);
  margin: 12px 0;
  background: var(--beige-bg);
  position: relative;
  overflow: hidden;
  border: 3px solid var(--sage-90);
  border-radius: 28px;
}
@media (min-width: 520px) {
  .app-shell {
    margin: 22px 0;
    min-height: calc(100vh - 44px);
    border-radius: 34px;
    border-width: 4px;
    box-shadow: 0 30px 80px rgba(30,34,24,.45), 0 6px 18px rgba(30,34,24,.3);
  }
}

/* Filigrane lotus en fond, très discret */
.app-shell::before {
  content: "";
  position: absolute;
  top: -60px; right: -70px;
  width: 280px; height: 280px;
  background: url("assets/logo.png") no-repeat center / contain;
  opacity: .04;
  pointer-events: none;
  filter: grayscale(1);
}

/* ====== APP BAR ====== */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(239,232,217,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(228,219,200,.7);
}
.appbar .logo-box { height: 32px; width: 36px; overflow: hidden; display: flex; align-items: flex-start; justify-content: center; }
.appbar .logo-box img { width: 48px; height: auto; margin-top: -2px; opacity: .9; }
.appbar .wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage-80);
}

/* ====== STEP INDICATOR ====== */
.stepbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 14px 18px 2px;
}
.stepbar .seg {
  height: 4px;
  width: 42px;
  border-radius: var(--r-pill);
  background: var(--beige-deep);
  transition: background .4s var(--ease);
}
.stepbar .seg.active { background: var(--coral); }
.stepbar .lbl {
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

/* ====== LAYOUT ====== */
.app { padding: 18px 18px 48px; }

h1,h2,h3 { font-family: 'Cormorant Garamond', serif; color: var(--text-dark); font-weight: 600; line-height: 1.12; }
h1 { font-size: 2.35rem; }
h2 { font-size: 1.72rem; }
h3 { font-size: 1.25rem; }

.subtitle { font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--text-muted); font-size: 1.12rem; }
.muted { color: var(--text-muted); }
.center { text-align: center; }

.sep {
  width: 50px; height: 0; border: none;
  border-top: 1.5px solid var(--coral);
  margin: 12px auto;
}
.sep.left { margin: 10px 0; width: 34px; }

/* ====== ONBOARDING (formulaire) ====== */
.onboard { animation: rise .55s var(--ease) both; }
.onboard-hero {
  text-align: center;
  padding: 14px 6px 4px;
}
.onboard-hero .lotus {
  width: 76px; height: auto; margin: 6px auto 14px;
  display: block; opacity: .92;
}
.onboard-hero h1 { margin-bottom: 4px; }
.onboard-lead { color: var(--text-body); margin: 14px 4px 22px; font-size: .98rem; }

.card-form {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 18px;
  box-shadow: var(--sh-2);
}

form { display: grid; gap: 18px; }
.field label {
  display: block; font-weight: 600; font-size: .8rem;
  letter-spacing: .04em; margin-bottom: 8px; color: var(--text-dark);
  text-transform: uppercase;
}
input[type="date"], input[type="email"], input[type="text"] {
  width: 100%; padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 1rem; font-family: inherit;
  background: #fff; color: var(--text-dark);
  transition: border-color .2s, box-shadow .2s;
}
input:focus { outline: none; border-color: var(--sage-70); box-shadow: 0 0 0 4px rgba(122,139,109,.16); }

.segmented { display: flex; gap: 10px; }
.segmented label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; background: #fff; font-weight: 600; color: var(--text-body);
  transition: all .2s var(--ease); text-transform: none; letter-spacing: 0;
}
.segmented input { display: none; }
.segmented label:has(input:checked) {
  border-color: var(--sage-80); background: var(--sage-80); color: var(--cream);
  box-shadow: var(--sh-sage);
}

/* ====== BOUTONS ====== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 16px 20px; border: none; cursor: pointer;
  font-family: inherit; font-size: 1.02rem; font-weight: 700; letter-spacing: .02em;
  color: #fff; border-radius: var(--r-pill);
  background: linear-gradient(135deg, #F08877 0%, var(--coral) 55%, var(--coral-dark) 100%);
  box-shadow: var(--sh-coral);
  transition: transform .12s var(--ease), box-shadow .2s, filter .2s;
}
.btn:hover { filter: brightness(1.04); box-shadow: 0 10px 26px rgba(232,122,106,.45); }
.btn:active { transform: translateY(2px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.sage {
  background: linear-gradient(135deg, var(--sage-70) 0%, var(--sage-80) 60%, var(--sage-90) 100%);
  box-shadow: var(--sh-sage);
}
.btn .ic { width: 19px; height: 19px; display: inline-block; }

.error { color: var(--coral-dark); font-size: .85rem; margin-top: 2px; min-height: 1.05em; font-weight: 600; }
.onboard .footnote { text-align: center; color: var(--text-muted); font-size: .78rem; margin-top: 16px; }

/* ====== HERO RÉSULTAT ====== */
.result { animation: rise .5s var(--ease) both; }

.hero {
  position: relative; overflow: hidden;
  text-align: center; color: var(--cream);
  padding: 30px 20px 26px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 90% at 50% 0%, #6c7a5a 0%, #586247 45%, #434d39 100%);
  box-shadow: var(--sh-3);
  margin-bottom: 8px;
}
.hero::after { /* halo doux */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 12%, rgba(244,239,227,.18), transparent 70%);
  pointer-events: none;
}
.hero .lotus { width: 40px; height: auto; margin: 0 auto 10px; display: block;
  filter: brightness(0) invert(1); opacity: .85; }
.hero .num {
  font-family: 'Cormorant Garamond', serif; font-weight: 500;
  font-size: 5.6rem; line-height: .9; letter-spacing: .01em;
  text-shadow: 0 6px 30px rgba(0,0,0,.25);
}
.hero .char { font-size: 2.4rem; line-height: 1; margin: 6px 0 8px; opacity: .92; }
.hero .nom { font-family: 'Cormorant Garamond', serif; font-size: 1.55rem; letter-spacing: .1em; }
.hero .badge {
  display: inline-block; margin-top: 12px; padding: 7px 16px;
  background: rgba(244,239,227,.16); border: 1px solid rgba(244,239,227,.28);
  color: var(--cream); border-radius: var(--r-pill);
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  backdrop-filter: blur(4px);
}
.hero .meta { margin-top: 12px; font-size: .74rem; opacity: .72; letter-spacing: .04em; }

/* ====== SECTIONS ====== */
.section-head { text-align: center; margin: 30px 0 6px; }
.section-head .kicker {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--coral-dark); margin-bottom: 6px;
}
.section-intro {
  background: var(--card-bg);
  border-radius: var(--r-md);
  padding: 15px 17px; margin: 14px 0 18px;
  font-size: .9rem; color: var(--text-body); line-height: 1.55;
  border: 1px solid var(--line);
  position: relative;
}
.section-intro::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  background: var(--coral); border-radius: var(--r-pill);
}
.section-intro strong { color: var(--text-dark); font-weight: 700; }

/* ====== CARTE EMPLACEMENT ====== */
.empl {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px; margin-bottom: 12px;
  box-shadow: var(--sh-1);
  animation: rise .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: transform .18s var(--ease), box-shadow .2s;
}
.empl:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }

/* médaillon score */
.medallion {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; box-shadow: inset 0 -3px 8px rgba(0,0,0,.15), var(--sh-1);
}
.medallion .d { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.35rem; line-height: 1; }
.medallion .s { font-size: .72rem; font-weight: 700; opacity: .92; margin-top: 1px; }

.empl .body { min-width: 0; }
.empl .titleline { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.empl .titleline .qn { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.32rem; color: var(--text-dark); }
.empl .titleline .qc { font-size: 1.05rem; }
.empl .surnom { font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--text-muted); font-size: 1rem; margin-top: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 4px; }
.chip {
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(122,139,109,.14); color: var(--sage-90);
}
.chip.neg { background: rgba(200,81,62,.13); color: var(--coral-dark); }
.empl .desc { font-size: .85rem; line-height: 1.5; margin-top: 8px; color: var(--text-body); }
.empl .desc strong { color: var(--text-dark); font-weight: 700; }

/* accent couleur à gauche selon Qi */
.empl::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px;
  border-radius: var(--r-pill); background: var(--accent, var(--sage-70));
}

/* couleurs par score */
.sc-90  { background: linear-gradient(140deg,#5a6649,#4A553F); }
.sc-80  { background: linear-gradient(140deg,#6d7a5c,#5F6C50); }
.sc-70  { background: linear-gradient(140deg,#8a9a7c,#7A8B6D); }
.sc-60  { background: linear-gradient(140deg,#aab89c,#9BAA8D); }
.sc--60, .sc--70 { background: linear-gradient(140deg,#ef8a7a,#E87A6A); }
.sc--80, .sc--90 { background: linear-gradient(140deg,#d35e4a,#C8513E); }

/* ====== BLOC DIRECTIONS (24) ====== */
.qi-bloc {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 15px; margin-bottom: 11px;
  box-shadow: var(--sh-1);
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i,0) * 60ms);
}
.qi-bloc .head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.qi-bloc .pill {
  color: #fff; border-radius: var(--r-pill); padding: 4px 11px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.qi-bloc .qn { font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.12rem; color: var(--text-dark); }
.qi-bloc .qc { font-size: .98rem; }
.qi-bloc .mk { margin-left: auto; font-family: 'Cormorant Garamond', serif; font-style: italic; color: var(--text-muted); font-size: .9rem; text-align: right; }
.qi-bloc .rows { margin-top: 4px; }
.dir-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 4px; font-size: .9rem;
}
.dir-row + .dir-row { border-top: 1px solid var(--line); }
.dir-row .lbl {
  font-weight: 700; color: #fff; background: var(--sage-70);
  border-radius: 8px; text-align: center; padding: 4px 0; font-size: .78rem;
}
.dir-row.neg .lbl { background: var(--coral); }
.dir-row .mont { color: var(--text-dark); font-weight: 500; }
.dir-row .mont .c { margin-right: 7px; font-size: 1.05rem; }
.dir-row .deg { color: var(--text-muted); text-align: right; font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ====== CTA EMAIL (gating) ====== */
.cta {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 24px 20px; margin: 24px 0;
  color: var(--cream);
  background: radial-gradient(120% 100% at 0% 0%, #6c7a5a, #4A553F 80%);
  box-shadow: var(--sh-3);
}
.cta .lock {
  width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(244,239,227,.16); margin-bottom: 12px;
}
.cta .lock svg { width: 20px; height: 20px; stroke: var(--cream); }
.cta h3 { color: var(--cream); font-size: 1.5rem; margin-bottom: 8px; }
.cta p { font-size: .9rem; opacity: .92; margin-bottom: 16px; }
.cta p strong { color: #fff; }
.cta form { gap: 11px; }
.cta input { background: rgba(255,255,255,.95); border-color: transparent; }
.cta input:focus { box-shadow: 0 0 0 4px rgba(244,239,227,.25); }

/* ====== SUCCÈS / LIVRAISON ====== */
.success {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #8a9a7c, var(--sage-80));
  color: var(--cream); border-radius: var(--r-lg); padding: 18px 18px;
  margin-bottom: 8px; box-shadow: var(--sh-2);
}
.success .tick {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(244,239,227,.2); display: flex; align-items: center; justify-content: center;
}
.success .tick svg { width: 20px; height: 20px; stroke: var(--cream); }
.success .txt { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; line-height: 1.2; }

.deliver { margin-top: 16px; display: grid; gap: 12px; }

/* carte fiche PDF */
.pdf-card {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; text-align: center; box-shadow: var(--sh-2);
}
.pdf-card .doc {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 14px;
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-coral);
}
.pdf-card .doc svg { width: 26px; height: 26px; stroke: #fff; }
.pdf-card h3 { margin-bottom: 6px; }
.pdf-card p { font-size: .86rem; color: var(--text-body); margin-bottom: 14px; }

/* mot d'Aurélie */
.aurelie {
  display: flex; gap: 14px; align-items: center;
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; margin-top: 14px; box-shadow: var(--sh-1);
}
.aurelie img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: var(--sh-1); }
.aurelie .q { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.02rem; color: var(--text-dark); line-height: 1.3; }
.aurelie .sig { font-size: .78rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* ====== DIVERS ====== */
.restart {
  display: block; margin: 26px auto 0; background: transparent; border: none;
  color: var(--text-muted); font-family: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; padding: 8px; width: auto;
}
.restart:hover { color: var(--text-dark); }
.footer-note { margin-top: 18px; text-align: center; font-size: .74rem; color: var(--text-muted); line-height: 1.5; }

/* ====== ANIMATIONS ====== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
