/* The Muse Lab — Ménage & Réassort
   DA reprise du site The Muse Lab : bordeaux, crème, Poppins, boutons pilule */

:root {
    --bordeaux: #5A1017;
    --bordeaux-deep: #4A080C;
    --rouge: #C0473C;
    --ink: #161412;
    --ink-soft: #3A3632;
    --muted: #6F6A66;
    --muted-2: #9B948E;
    --cream: #F7F3EC;
    --sand: #E4DCD2;
    --sand-2: #D9D0C5;
    --blush: #F1E4E3;
    --white: #FFFFFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
    font-family: Poppins, system-ui, sans-serif;
    background: var(--cream);
    color: var(--ink);
    min-height: 100vh;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: var(--bordeaux);
    color: var(--white);
    overflow: hidden;
    padding-bottom: 28px;
}

.hero-watermark {
    position: absolute;
    right: -30px;
    bottom: -60px;
    font-size: clamp(160px, 32vw, 380px);
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 24px;
    background: rgba(22, 20, 18, 0.35);
}

.brand { display: flex; gap: 18px; align-items: flex-start; }

.studio-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.05em;
    transition: color 0.2s;
}
.studio-btn sup { font-size: 11px; font-weight: 600; letter-spacing: 0; }
.studio-btn.active { color: var(--white); }
.studio-btn:hover { color: var(--white); }

.who {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.who input {
    width: 150px;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-size: 14px;
    text-transform: none;
}
.who input::placeholder { color: rgba(255, 255, 255, 0.5); }
.who input:focus { outline: none; border-color: var(--white); }

.hero-content {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 24px 0;
}

.hero h1 {
    font-size: clamp(64px, 14vw, 120px);
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 0.9;
}

.hero-sub {
    margin-top: 8px;
    font-size: clamp(15px, 3vw, 20px);
    text-transform: uppercase;
    padding-left: 4px;
}

.hero-date {
    margin-top: 6px;
    padding-left: 4px;
    font-size: 14px;
    font-weight: 300;
    color: var(--blush);
}

.tabs {
    display: flex;
    gap: 8px;
    margin-top: 28px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
}
.tab:hover { background: rgba(255, 255, 255, 0.08); }
.tab.active { background: var(--white); color: var(--bordeaux); border-color: var(--white); }

.badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--rouge);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Page ---------- */
.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px 16px 120px;
}

.panel { display: flex; flex-direction: column; gap: 16px; }

.eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.card, .progress-card {
    background: var(--white);
    border: 1px solid var(--sand);
    border-radius: 14px;
    padding: 20px;
}

.notice {
    background: var(--blush);
    color: var(--bordeaux);
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 14px;
    margin-bottom: 16px;
}
.notice code { font-weight: 600; }
.notice a { color: inherit; font-weight: 600; text-underline-offset: 3px; }

/* Progression */
.progress-head { display: flex; justify-content: space-between; align-items: baseline; }
.progress-count { font-size: 28px; font-weight: 700; letter-spacing: -0.04em; }
.progress-bar {
    margin-top: 12px;
    height: 8px;
    border-radius: 999px;
    background: var(--sand);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0;
    background: var(--bordeaux);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.progress-card.complete .progress-fill { background: var(--rouge); }

/* Tâches */
.task-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.task {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--sand);
    border-radius: 14px;
    padding: 14px 16px;
    transition: background 0.2s, border-color 0.2s;
}
.task.done { background: var(--blush); border-color: var(--blush); }

.task-check {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 2px solid var(--sand-2);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.2s;
}
.task.done .task-check { background: var(--bordeaux); border-color: var(--bordeaux); }
.task-check svg { opacity: 0; transition: opacity 0.2s; }
.task.done .task-check svg { opacity: 1; }

.task-body { flex: 1; min-width: 0; cursor: pointer; }
.task-label { font-size: 15px; font-weight: 500; line-height: 1.35; word-wrap: break-word; }
.task.done .task-label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted-2); }
.task-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.task-edit-input {
    width: 100%;
    border: 1px solid var(--sand-2);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 15px;
}

.task-tools { display: none; gap: 4px; }
.editing .task-tools { display: flex; }
.editing .task-check { display: none; }

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--sand);
    background: var(--white);
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn.danger:hover { border-color: var(--rouge); color: var(--rouge); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 0; }

/* Ajouter */
.add-row { display: none; gap: 8px; }
.editing .add-row, .add-row.visible { display: flex; }
.add-row input, .field input, .field textarea {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--sand-2);
    background: var(--white);
    border-radius: 999px;
    padding: 0 20px;
    height: 48px;
    font-size: 15px;
}
.field input, .field textarea { flex: none; }
.field textarea { border-radius: 14px; padding: 12px 16px; height: auto; resize: vertical; }
.add-row input:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--bordeaux); }

.list-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.link-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: underline;
    text-underline-offset: 5px;
    color: var(--ink-soft);
}
.link-btn:hover { opacity: 0.75; }

