/* styles.css — charte « pastel doux » : rose, lavande, crème · Quicksand + Nunito */
:root[data-theme="light"] {
  --bg: #fbf3f6;
  --bg-2: #fffdfe;
  --surface: #fffafc;
  --surface-2: #f8edf2;
  --surface-3: #f1e3ea;
  --border: #f0e0e8;
  --border-2: #e6cfdb;
  --text: #3f2e3c;
  --text-2: #8a7585;
  --text-3: #b6a4b2;
  --accent: #e07a9c;          /* rose */
  --accent-2: #d2628a;
  --accent-soft: rgba(224, 122, 156, 0.12);
  --accent-glow: rgba(224, 122, 156, 0.28);
  --lav: #9d83c6;             /* lavande (badges « Bientôt ») */
  --lav-soft: rgba(157, 131, 198, 0.15);
  --danger: #e0685f;          /* corail doux */
  --danger-soft: rgba(224, 104, 95, 0.12);
  --shadow: 0 12px 38px rgba(160, 110, 140, 0.16);
  --on-accent: #fffafc;
}
:root[data-theme="dark"] {
  --bg: #1e1722;             /* prune profond */
  --bg-2: #271e2e;
  --surface: #271e2e;
  --surface-2: #322738;
  --surface-3: #3d2f44;
  --border: #3a2e42;
  --border-2: #4a3a54;
  --text: #f3e8f0;
  --text-2: #c2acbe;
  --text-3: #8b7589;
  --accent: #ef9fbb;          /* rose clair */
  --accent-2: #e688a8;
  --accent-soft: rgba(239, 159, 187, 0.14);
  --accent-glow: rgba(239, 159, 187, 0.26);
  --lav: #c3a9ec;            /* lavande clair */
  --lav-soft: rgba(195, 169, 236, 0.16);
  --danger: #f0918a;
  --danger-soft: rgba(240, 145, 138, 0.14);
  --shadow: 0 12px 38px rgba(0, 0, 0, 0.45);
  --on-accent: #2a1626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; padding-bottom: 150px;
  -webkit-font-smoothing: antialiased; transition: background 0.3s, color 0.3s;
}
h1, h2, h3 { font-family: "Quicksand", sans-serif; font-weight: 700; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

/* Splash */
#splash { position: fixed; inset: 0; z-index: 1000; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; transition: opacity 0.5s, visibility 0.5s; }
#splash.hide { opacity: 0; visibility: hidden; }
.splash-mark { animation: pop 0.7s cubic-bezier(0.22,1,0.36,1); }
.flame { animation: flicker 1.3s ease-in-out infinite; transform-origin: center; }
.flame:nth-of-type(2) { animation-delay: 0.2s; }
.flame:nth-of-type(3) { animation-delay: 0.4s; }
@keyframes flicker { 0%,100% { opacity: 1; transform: scaleY(1); } 50% { opacity: 0.6; transform: scaleY(0.7); } }
.splash-name { font-family: "Quicksand"; font-weight: 700; font-size: 1.25rem; color: var(--text-2); animation: fadeUp 0.6s 0.2s both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Offline */
#offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: var(--danger);
  color: #fff; text-align: center; font-size: 0.8rem; font-weight: 700; padding: 0; max-height: 0;
  overflow: hidden; transition: max-height 0.3s, padding 0.3s; }
#offline-banner.show { max-height: 40px; padding: 8px; }

/* Header */
#header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; gap: 12px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.4rem;
  background: var(--accent-soft); border-radius: 16px; border: 1px solid var(--border); }
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 1.3rem; line-height: 1.05; }
.brand-text p { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); transition: all 0.15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.icon-btn:active { transform: scale(0.94); }
.lang-btn { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }

/* Main */
#view { max-width: 760px; margin: 0 auto; padding: 18px; animation: viewIn 0.3s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.view-title { font-size: 1.45rem; margin-bottom: 16px; }

