/* ═══ Organic — design-system tokens (source : projet Claude Design) ═══ */
@import url('https://fonts.googleapis.com/css2?family=Caprasimo:wght@400&family=Figtree:wght@400;600;700&display=swap');

:root {
  --color-bg: #f5ead8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-accent: #c67139;
  --color-accent-2: #7a8a5e;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-500: #a19786;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;

  --font-heading: "Caprasimo", system-ui, sans-serif;
  --font-heading-weight: 400;
  --font-body: "Figtree", system-ui, sans-serif;

  --space-1: 4.4px;
  --space-2: 8.8px;
  --space-3: 13.2px;
  --space-4: 17.6px;
  --space-6: 26.4px;
  --space-8: 35.2px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--color-neutral-300);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.55;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
button { font-family: inherit; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }

/* — boutons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: 999px;
}
.btn svg { display: block; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — formulaires — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 14px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: 999px;
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }

/* — cartes — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: calc(var(--radius-lg) * 1.15);
  background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-body { margin: 0; font-size: 13px; opacity: 0.8; }

/* ═══ Couche applicative time-time ═══ */

.viewport { min-height: 100dvh; display: flex; justify-content: center; background: var(--color-neutral-300); }
.shell {
  width: 100%; max-width: 430px; min-height: 100dvh; background: var(--color-bg);
  display: flex; flex-direction: column; position: relative;
}

.app-header {
  padding: var(--space-6) var(--space-4) var(--space-3);
  display: flex; align-items: baseline; gap: var(--space-2);
}
.app-header h1 { margin: 0; font-size: 29px; letter-spacing: -0.02em; }
.app-header .who { margin-left: auto; font-size: 12px; opacity: .55; }

.app-main { flex: 1; min-height: 0; padding: 0 var(--space-4) 120px; }

/* — tab bar — */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  display: flex; padding: var(--space-2) var(--space-2) calc(var(--space-3) + 6px);
  background: var(--color-surface);
  border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border-radius: 999px; text-decoration: none;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
  font-size: 11px;
}
.tab[aria-current="page"] { color: var(--color-accent-700); font-weight: 700; }
.tab svg { display: block; }

/* — login — */
.login {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-8) var(--space-6) 64px;
}
.login-icon {
  width: 72px; height: 72px; border-radius: 999px; background: var(--color-accent);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-6);
}
.login h1 { font-size: 44px; margin: 0 0 var(--space-2); letter-spacing: -0.02em; }
.login .tagline { font-size: 15px; opacity: .65; margin: 0 0 var(--space-8); max-width: 15em; }
.form-error { font-size: 13px; color: var(--color-accent-700); margin: 0 0 var(--space-3); }

/* — ajout étape 1 : liste de tâches — */
.step-hint { font-size: 13px; opacity: .6; margin: 0 0 var(--space-4); }
.task-pick { display: grid; gap: var(--space-2); }
.task-pick a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--color-surface);
  border: 1px solid transparent; border-radius: 999px;
  font-size: 16px; color: var(--color-text); text-decoration: none;
}
.task-pick a:hover { border-color: var(--color-accent); }
.task-pick .tname { flex: 1; }
.task-pick .tweek { font-size: 12px; opacity: .5; }
.dot { border-radius: 999px; flex: none; display: inline-block; }
.dot-14 { width: 14px; height: 14px; }
.dot-12 { width: 12px; height: 12px; }
.dot-16 { width: 16px; height: 16px; }

