/* Portail famille : feuille de style unique (aucun style en ligne dans les pages) */

@font-face {
  font-family: 'Chewy';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/chewy-latin.woff2') format('woff2');
}

:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1d2330; --muted: #6b7385; --line: #e2e5eb;
  --accent: #c0392b; --accent-text: #ffffff; --ok: #1f9d55; --warn: #c77a00; --bad: #d33;
  --soft: #fbeceb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c; --card: #1b202b; --text: #e8ebf2; --muted: #98a0b3; --line: #2b3242;
    --accent: #ef6a5b; --accent-text: #1a0d0b; --ok: #3ccf7a; --warn: #f0a830; --bad: #ff7b7b;
    --soft: #2a1f22;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Bandeau : [accueil du portail] [message d'accueil] [roue + connexion] */
.bar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.bar-r { display: flex; gap: 8px; align-items: center; justify-self: end; }
.bar-r form { margin: 0; }
.bar-c { text-align: center; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar a.icon { border: 1px solid var(--line); border-radius: 10px; font-size: 18px; padding: 5px 9px; line-height: 1; text-decoration: none; }
@media (max-width: 520px) {
  .bar { grid-template-columns: auto 1fr; row-gap: 4px; }
  .bar-c { grid-column: 1 / -1; order: 3; text-align: left; font-size: 14px; }
}
.linkbtn { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.big { font-size: 18px; }

.app { max-width: 960px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 0 0 12px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 22px 0 8px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.first { margin-top: 0; }
.mt { margin-top: 12px; }
.center { text-align: center; }
.right { text-align: right; }
.hidden { display: none !important; }
.narrow { max-width: 520px; margin: 0 auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 120px; }

label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
input, select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
input[type="checkbox"] { width: 20px; height: 20px; padding: 0; accent-color: var(--accent); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .btn { display: inline-block; font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 11px 16px; background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; }
button.block, .btn.block { display: block; width: 100%; margin-top: 14px; text-align: center; }
button.sec, .btn.sec { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.small, .btn.small { padding: 6px 12px; font-size: 13px; }
button.xl { font-size: 18px; padding: 16px; }
button:disabled { opacity: .45; cursor: not-allowed; }

.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.hint.first { margin-top: 0; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }

.notice { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.notice-ok { border-color: var(--ok); }
.notice-warn { border-color: var(--warn); }
.notice-error { border-color: var(--bad); color: var(--bad); }

/* Portail : division haute (photo 1/3 + texte) */
.split { display: grid; grid-template-columns: 1fr 2fr; padding: 0; overflow: hidden; }
.split img { width: 100%; height: 100%; min-height: 240px; object-fit: cover; object-position: 50% 30%; display: block; }
.hero-text { padding: 22px 26px; align-self: center; }
.hero-text p { margin: 0 0 12px; }
.hero-text p:last-child { margin: 0; }
.hero-text .lead { font-size: 20px; font-weight: 600; }
@media (max-width: 560px) { .split { grid-template-columns: 1fr; } .split img { min-height: 0; max-height: 280px; } }

/* Portail : liste des services */
.srv { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.srv:first-child { padding-top: 0; }
.srv:last-child { border: 0; padding-bottom: 0; }
.thumb { width: 76px; height: 76px; flex: none; border-radius: 12px; object-fit: cover; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.srv p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.soon { font-size: 18px; font-weight: 600; color: var(--muted); }
.soon small { font-weight: 400; font-size: 13px; }

/* Service Noël 2026 */
.noel-text { --noel-red: #b5121b; --noel-purple: #4a2c72; font-family: 'Chewy', 'Baloo 2', 'Arial Rounded MT Bold', ui-rounded, system-ui, sans-serif; font-size: 19px; line-height: 1.45; }
@media (prefers-color-scheme: dark) { .noel-text { --noel-red: #ff7b7b; --noel-purple: #bda0f2; } }
.noel-text p { margin: 0 0 12px; }
.noel-title { text-align: center; white-space: nowrap; font-weight: 400; font-size: clamp(20px, 6vw, 30px); line-height: 1.1; margin: 0 0 18px; color: var(--noel-purple); }
.noel-title .noel-big { font-size: 2em; color: var(--noel-red); }
.noel-title .tree { font-size: 1.8em; vertical-align: -0.1em; }
.noel-photo { width: 100%; display: block; border-radius: 14px; border: 1px solid var(--line); }
.reveal { text-align: center; padding: 22px 16px; background: var(--soft); border-radius: 14px; border: 1px solid var(--line); margin-top: 14px; }
.reveal .big { font-size: 38px; font-weight: 700; margin: 6px 0; color: var(--noel-red); }

/* Administration */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { background: var(--card); color: var(--text); border: 1px solid var(--line); font-weight: 500; border-radius: 10px; padding: 11px 16px; text-decoration: none; }
.tab[aria-current="page"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td.c, th.c { text-align: center; }
td form { margin: 0; }
table.edit input:not([type="checkbox"]) { padding: 6px 8px; font-size: 14px; }
table.edit select { width: auto; padding: 6px 8px; font-size: 14px; }
.inv { flex-wrap: nowrap; }
/* Invitation : fenêtre d'aperçu modifiable */
textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; resize: none; overflow-x: hidden; overflow-y: auto; box-sizing: border-box; line-height: 1.45; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inv-title { font-size: 18px; margin: 0 0 6px; }
dialog h2 { margin-top: 14px; }
dialog { width: min(720px, calc(100% - 24px)); max-height: 92vh; overflow-x: hidden; overflow-y: auto; box-sizing: border-box; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.invite-preview { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 12px; font: inherit; font-size: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; max-height: 150px; overflow: auto; }
.inv-actions { gap: 8px; flex-wrap: wrap; }
.inv-actions .js-eye { padding: 11px 14px; line-height: 1; }
.inv-actions .js-eye.on { background: var(--soft); border-color: var(--accent); }
.textbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; font-weight: 500; cursor: pointer; }
code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.row.between { justify-content: space-between; }
.row.between h2 { margin: 22px 0 8px; }
.w-pseudo { min-width: 120px; }
.w-name { min-width: 95px; } .w-phone { min-width: 125px; } .w-email { min-width: 170px; } .w-addr { min-width: 150px; }
table.edit td, table.edit th { padding: 6px 4px; }
.w-serial { max-width: 220px; }
.tablewrap { overflow-x: auto; }
.blur { filter: blur(7px); user-select: none; pointer-events: none; }
.badge { display: inline-block; white-space: nowrap; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.bad { color: var(--bad); border-color: var(--bad); }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 6px 0; font-size: 14px; display: flex; gap: 8px; }
.spin { display: block; text-align: center; font-size: 34px; animation: tour 1.2s linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ok); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100% - 32px); z-index: 9; }
.toast.warn { background: var(--warn); }