/* FAB */
.fab { position: fixed; right: 28px; bottom: calc(112px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 6px;
  padding: 13px 22px; border-radius: 30px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 0.92rem; box-shadow: 0 8px 24px var(--accent-glow); transition: all 0.15s; }
.fab:hover { background: var(--accent-2); }
.fab:active { transform: scale(0.96); }
.fab-plus { font-size: 1.25rem; line-height: 1; }

/* Nav */
#nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; gap: 6px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 26px; border-radius: 14px;
  color: var(--text-3); font-size: 0.7rem; font-weight: 700; transition: all 0.15s; }
.nav-btn .nav-icon { font-size: 1.2rem; filter: grayscale(0.35); transition: filter 0.15s; }
.nav-btn.active { color: var(--accent); background: var(--accent-soft); }
.nav-btn.active .nav-icon { filter: grayscale(0); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px;
  border-radius: 13px; font-weight: 700; font-size: 0.88rem; transition: all 0.15s; border: 1px solid transparent; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.btn-sm { padding: 8px 13px; font-size: 0.8rem; }
.btn.full { width: 100%; margin-top: 8px; }

/* Carte personne */
.person-card { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px;
  margin-bottom: 10px; cursor: pointer; transition: all 0.15s; }
.person-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.person-card.is-soon { border-color: var(--lav); box-shadow: 0 0 0 1px var(--lav-soft); }
.person-card.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); background: var(--accent-soft); }
.pc-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; flex-shrink: 0; font-family: "Quicksand"; }
.pc-info { min-width: 0; }
.pc-name { font-weight: 700; font-size: 1rem; font-family: "Quicksand"; display: flex; align-items: center; gap: 6px; }
.pc-zodiac { font-size: 0.85rem; opacity: 0.85; }
.pc-sub { font-size: 0.78rem; color: var(--text-2); margin-top: 1px; }
.pc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.pc-countdown { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.cd-num { font-family: "Quicksand"; font-weight: 700; font-size: 1.55rem; color: var(--accent); }
.cd-unit { font-size: 0.62rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.pc-badge { font-size: 0.66rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pc-badge.soon { background: var(--lav-soft); color: var(--lav); }
.pc-badge.today { background: var(--accent); color: var(--on-accent); font-size: 0.72rem; padding: 5px 12px; }

/* Calendrier */
.cal-head, .list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.list-count { font-size: 0.78rem; color: var(--text-2); font-weight: 700; background: var(--surface);
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); }
.search-input { width: 100%; padding: 11px 14px; border-radius: 13px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); font-size: 0.9rem; margin-bottom: 16px; transition: border-color 0.15s; }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-months { display: flex; flex-direction: column; gap: 18px; }
.cal-month-head { font-family: "Quicksand"; font-weight: 700; font-size: 1.05rem; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px; }
.cal-month-count { font-size: 0.7rem; font-family: "Nunito"; color: var(--text-3); background: var(--surface-2);
  padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.cal-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 12px; margin-bottom: 7px; cursor: pointer; transition: all 0.15s; }
.cal-row:hover { border-color: var(--border-2); }
.cal-day { width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; font-family: "Quicksand"; }
.cal-meta { display: flex; flex-direction: column; min-width: 0; }
.cal-name { font-weight: 700; font-size: 0.92rem; }
.cal-age { font-size: 0.72rem; color: var(--text-3); }

/* Réglages */
.view-settings { display: flex; flex-direction: column; gap: 14px; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; }
.settings-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.settings-desc { font-size: 0.82rem; color: var(--text-2); line-height: 1.45; margin-bottom: 12px; }
.settings-label { font-size: 0.78rem; color: var(--text-2); font-weight: 700; margin: 14px 0 8px; }
.settings-row { display: flex; gap: 8px; }
.settings-row .btn { flex: 1; }
.notif-status { font-size: 0.85rem; font-weight: 700; padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; }
.notif-status.ok { background: var(--accent-soft); color: var(--accent); }
.notif-status.blocked { background: var(--danger-soft); color: var(--danger); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn { flex: 1; min-width: fit-content; padding: 9px 12px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-2); font-size: 0.8rem; font-weight: 700; transition: all 0.15s; white-space: nowrap; }
.seg-btn:hover { border-color: var(--border-2); }
.seg-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* Empty / muted */
.empty-state { text-align: center; padding: 50px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-emoji { font-size: 3rem; opacity: 0.85; margin-bottom: 4px; }
.empty-title { font-weight: 700; font-size: 1.15rem; font-family: "Quicksand"; }
.empty-hint { color: var(--text-3); font-size: 0.85rem; max-width: 300px; }
.empty-state .btn { margin-top: 10px; }
.muted { color: var(--text-3); }
.muted.small { font-size: 0.82rem; }
.center { text-align: center; padding: 24px; }

/* Modales */
.modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(63, 46, 60, 0.45); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity 0.2s; }
.modal-overlay.show { opacity: 1; }
.modal { background: var(--bg-2); width: 100%; max-width: 520px; border-radius: 26px 26px 0 0; max-height: 90vh;
  overflow-y: auto; border: 1px solid var(--border); border-bottom: none; transform: translateY(30px);
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1); }
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--bg-2); }
.modal-header h3 { font-size: 1.15rem; }
.modal-header:empty { padding: 0; }
.modal-close { width: 32px; height: 32px; border-radius: 11px; font-size: 0.85rem; background: var(--surface);
  color: var(--text-2); display: grid; place-items: center; margin-left: auto; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-footer { display: flex; gap: 10px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--bg-2); }
