/* Majordomia — parcours d'accueil et compte (maquette « Inscription et compte », 2026-10-16) */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ground: #F4F6F2;
  --surface: #FFFFFF;
  --ink: #14201B;
  --muted: #4A5852;
  --faint: #7A8681;
  --line: #C9D2CD;
  --divider: #E8ECEA;
  --accent: #0F6E5C;
  --accent-ink: #0B5A4B;
  --accent-soft: #DDEBE5;
  --tint: #E6EEEA;
  --sarah: #F2A65A;
  --danger: #A33A22;
  --danger-line: #E5B9AE;
  --radius: 14px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }

.mj-shell {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.mj-shell.has-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.mj-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.mj-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.mj-step { font-size: 14px; color: var(--muted); }
.mj-back {
  width: 44px; height: 44px; border-radius: 22px; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
}

.mj-grow { flex-grow: 1; }
.mj-center { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.mj-stack { display: flex; flex-direction: column; gap: 12px; }

h1.mj-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.08; letter-spacing: -0.02em; }
h1.mj-hero { margin: 0; font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.05; letter-spacing: -0.025em; }
.mj-lead { margin: 0; font-size: 16px; color: var(--muted); }
.mj-lead strong { color: var(--ink); font-weight: 600; }
.mj-small { margin: 0; font-size: 14px; color: var(--muted); }
.mj-legal { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.mj-kicker { font-size: 14px; font-weight: 600; color: var(--accent); }

.mj-sarah { display: flex; align-items: flex-end; gap: 12px; }
.mj-avatar {
  width: 72px; height: 72px; border-radius: 36px; background: var(--sarah); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.mj-bubble {
  background: var(--surface); border-radius: 20px 20px 20px 6px; padding: 14px 16px; font-size: 15px; line-height: 1.45;
  box-shadow: 0 1px 2px rgba(20, 32, 27, .06), 0 6px 20px rgba(20, 32, 27, .06);
}
.mj-icon-tile {
  width: 56px; height: 56px; border-radius: 18px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}

form.mj-form { margin: 0; display: flex; flex-direction: column; gap: 18px; }
.mj-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mj-field label, .mj-legend { font-size: 14px; font-weight: 600; }
fieldset.mj-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.mj-legend { padding: 0; margin-bottom: 8px; }
.mj-input {
  width: 100%; height: 54px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 16px; font: inherit; font-size: 17px; color: var(--ink);
}
.mj-input::placeholder { color: var(--faint); }
.mj-input:focus { outline: none; border: 2px solid var(--accent); padding: 0 15.5px; }
.mj-input.is-invalid { border-color: var(--danger); }
.mj-input.center { text-align: center; padding: 0 8px; }
.mj-code {
  height: 64px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 32px;
  letter-spacing: .42em; padding: 0 0 0 .42em;
}
.mj-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mj-date { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 10px; }
.mj-error { margin: 0; font-size: 13.5px; color: var(--danger); }
.mj-check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; min-height: 44px; }
.mj-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }

.mj-btn {
  min-height: 54px; border-radius: var(--radius); border: 0; background: var(--accent); color: #FFFFFF;
  font: inherit; font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; padding: 0 20px; width: 100%;
}
.mj-btn:hover { background: var(--accent-ink); color: #FFFFFF; }
.mj-btn-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; text-decoration: underline; min-height: 44px; }
.mj-btn-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.mj-btn-danger {
  min-height: 48px; border-radius: var(--radius); border: 1.5px solid var(--danger-line); background: transparent; color: var(--danger);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
}
.mj-btn-quiet {
  min-height: 44px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; padding: 0 16px;
}
.mj-split { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }

.mj-alert { border-radius: var(--radius); padding: 12px 14px; font-size: 14.5px; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; }
.mj-alert.error { background: #FBE9E4; color: #7A2A17; }
.mj-alert.ok { background: var(--accent-soft); color: #0A4A3E; }
.mj-alert.info { background: var(--tint); color: #2E3B35; font-size: 13.5px; }
.mj-alert svg { flex-shrink: 0; margin-top: 2px; }

.mj-card { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 20px; box-shadow: 0 1px 2px rgba(20, 32, 27, .06), 0 6px 20px rgba(20, 32, 27, .05); }
.mj-card > li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 72px; }
.mj-card > li + li { border-top: 1px solid var(--divider); }
.mj-ext-icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink); }
.mj-ext-icon.voice { background: #FBE3C8; }
.mj-ext-icon.cart { background: var(--accent-soft); }
.mj-ext-icon.calendar { background: #DCE6F7; }
.mj-ext-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mj-ext-text strong { font-weight: 600; font-size: 16px; }
.mj-ext-text span { font-size: 13.5px; color: var(--muted); }
.mj-pill { font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.mj-pill.off { color: var(--muted); background: var(--tint); }
.mj-pill-action { font-size: 14px; font-weight: 600; color: #FFFFFF; background: var(--ink); border-radius: 999px; padding: 0 14px; min-height: 36px; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.mj-pill-action:hover { color: #FFFFFF; background: #000; }

.mj-mic-zone { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 12px 0; }
.mj-mic {
  width: 96px; height: 96px; border-radius: 48px; background: var(--accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 10px rgba(15, 110, 92, .12), 0 0 0 22px rgba(15, 110, 92, .06);
}
.mj-mic:hover { color: #FFFFFF; background: var(--accent-ink); }

.mj-section { display: flex; flex-direction: column; gap: 8px; }
.mj-section h2 { margin: 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mj-panel { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.mj-identity { display: flex; align-items: center; gap: 14px; }
.mj-initials { width: 56px; height: 56px; border-radius: 28px; background: var(--sarah); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 21px; flex-shrink: 0; }
.mj-verified { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); word-break: break-all; }

.mj-nav {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid #E1E6E3;
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
}
.mj-nav ul { list-style: none; margin: 0 auto; padding: 0; max-width: 440px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mj-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px;
  font-size: 12.5px; font-weight: 600; text-decoration: none; border-radius: 14px; color: var(--muted);
}
.mj-nav a[aria-current="page"] { color: var(--accent); background: var(--tint); }

@media (min-width: 720px) {
  .mj-shell { padding-top: 48px; }
}

/* Paramètres du majordome : choix de l'apparence */
.look-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.look-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 1.5px #E1E6E3; cursor: pointer; }
.look-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.look-tile:has(input:checked) { box-shadow: 0 0 0 3px var(--accent); }
.look-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.look-art { width: 72px; height: 72px; display: block; }
.look-upload { border-radius: 50%; border: 2.5px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); box-sizing: border-box; overflow: hidden; }
.look-upload img { width: 100%; height: 100%; object-fit: cover; }
.look-label { font-size: 13.5px; font-weight: 600; }
.mj-nav a span { max-width: 100%; padding: 0 4px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Abonnement (Mon compte, Mon abonnement) */
.sub-card { gap: 12px; }
.sub-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sub-card-head strong { font-family: var(--display); font-size: 19px; }
.sub-ok, .sub-warn { font-size: 14px; font-weight: 600; white-space: nowrap; }
.sub-ok { color: var(--accent-ink); }
.sub-warn { color: var(--danger); }
.sub-bar { height: 8px; border-radius: 4px; background: var(--tint); overflow: hidden; }
.sub-bar span { display: block; height: 8px; background: var(--accent); }
.sub-ended { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding-top: 8px; }
.sub-ended .mj-title { font-size: 30px; line-height: 1.1; }
.sub-clock { width: 112px; height: 112px; border-radius: 50%; background: var(--tint); display: flex; align-items: center; justify-content: center; }
.sub-period { display: inline-flex; align-self: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1.5px #E1E6E3; }
.sub-period a { min-height: 40px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.sub-period a[aria-current] { background: var(--accent); color: #FFFFFF; }
.sub-plans { display: flex; flex-direction: column; gap: 12px; }
.sub-plan { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; background: var(--surface); cursor: pointer; box-shadow: 0 0 0 1.5px #E1E6E3; }
.sub-plan:has(input:checked) { box-shadow: 0 0 0 2px var(--accent); }
.sub-plan-head { display: flex; align-items: center; gap: 12px; }
.sub-plan-head input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.sub-plan-head strong { flex-grow: 1; font-family: var(--display); font-size: 21px; }
.sub-price { font-weight: 600; font-size: 15px; text-align: right; }
.sub-plan-text { font-size: 14.5px; color: var(--muted); line-height: 1.45; padding-left: 34px; }
.sub-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-actions a { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.mj-btn-quiet.danger { color: var(--danger); border-color: var(--danger-line); }

/* Connecteurs (Moi › Mes connecteurs) */
.cn-list > li { padding: 0; min-height: 0; }
.cn-list > li > a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px 12px 16px; min-height: 64px; color: var(--ink); text-decoration: none; box-sizing: border-box; }
.cn-dot { width: 12px; height: 12px; border-radius: 6px; flex-shrink: 0; }
.cn-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.cn-text strong { font-size: 16px; font-weight: 600; }
.cn-text span { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.cn-pill { font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; white-space: nowrap; background: var(--tint); color: var(--muted); flex-shrink: 0; }
.cn-pill.def { background: var(--accent-soft); color: var(--accent-ink); }
.cn-pill.err { background: #F8E3DC; color: var(--danger); }
.cn-add { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 16px; border: 1.5px dashed var(--line); color: var(--accent); font-weight: 600; font-size: 16px; text-decoration: none; }
.cn-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cn-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: var(--surface); text-decoration: none; color: var(--ink); min-height: 96px; box-sizing: border-box; box-shadow: 0 1px 2px rgba(20, 32, 27, .06); }
.cn-tile strong { font-size: 15px; font-weight: 600; line-height: 1.2; }
.cn-tile > span:last-child { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.cn-badge { width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #FFFFFF; flex-shrink: 0; }
.cn-colors { display: flex; gap: 10px; flex-wrap: wrap; }
.cn-color { position: relative; width: 36px; height: 36px; border-radius: 18px; background: var(--c); cursor: pointer; }
.cn-color input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cn-color:has(input:checked) { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.cn-color:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; }
.cn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cn-more summary, .cn-help summary { font-weight: 600; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.cn-help ol { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; }
.app-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.app-chips button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px #E1E6E3; }
.app-chips button[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; box-shadow: none; }
.app-chips i { width: 10px; height: 10px; border-radius: 5px; display: inline-block; }

/* Produits et prix (Moi › Mes produits) */
.pr-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px #E1E6E3; }
.pr-chip[aria-current] { background: var(--ink); color: #FFFFFF; box-shadow: none; }
.pr-import { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.pr-import > span { display: flex; flex-direction: column; }
.pr-import strong { font-size: 15px; }
.pr-import > span > span { font-size: 13px; }
.pr-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; padding: 0 14px; height: 46px; box-shadow: inset 0 0 0 1.5px #E1E6E3; }
.pr-search input { border: 0; outline: 0; font: inherit; font-size: 15px; flex-grow: 1; background: transparent; min-width: 0; }
.pr-aisle { color: var(--accent) !important; }
.pr-price { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.pr-price strong { font-size: 15px; white-space: nowrap; }
.pr-price span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pr-price.big strong { font-family: var(--display); font-size: 22px; }
.pr-offer { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--surface); cursor: pointer; box-shadow: inset 0 0 0 1.5px #E1E6E3; }
.pr-offer.usual, .pr-offer:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.pr-offer-head { display: flex; align-items: flex-start; gap: 10px; }
.pr-offer-head input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.pr-offer-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.pr-offer-text strong { font-size: 16px; }
.pr-offer-text span { font-size: 14px; color: #2E3B35; line-height: 1.35; }
.pr-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px; background: var(--ground); color: var(--accent); font-weight: 600; font-size: 15px; text-decoration: none; }
.pr-del { margin: -6px 4px 0; }
.pr-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pr-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--tint); color: var(--muted); }
.pr-counts .pr-tag { font-size: 12.5px; padding: 4px 10px; }
.pr-tag.new { background: var(--accent-soft); color: var(--accent-ink); }
.pr-tag.upd { background: #E3ECF7; color: #1F4E8C; }
.pr-tag.chk { background: #FBE7CF; color: #8A4B0B; }
.pr-review > li { align-items: center; gap: 10px; padding: 10px 14px; min-height: 0; }
.pr-review > li > input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; margin: 0; }
.pr-review-text { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.pr-review-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pr-review-name input { font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); border: 0; border-bottom: 1.5px dashed var(--line); background: transparent; padding: 2px 0; min-width: 0; flex: 1 1 auto; width: 100%; }
.pr-review-name input:focus { outline: none; border-bottom-color: var(--accent); }
.pr-review-label { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-review > li:has(input[type=checkbox]:not(:checked)) .pr-review-text, .pr-review > li:has(input[type=checkbox]:not(:checked)) .pr-price { opacity: .45; }
.app-sub { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.app-price { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-size: 14px; }
.app-price strong { font-weight: 600; white-space: nowrap; }
.app-total { position: sticky; bottom: calc(var(--nav-h, 76px) + 8px); background: var(--surface); border-radius: 16px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 4px 18px rgba(20, 32, 27, .12); }
.app-total > div { display: flex; justify-content: space-between; align-items: baseline; }
.app-total strong { font-family: var(--display); font-size: 22px; }
.app-estimate { width: 100%; min-height: 48px; }
.app-match { gap: 10px; }
.app-match-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-top: 1px solid var(--divider); padding-top: 10px; font-size: 15px; }
.app-match-row > span:first-child { min-width: 0; }
.app-match-btns { display: flex; gap: 6px; flex-shrink: 0; }
.app-match-btns button { min-height: 40px; padding: 0 12px; }
.pr-move { border-top: 1px solid var(--divider); padding-top: 8px; }
.pr-move:first-child { border-top: 0; padding-top: 0; }
.pr-move summary { cursor: pointer; font-size: 14.5px; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.ext-code { font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: .12em; text-align: center; padding: 14px; border-radius: 14px; background: var(--ground); color: var(--accent-ink); }
