/* papmam — thème « myosotis » : bleu doux et miel, pensé pour la lisibilité et le calme.
   Typographie : Fraunces (titres, chaleureuse) + Lexend (texte, conçue pour faciliter la lecture : lettres bien espacées, zéro sans barre). */
@font-face { font-family: "Lexend"; src: url(/fonts/lexend-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(/fonts/fraunces-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --fs: 22px;
  --brume: #f4f8f9;
  --surface: #ffffff;
  --encre: #1f3a5f;
  --encre-douce: #51657f;
  --ligne: #d5e1ea;
  --myosotis: #2d5c9a;
  --myosotis-ink: #ffffff;
  --ciel: #e4eef9;
  --miel: #f0b13e;
  --miel-clair: #fcefd0;
  --miel-encre: #6b4100;
  --menthe: #2e7d6b;
  --menthe-clair: #ddf1ea;
  --peche: #fbe4d6;
  --peche-encre: #8a3f1d;
  --alerte: #c0261d;
  --alerte-ink: #ffffff;
  --focus: #f0b13e;
  --titres: "Fraunces", Georgia, "Times New Roman", serif;
  --texte: "Lexend", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brume: #0f1c2d; --surface: #172a42; --encre: #eaf1f8; --encre-douce: #a9bbd0; --ligne: #2b4263;
    --myosotis: #86b4ee; --myosotis-ink: #0f1c2d; --ciel: #1d3554; --miel-clair: #3b3015; --miel-encre: #f6d58d;
    --menthe: #6cc7b0; --menthe-clair: #14372f; --peche: #3a2a22; --peche-encre: #f2b698; --alerte: #d93a30;
  }
}

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--encre); font-family: var(--texte); line-height: 1.55; font-weight: 400;
  background-color: var(--brume);
  background:
    radial-gradient(60rem 28rem at 105% -8%, color-mix(in srgb, var(--miel) 22%, transparent), transparent 70%),
    radial-gradient(52rem 30rem at -10% -12%, color-mix(in srgb, var(--myosotis) 16%, transparent), transparent 70%),
    var(--brume);
  background-repeat: no-repeat;
}
h1, h2, h3 { font-family: var(--titres); font-weight: 600; line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 7vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--myosotis); text-underline-offset: .2em; }
.wrap { max-width: 760px; margin: 0 auto; padding: 1rem 1.1rem 2rem; }
.muted { color: var(--encre-douce); font-size: .85rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(9.6rem, 1fr)); }

/* ---- En-tête avec logo ---- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .4rem 0 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--encre); }
.brand img { width: 2.5rem; height: 2.5rem; display: block; }
.brand span { font-family: var(--titres); font-weight: 650; font-size: 1.7rem; letter-spacing: -.02em; }

/* ---- Boutons ---- */
button, .btn {
  font: inherit; font-weight: 700; cursor: pointer; color: var(--myosotis); background: var(--surface);
  border: 2.5px solid var(--myosotis); border-radius: 999px; padding: .7rem 1.2rem; min-height: 3.2rem;
}
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 4px solid var(--focus); outline-offset: 3px;
}
button.primary { background: var(--myosotis); color: var(--myosotis-ink); }
button.danger { background: var(--alerte); border-color: var(--alerte); color: var(--alerte-ink); }
button.small { min-height: 2.5rem; padding: .35rem .9rem; font-size: .85rem; border-width: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  font: inherit; width: 100%; padding: .7rem .9rem; color: var(--encre); background: var(--surface);
  border: 2px solid var(--ligne); border-radius: 16px;
}
input::placeholder, textarea::placeholder { color: var(--encre-douce); opacity: .8; }
label { display: block; font-weight: 700; margin: .7rem 0 .25rem; font-size: .9rem; }
label.check { display: flex; gap: .6rem; align-items: center; font-weight: 400; }
label.check input { width: 1.4rem; height: 1.4rem; accent-color: var(--myosotis); }

.card { background: var(--surface); border: 1.5px solid var(--ligne); border-radius: 28px; padding: 1.1rem 1.2rem; margin: 0 0 1.1rem; }