.flex1 { flex: 1; }
@media (min-width: 520px) { .modal-overlay { align-items: center; } .modal { border-radius: 26px; border-bottom: 1px solid var(--border); } }

/* Détail */
.detail { padding: 4px 20px 0; }
.detail-hero { display: flex; align-items: center; gap: 14px; padding: 8px 0 18px; }
.detail-name { font-family: "Quicksand"; font-weight: 700; font-size: 1.3rem; }
.detail-line { font-size: 0.85rem; color: var(--text-2); margin-top: 2px; }
.detail-line.accent { color: var(--accent); font-weight: 700; }
.detail-section { padding: 16px 0; border-top: 1px solid var(--border); }
.detail-section-head { font-weight: 700; font-size: 0.95rem; margin-bottom: 10px; font-family: "Quicksand"; }
.detail-notes { font-size: 0.88rem; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; }
.gift-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.gift-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; }
.gift-row.done { opacity: 0.55; }
.gift-row.done .gift-text { text-decoration: line-through; }
.gift-text { flex: 1; font-size: 0.88rem; }
.gift-del { width: 24px; height: 24px; border-radius: 7px; color: var(--text-3); font-size: 0.7rem; }
.gift-del:hover { color: var(--danger); background: var(--danger-soft); }
.checkbox { width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px; border: 2px solid var(--border-2);
  display: grid; place-items: center; font-size: 0.72rem; color: var(--on-accent); font-weight: 800; transition: all 0.15s; }
.checkbox.on { background: var(--accent); border-color: var(--accent); }

/* Add row */
.add-row { display: flex; gap: 8px; }
.add-row .form-input { flex: 1; }
.add-row .btn { flex-shrink: 0; min-width: 44px; font-size: 1.05rem; }

/* Formulaire */
.person-form { padding: 8px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 0.74rem; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 8px; }
.form-input { width: 100%; padding: 11px 13px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: 0.9rem; transition: border-color 0.15s; }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-input.err { border-color: var(--danger); }
textarea.form-input { resize: vertical; min-height: 44px; }
.form-row { display: flex; gap: 8px; }
.year-input { width: 92px; }
.toggle-row { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text-2); cursor: pointer; padding: 2px 0; }
.toggle-row input { width: 17px; height: 17px; accent-color: var(--accent); }

/* Toast */
.toast { position: fixed; bottom: 150px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-3);
  color: var(--text); border: 1px solid var(--border-2); padding: 12px 22px; border-radius: 14px; font-weight: 700;
  font-size: 0.9rem; box-shadow: var(--shadow); z-index: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 420px) {
  .brand-text p { display: none; }
  .fab span:not(.fab-plus) { display: none; }
  .fab { right: 18px; bottom: calc(102px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; padding: 0; border-radius: 50%;
    justify-content: center; }
  .fab-plus { font-size: 1.4rem; }
}