/* Boutons */
.btn {
    height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-bordeaux { background: var(--bordeaux); color: var(--white); }
.btn-block { width: 100%; }

/* CTA achat dans la checklist */
.achat-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--ink);
    color: var(--white);
    border-radius: 14px;
    padding: 20px;
    margin-top: 8px;
}
.cta-title { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.cta-text { font-size: 13px; font-weight: 300; color: var(--sand); margin-top: 2px; }

/* Achats */
.achat-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.form-hint { font-size: 12px; color: var(--muted); text-align: center; }

.quick-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--sand-2);
    background: var(--cream);
    font-size: 13px;
    font-weight: 500;
}
.chip:hover { border-color: var(--bordeaux); color: var(--bordeaux); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 16px; }
.section-head .eyebrow { white-space: nowrap; }
.section-head h2 { font-size: 40px; font-weight: 700; letter-spacing: -0.06em; line-height: 1; }

.achat-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.achat {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--sand);
    border-radius: 14px;
    padding: 14px 16px;
}
.achat.fait { opacity: 0.55; }
.achat-main { flex: 1; min-width: 0; }
.achat-title { font-size: 15px; font-weight: 600; }
.achat.fait .achat-title { text-decoration: line-through; }
.achat-qty { font-weight: 400; color: var(--muted); }
.achat-note { font-size: 13px; color: var(--ink-soft); margin-top: 2px; word-wrap: break-word; }
.achat-meta { font-size: 12px; color: var(--muted-2); margin-top: 4px; }
.pill-studio {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--blush);
    color: var(--bordeaux);
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}
.achat-actions { display: flex; gap: 4px; }

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translate(-50%, 20px);
    width: max-content;
    max-width: calc(100% - 32px);
    text-align: center;
    background: var(--ink);
    color: var(--white);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
    .topbar { padding: 14px 16px; }
    .section-head h2 { font-size: 32px; }
    .tab { flex-shrink: 0; height: 40px; font-size: 12px; }
    .hero-content { padding: 28px 16px 0; }
    .who input { width: 120px; }
    .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .tab { padding: 0 6px; font-size: 11px; justify-content: center; gap: 4px; }
}

/* ---------- Jour sélectionné ---------- */
.day-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: 1px;
}
.day-tag:empty { display: none; }

.day-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--ink);
    color: var(--white);
}
.day-nav, .day-current {
    border: none;
    border-radius: 999px;
    min-height: 48px;
    font-size: 13px;
    font-weight: 500;
}
.day-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}
.day-nav:hover { background: rgba(255, 255, 255, 0.16); }
.day-current {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--bordeaux);
    font-weight: 700;
    line-height: 1.15;
    padding: 4px 10px;
}
.day-current small { font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.day-current small:empty { display: none; }

.future-hint {
    background: var(--blush);
    color: var(--bordeaux);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 13px;
}
.task.locked .task-check { opacity: 0.35; cursor: not-allowed; }

/* ---------- Transmissions ---------- */
.notes { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.note-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.note {
    position: relative;
    background: var(--white);
    border: 1px solid var(--sand);
    border-left: 4px solid var(--bordeaux);
    border-radius: 14px;
    padding: 12px 44px 12px 16px;
}
.note-text { font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.note-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.note .icon-btn { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; }
.note-form { display: flex; flex-direction: column; gap: 8px; }
.note-form textarea {
    border: 1px solid var(--sand-2);
    background: var(--white);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 15px;
    resize: vertical;
}
.note-form textarea:focus { outline: none; border-color: var(--bordeaux); }
.note-form .btn { align-self: flex-end; }
.prev-notes { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.prev-notes .note { border-left-color: var(--sand-2); background: transparent; cursor: pointer; }
.prev-notes .note:hover { border-color: var(--bordeaux); }
.notes .empty { padding: 8px 0; text-align: left; }

/* ---------- Calendrier ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-head h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.05em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted-2);
    padding-bottom: 6px;
}
.cal-day {
    position: relative;
    aspect-ratio: 1;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
}
.cal-day:hover { border-color: var(--bordeaux); }
.cal-day.other { visibility: hidden; }
.cal-day.today { border-color: var(--ink); font-weight: 700; }
.cal-day.selected { outline: 2px solid var(--rouge); outline-offset: 1px; }
.cal-day.full { background: var(--bordeaux); color: var(--white); }
.cal-day.part { background: var(--blush); color: var(--bordeaux); }
.cal-marks { display: flex; gap: 3px; height: 6px; }
.cal-marks i { width: 6px; height: 6px; border-radius: 999px; }
.m-check { background: var(--ink-soft); }
.m-note { background: var(--rouge); }
.cal-day.full .m-check { background: var(--white); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.lg-full { background: var(--bordeaux); }
.lg-part { background: var(--blush); border: 1px solid var(--bordeaux); }
.lg-check { background: var(--ink-soft); border-radius: 999px; width: 8px; height: 8px; }
.lg-note { background: var(--rouge); border-radius: 999px; width: 8px; height: 8px; }

.cal-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat {
    background: var(--white);
    border: 1px solid var(--sand);
    border-radius: 14px;
    padding: 14px 16px;
}
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.stat-label { font-size: 12px; color: var(--muted); }

@media (max-width: 420px) {
    .day-nav { flex-direction: column; gap: 0; font-size: 11px; line-height: 1.2; padding: 4px; }
    .day-nav svg { order: -1; }
    .cal-head h2 { font-size: 22px; }
}