/* — ajout étape 2 — */
.picked { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-6); }
.picked .pname { font-size: 20px; font-family: var(--font-heading); }
.mini-label { font-size: 12px; opacity: .7; margin: 0 0 var(--space-2); }
.duration-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.stepper {
  display: flex; align-items: center; gap: var(--space-1);
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: 999px; padding: 5px 6px;
}
.stepper-btn {
  width: 40px; height: 40px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 999px; background: var(--color-bg);
  color: var(--color-accent-700); cursor: pointer; text-decoration: none;
}
.stepper-btn:hover { background: var(--color-accent-200); }
.stepper-btn:active { background: var(--color-accent-300); }
.stepper .minutes-input {
  width: 92px; font-size: 32px; font-family: var(--font-heading);
  min-height: 44px; text-align: center; padding: 0;
  background: transparent; border-color: transparent;
}
.duration-row .unit { font-size: 15px; opacity: .7; }
.duration-row .pretty { font-size: 13px; opacity: .5; }
.presets { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }
.preset {
  padding: 9px 16px; border-radius: 999px; font-size: 14px;
  font-family: var(--font-heading); text-decoration: none;
  border: 1px solid var(--color-divider); color: var(--color-text);
}
.preset[aria-current="true"] { background: var(--color-accent); color: var(--color-bg); border-color: transparent; }
.date-row { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.date-row .input { flex: 1; min-height: 44px; text-align: center; }
.date-label { font-size: 13px; opacity: .6; margin: 0 0 var(--space-6); }

/* — stats — */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-6); padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.legend .dot { width: 10px; height: 10px; }
.chart-section { margin-bottom: var(--space-8); }
.chart-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.chart-head h2 { margin: 0; font-size: 21px; }
.chart-nav { margin-left: auto; display: flex; gap: 6px; }
.chart-range { font-size: 12px; opacity: .55; margin: 0 0 var(--space-4); }
.chart-empty { font-size: 14px; opacity: .55; margin: 0; padding: var(--space-6) 0; }
.cols { display: flex; align-items: flex-end; gap: var(--space-4); height: 190px; padding-top: var(--space-2); }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.col .total { font-size: 12px; opacity: .6; }
.col .user { font-size: 13px; font-weight: 600; }
.col-bar {
  width: 100%; max-width: 64px; display: flex; flex-direction: column;
  border-radius: var(--radius-md); overflow: hidden; background: var(--color-neutral-200);
}
.col-bar a { display: block; min-height: 3px; width: 100%; }

/* — bottom sheet (zéro JS : :target) — */
.sheet-wrap { position: fixed; inset: 0; display: none; z-index: 10; }
.sheet-wrap:target { display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--color-neutral-900) 45%, transparent);
}
.sheet {
  position: relative; width: 100%; max-width: 430px; background: var(--color-bg);
  border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4) var(--space-8); box-shadow: var(--shadow-lg);
  animation: tt-rise .18s ease-out;
}
.sheet-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.sheet-head .pname { font-family: var(--font-heading); font-size: 20px; }
.sheet-head .close { margin-left: auto; }
.sheet-figures { display: flex; gap: var(--space-6); }
.sheet-figures .k { font-size: 11px; opacity: .55; text-transform: uppercase; letter-spacing: .08em; }
.sheet-figures .v { font-size: 30px; font-family: var(--font-heading); }
.sheet-note { font-size: 13px; opacity: .6; margin: var(--space-4) 0 0; }

/* — mes temps — */
.times { list-style: none; margin: 0; padding: 0; }
.times li {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.times .tinfo { flex: 1; min-width: 0; }
.times .ttask { font-size: 15px; }
.times .tdate { font-size: 12px; opacity: .55; }
.times .tdur { font-size: 16px; font-family: var(--font-heading); }

/* — tâches — */
.task-row {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.task-row form.rename { flex: 1; }
.task-row .rename .input {
  border-color: transparent; background: transparent; padding-left: 0;
  font-size: 15px; border-radius: 0;
}
.task-row .rename .input:hover { border-color: var(--color-divider); }
.task-row.archived .rename .input { opacity: .45; }
.task-add-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-6); }
.task-add-row .input { flex: 1; min-height: 44px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* — toast — */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 2 * var(--space-4)); max-width: calc(430px - 2 * var(--space-4));
  background: var(--color-neutral-900); color: var(--color-neutral-100);
  padding: var(--space-3) var(--space-4); border-radius: 999px;
  font-size: 14px; text-align: center; box-shadow: var(--shadow-md);
  animation: tt-rise .18s ease-out; z-index: 5;
}

@keyframes tt-rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sheet { animation-name: tt-rise-sheet; }
@keyframes tt-rise-sheet { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sheet, .toast { animation: none; } }