@media (max-width: 600px) { #services { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }

/* ---- Écran senior ---- */
.hello { margin: .2rem 0 .4rem; }
.hello h1 { margin-bottom: .15rem; }
.clock { font-size: 1rem; color: var(--encre-douce); }
.clock::first-letter { text-transform: uppercase; }

/* Le bouton micro est le cœur de la fleur : le geste principal de tout l'écran */
.mic-stage { display: grid; place-items: center; margin: .4rem 0 .2rem; }
.mic-wrap { position: relative; width: min(72vw, 19rem); aspect-ratio: 1; }
.petals { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; pointer-events: none; }
.mic {
  position: absolute; inset: 32%; z-index: 2; padding: 0; min-height: 0; border-radius: 50%;
  display: grid; place-items: center; color: #5a3500;
  background: radial-gradient(circle at 35% 28%, #ffdc93, #f0b13e);
  border: 4px solid var(--surface); box-shadow: 0 0 0 3px #f6cf86;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--miel) 55%, transparent);
}
.mic svg { width: 52%; height: 52%; }
.mic[aria-pressed="true"] { box-shadow: 0 0 0 6px #f0b13e; box-shadow: 0 0 0 6px color-mix(in srgb, var(--miel) 70%, transparent); }
.mic-label { text-align: center; font-family: var(--titres); font-weight: 600; font-size: 1.35rem; margin: .1rem 0 .6rem; min-height: 2rem; }

.bubble { background: var(--ciel); border-radius: 24px 24px 24px 8px; padding: .9rem 1.1rem; font-size: 1.12rem; min-height: 3.4rem; margin-top: .6rem; }
.bubble.me { background: var(--miel-clair); color: var(--miel-encre); border-radius: 24px 24px 8px 24px; }

.contact-btn {
  display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; margin: 0 0 .6rem;
  min-height: 4.4rem; padding: .5rem 1rem .5rem .6rem; color: var(--encre); background: var(--surface);
  border: 2px solid var(--ligne); border-radius: 999px;
}
.contact-btn .av { flex: none; width: 3.1rem; height: 3.1rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--peche); color: var(--peche-encre); font-family: var(--titres); font-weight: 700; font-size: 1.4rem; }
.contact-btn .who { flex: 1; line-height: 1.2; }
.contact-btn .who small { display: block; font-weight: 400; color: var(--encre-douce); font-size: .8rem; }
.contact-btn .tel { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--menthe-clair); color: var(--menthe); font-size: 1.2rem; }

.service-btn {
  min-height: 6.2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  border-radius: 24px; border: 2px solid var(--ligne); color: var(--encre); background: var(--surface); padding: .7rem .5rem;
  font-size: .92rem; line-height: 1.2;
}
.service-btn .ico { width: 2.9rem; height: 2.9rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: var(--ciel); }
.service-btn:nth-child(4n+2) .ico { background: var(--miel-clair); }
.service-btn:nth-child(4n+3) .ico { background: var(--menthe-clair); }
.service-btn:nth-child(4n) .ico { background: var(--peche); }

.callbar { position: sticky; top: .5rem; z-index: 10; background: var(--myosotis); color: var(--myosotis-ink); padding: .8rem 1.1rem;
  border-radius: 999px; margin-bottom: .75rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.callbar a { color: inherit; font-weight: 700; font-size: 1.15rem; }
.banner { background: var(--miel-clair); color: var(--miel-encre); border-radius: 18px; padding: .6rem 1rem; margin-bottom: .75rem; }
.checkin-btn { width: 100%; min-height: 5rem; font-size: 1.35rem; margin-bottom: .9rem; background: var(--menthe); border-color: var(--menthe); color: var(--brume); }

.sos { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: .7rem .9rem calc(.7rem + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--brume) 45%); }
.sos button { display: block; width: 100%; max-width: 760px; margin: 0 auto; min-height: 4.4rem; font-size: 1.35rem; }
body.senior .wrap { padding-bottom: 8rem; }
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(15, 28, 45, .7); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal .box { background: var(--surface); border: 3px solid var(--alerte); border-radius: 28px; padding: 1.3rem; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; }
.modal .box button { width: 100%; margin: .35rem 0; min-height: 4rem; font-size: 1.1rem; }

/* ---- Liaison de la tablette ---- */
.welcome { text-align: center; padding-top: 2rem; }
.welcome .logo-full { width: min(80%, 22rem); height: auto; margin: 0 auto 1rem; display: block; }
.welcome input#pairCode { font-size: 2rem; letter-spacing: .3em; text-align: center; padding: .8rem; }

/* ---- Espace famille ---- */
body.family { --fs: 17px; }
.tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs button { min-height: 2.6rem; padding: .4rem 1.1rem; border-width: 2px; border-color: var(--ligne); color: var(--encre); }
.tabs button[aria-selected="true"] { background: var(--myosotis); border-color: var(--myosotis); color: var(--myosotis-ink); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { color: var(--encre-douce); font-weight: 700; }
.pill { display: inline-block; padding: .1rem .65rem; border-radius: 99px; background: var(--menthe-clair); color: var(--menthe); font-size: .8rem; font-weight: 700; }
.pill.red { background: #f7d4d1; color: #7a1610; }
.code { font-family: var(--titres); font-size: 2.2rem; font-weight: 650; letter-spacing: .22em; background: var(--miel-clair); color: var(--miel-encre); padding: .5rem 1.1rem; border-radius: 20px; display: inline-block; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; background: var(--encre); color: var(--brume);
  padding: .7rem 1.2rem; border-radius: 999px; z-index: 50; max-width: 90vw; }

/* ---- Mouvement : un seul moment d'ouverture + la réponse au geste du senior ---- */
@media (prefers-reduced-motion: no-preference) {
  .petals { animation: bloom .9s cubic-bezier(.2, .8, .3, 1) both; transform-origin: 50% 50%; }
  .mic[aria-pressed="true"] + .petals { animation: breathe 2.6s ease-in-out infinite; }
  @keyframes bloom { from { transform: scale(.55) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045) rotate(2deg); } }
  button { transition: transform .08s; }
  button:active { transform: scale(.98); }
}

body.family .wrap { max-width: 980px; }

@media (max-width: 600px) {
  .service-btn { min-width: 0; padding: .7rem .2rem; font-size: .74rem; min-height: 5.6rem; overflow-wrap: break-word; hyphens: auto; line-height: 1.2; }
  .service-btn .ico { width: 2.5rem; height: 2.5rem; font-size: 1.3rem; }
  .card { padding: 1rem .9rem; }
}
