/* Portail Famille Clinkss : clair, aéré, une couleur par application et par membre. */
:root {
  --page: #F6F8FB;
  --ink: #1C2433;
  --ink-2: #5A6476;
  --rule: #E3E8F0;
  --sky: #DDEBFF;      --sky-ink: #1D5BB8;
  --mint: #D9F2E5;     --mint-ink: #1C7350;
  --lav: #E9E3FF;      --lav-ink: #5536C9;
  --sun: #FFF0C2;      --sun-ink: #7F5B00;
  --rose: #FFE1E6;     --rose-ink: #B0324D;
  --peach: #FFE6D3;    --peach-ink: #9A4A12;
}
body.portail { background: var(--page); color: var(--ink); }

/* Le logo : six pastilles, une par membre de la famille */
.dots { display: inline-flex; gap: 4px; flex: none; }
.dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: #6FA8FF; } .dots i:nth-child(2) { background: #5CCB97; }
.dots i:nth-child(3) { background: #9B84FF; } .dots i:nth-child(4) { background: #FFCB45; }
.dots i:nth-child(5) { background: #FF8DA1; } .dots i:nth-child(6) { background: #FFA76B; }
.dots.big { gap: 8px; } .dots.big i { width: 20px; height: 20px; }

.pbar {
  display: flex; align-items: center; gap: 12px; max-width: 1040px; margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}
.pbar .wordmark { flex: 1; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.pbar .wordmark span { color: var(--ink-2); font-weight: 400; }
.who { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.who button { white-space: nowrap; font: inherit; border: 1px solid var(--rule); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 40px; }
.who button:hover { border-color: var(--ink-2); }

.pmain {
  max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px;
  padding: 28px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px));
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.08; }
.hero p { color: var(--ink-2); font-size: 1.05rem; margin-top: 8px; }

/* Les applications */
.apps-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .apps-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }
.app-tile {
  --bg: var(--sky); --fg: var(--sky-ink);
  position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 4px 18px; align-items: center;
  min-height: 132px; padding: 22px 22px 22px 20px; border-radius: 26px; background: var(--bg); color: var(--ink);
  text-decoration: none; border: 2px solid transparent; transition: transform .15s ease, border-color .15s ease;
}
.app-tile:hover { transform: translateY(-2px); border-color: var(--fg); }
.app-tile:active { transform: translateY(0); }
.app-tile:focus-visible { outline: 3px solid var(--fg); outline-offset: 3px; }
.app-tile .ico { grid-row: 1 / span 2; width: 64px; height: 64px; border-radius: 20px; background: #fff; color: var(--fg); display: grid; place-items: center; }
.app-tile .ico svg { width: 34px; height: 34px; }
.app-tile .nm { font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; line-height: 1.2; align-self: end; }
.app-tile .ds { color: var(--ink-2); font-size: .92rem; line-height: 1.45; align-self: start; }
.app-tile .ext { position: absolute; top: 16px; right: 18px; color: var(--fg); opacity: .7; }
.t-planning { --bg: var(--sky); --fg: var(--sky-ink); }
.t-revisions { --bg: var(--mint); --fg: var(--mint-ink); }
.t-finances { --bg: var(--sun); --fg: var(--sun-ink); }
@media (prefers-reduced-motion: reduce) { .app-tile, .app-tile:hover { transition: none; transform: none; } }

/* Espace parents */
.parents { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .parents { grid-template-columns: minmax(0, 640px); } }
.panel { background: #fff; border: 1px solid var(--rule); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel > h2 { font-size: 1.15rem; }
.panel .lead { color: var(--ink-2); font-size: .9rem; }

.mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mrow { display: flex; flex-direction: column; gap: 10px; padding-block: 14px; border-top: 1px solid var(--rule); }
.mrow:first-child { border-top: 0; padding-top: 2px; }
.mhead { display: flex; gap: 12px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; }
.mhead b { font-size: 1rem; }
.mhead .sub { margin-left: auto; }
.access { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle { position: relative; display: inline-flex; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.toggle span { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--rule); background: #fff; color: var(--ink-2); font-size: .88rem; }
.toggle input:checked + span { background: var(--bg, var(--sky)); color: var(--fg, var(--sky-ink)); border-color: transparent; font-weight: 500; }
.toggle input:checked + span::before { content: "✓"; }
.toggle input:focus-visible + span { outline: 3px solid var(--fg, var(--sky-ink)); outline-offset: 2px; }
.mactions { display: flex; gap: 14px; flex-wrap: wrap; }
.mactions button { font: inherit; font-size: .88rem; background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; }
.mactions button.danger { color: var(--bad); }
.pwf { display: flex; gap: 8px; }
.pwf input { flex: 1; min-width: 0; }
.confirm { background: var(--rose); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.addm summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--sky-ink); min-height: 44px; }
.addm summary::-webkit-details-marker { display: none; }
.addm summary::before { content: "+"; width: 28px; height: 28px; border-radius: 50%; background: var(--sky); display: grid; place-items: center; font-weight: 700; }
.addm[open] summary { margin-bottom: 10px; }
.addm fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.addm legend { font-weight: 500; font-size: .95rem; padding: 0; margin-bottom: 6px; }

.meter { display: block; height: 10px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.meter > span { display: block; height: 100%; background: #9B84FF; border-radius: 99px; }
.big-num { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.big-num small { font-size: .9rem; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }

/* Connexion */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--rule); border-radius: 28px; padding: 32px 26px; display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { font-size: 1.9rem; letter-spacing: -.02em; }
.login-card .lead { color: var(--ink-2); }
.portail input[type=text], .portail input[type=password], .portail select { background: var(--page); border-color: var(--rule); }
.portail input:focus, .portail select:focus { border-color: var(--sky-ink); }
.portail .btn { background: var(--ink); border-color: var(--ink); color: #fff; border-radius: 16px; }
.portail .btn.ghost { background: transparent; color: var(--ink); }
.portail .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.portail .btn.ghost.danger { background: transparent; color: var(--bad); }
.portail :focus-visible { outline-color: #6FA8FF; }
.notice { background: var(--sun); color: var(--sun-ink); padding: 12px 16px; border-radius: 14px; font-size: .95rem; }
@media (max-width: 480px) { .who .who-name { display: none; } }
@media (max-width: 480px) {
  .pbar { gap: 10px; }
  .pbar .dots { gap: 3px; } .pbar .dots i { width: 8px; height: 8px; }
  .pbar .wordmark { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
  .who button { padding: 4px 12px; font-size: .85rem; }
}
.lg-short { display: none; }
@media (max-width: 400px) { .lg-long { display: none; } .lg-short { display: inline; } }
