:root {
  --bg: #0a1c15;
  --bg-2: #0e241b;
  --ink: #f0ead9;
  --muted: #8fa79a;
  --faint: rgba(240, 234, 217, 0.07);
  --line: rgba(240, 234, 217, 0.12);
  --gold: #e2c060;
  --gold-soft: #f2d98a;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: radial-gradient(120% 90% at 50% -10%, var(--bg-2) 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 48px) clamp(18px, 5vw, 32px) 48px;
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1.05;
}
.title--small { font-size: clamp(24px, 6vw, 30px); }

.salawat-formula {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--gold-soft);
  opacity: 0.9;
}
.salawat-formula--foot { text-align: center; opacity: 0.65; }

.section-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
}

/* --- Connexion ------------------------------------------------------------ */
.login { display: grid; min-height: 100dvh; place-items: center; }
.login__box { text-align: center; max-width: 400px; }
.login__lede { color: var(--muted); margin: 18px 0 24px; }
.login__btn { display: flex; justify-content: center; min-height: 44px; }
.login__note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* --- En-tête app ------------------------------------------------------------ */
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.head__range { margin: 4px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.linkbtn {
  background: none;
  border: none;
  padding: 6px 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--ink); }
.linkbtn--muted { display: block; margin: 10px auto 0; }

/* --- Total ------------------------------------------------------------------- */
.total {
  text-align: center;
  padding: 22px 16px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(90% 80% at 50% 0%, rgba(226, 192, 96, 0.10), transparent 70%),
    var(--faint);
}
.total__label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.total__value {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(48px, 15vw, 72px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Jours ------------------------------------------------------------------- */
.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.day {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 2px;
  text-align: center;
  background: var(--faint);
}
.day--today { border-color: rgba(226, 192, 96, 0.55); }
.day--future { opacity: 0.45; }
.day__name {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.day--today .day__name { color: var(--gold-soft); }
.day__count {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

/* --- Saisie ------------------------------------------------------------------ */
.entry { margin-top: 22px; }
.entry__form { display: flex; gap: 10px; }
.entry__input {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
}
.entry__input:focus { outline: none; border-color: rgba(226, 192, 96, 0.55); }
.entry__input::placeholder { color: rgba(143, 167, 154, 0.6); font-family: var(--sans); font-size: 15px; }
.entry__msg { margin: 8px 0 0; min-height: 1.2em; text-align: center; font-size: 13.5px; color: var(--gold-soft); }

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 13px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.12s ease;
}
.btn:hover { border-color: rgba(240, 234, 217, 0.35); }
.btn:active { transform: scale(0.99); }
.btn__sub { font-weight: 400; font-size: 12px; color: var(--muted); }
.btn--primary {
  border-color: rgba(226, 192, 96, 0.5);
  background: linear-gradient(180deg, rgba(226, 192, 96, 0.16), rgba(226, 192, 96, 0.05));
  white-space: nowrap;
}
.btn--primary:hover { border-color: var(--gold-soft); }

/* --- Clôture ------------------------------------------------------------------ */
.close { margin-top: 26px; display: flex; justify-content: center; }
.close .btn { width: 100%; }

/* --- Historique ---------------------------------------------------------------- */
.history { margin-top: 34px; }
.history__alltime { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.history__alltime strong { color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.history__list { list-style: none; margin: 0; padding: 0; }
.history__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.history__item:first-child { border-top: 1px solid var(--line); }
.history__range { color: var(--muted); }
.history__total { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.history__empty { color: var(--muted); font-size: 14px; }

/* --- Réglage ------------------------------------------------------------------- */
.settings { margin-top: 28px; }
.settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  color: var(--muted);
}
.settings__row select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
}

.foot { margin-top: 36px; }

@media (max-width: 420px) {
  .entry__form { flex-direction: column; }
}
