/* Boulot Chrono — mêmes couleurs et mêmes polices que Caisse claire et Henon Academy. Classes préfixées « bc- ».
   Ce fichier : le socle (couleurs, boutons, champs), la connexion, la coquille, les fenêtres, les réglages. */
:root {
  --bg: #f7f5f2;
  --bg-2: #eeeae4;
  --surface: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #6b6660;
  --border: #e6e2db;
  --border-2: #d8d2c7;
  --accent: #b8863f;
  --accent-dark: #8f6528;
  --accent-soft: #f4e9d8;
  --gold: #d9a95b;
  --gold-light: #f4d695;
  --henon: #e5366a;
  --night: #140b09;
  --cream: #f7efe6;
  --ok: #2f7a4d;
  --ok-soft: #e4f2e8;
  --warn: #a8660b;
  --warn-soft: #fbefd9;
  --err: #c4432a;
  --err-soft: #fbe9e4;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 8px 24px -10px rgba(28, 26, 23, .18);
  --shadow-lg: 0 24px 60px -24px rgba(20, 11, 9, .5);
  --h: 46px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: "Cormorant", Georgia, serif;
  --body: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.4, .5, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); font-variant-numeric: lining-nums; min-height: 100dvh; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent-dark); }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.bc-icon { width: 20px; height: 20px; flex: none; }
.bc-muted { color: var(--ink-soft); font-size: 14px; }
.bc-error { color: var(--err); font-size: 14px; }
.bc-error:empty { display: none; }
.bc-plus { color: var(--ok); }
.bc-minus { color: var(--warn); }

/* ---------- boutons ---------- */
.bc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h); padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--ink); text-align: center; transition: background .2s, border-color .2s, transform .15s var(--ease); }
.bc-btn:hover { border-color: var(--accent); }
.bc-btn:active { transform: scale(.97); }
.bc-btn:disabled { opacity: .5; cursor: default; transform: none; }
.bc-btn.bc-gold { background: var(--accent); border-color: var(--accent); color: #fff; }
.bc-btn.bc-gold:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.bc-btn.bc-soft { background: var(--bg); border-color: var(--border); font-weight: 500; }
.bc-btn.bc-danger { color: var(--err); }
.bc-btn.bc-danger:hover { border-color: var(--err); }
.bc-btn.bc-wide { width: 100%; }
.bc-btn.bc-small { min-height: 44px; padding: 0 14px; font-size: 15px; }
.bc-iconbtn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 22px; font-weight: 700; transition: background .2s, color .2s; }
.bc-iconbtn:hover { background: var(--bg-2); color: var(--ink); }
.bc-iconbtn:disabled { opacity: .3; cursor: default; background: transparent; }
.bc-iconbtn.bc-round { border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface); }

/* ---------- champs et formulaires ---------- */
.bc-form { display: grid; gap: 14px; }
.bc-field { display: grid; gap: 4px; min-width: 0; }
.bc-field > span { font-size: 14px; color: var(--ink-soft); }
.bc-field > small { font-size: 13px; color: var(--ink-soft); }
.bc-field input { width: 100%; min-width: 0; min-height: var(--h); padding: 0 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.bc-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bc-field input[type="time"], .bc-field input[type="date"] { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.bc-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bc-two > :only-child { grid-column: 1 / -1; }
.bc-preview { font-weight: 700; color: var(--accent-dark); min-height: 24px; }
.bc-preview.bc-warn { color: var(--warn); }
.bc-preview:empty { display: none; }
.bc-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.bc-actions.bc-start { justify-content: flex-start; }
.bc-actions .bc-gold { flex: 1 1 160px; }
.bc-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.bc-choices.bc-stack { display: grid; }
.bc-choice { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-weight: 500; transition: background .2s, border-color .2s, color .2s; }
.bc-choice[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.bc-choice.bc-tall { border-radius: var(--r-sm); text-align: left; display: grid; gap: 2px; padding: 10px 14px; }
.bc-choice.bc-tall small { color: var(--ink-soft); font-weight: 400; font-size: 13px; }

/* ---------- connexion ---------- */
.bc-center { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); background: radial-gradient(90% 60% at 50% 0%, var(--accent-soft), transparent 70%); }
.bc-login { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 30px 22px; box-shadow: var(--shadow); text-align: center; animation: bc-rise .6s var(--ease) both; }
.bc-login form { text-align: left; margin-top: 22px; }
.bc-login-logo { width: 72px; height: 72px; border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 12px; }
.bc-login-title i, .bc-brand i { color: var(--accent-dark); }
.bc-login-sub { color: var(--ink-soft); margin-top: 6px; }
.bc-login-foot { margin-top: 18px; }
@keyframes bc-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- coquille : barre du haut, navigation ---------- */
.bc-skip { position: absolute; left: 12px; top: -60px; z-index: 80; background: var(--night); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); border: 0; cursor: pointer; }
.bc-skip:focus { top: 12px; }
.bc-app { max-width: 1120px; margin: 0 auto; padding: 14px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; min-height: 44px; }
.bc-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 24px; font-weight: 600; min-height: 44px; }
.bc-brand img { border-radius: 10px; }
.bc-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border); display: flex; justify-content: center; }
.bc-nav a { flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; color: var(--ink-soft); text-decoration: none; position: relative; transition: color .2s; }
.bc-nav a::before { content: ""; position: absolute; top: 0; left: 50%; width: 36px; height: 3px; margin-left: -18px; border-radius: 0 0 3px 3px; background: var(--accent); transform: scaleX(0); transition: transform .35s var(--ease); }
.bc-nav a[aria-current="page"] { color: var(--accent-dark); font-weight: 700; }
.bc-nav a[aria-current="page"]::before { transform: scaleX(1); }
.bc-nav .bc-icon { width: 22px; height: 22px; transition: transform .35s var(--spring); }
.bc-nav a[aria-current="page"] .bc-icon { transform: translateY(-1px) scale(1.1); }
.bc-view { outline: none; animation: bc-view-in .4s var(--ease) both; }
@keyframes bc-view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (min-width: 760px) {
  .bc-app { padding: 18px 24px 40px; }
  .bc-top { margin-bottom: 20px; }
  .bc-nav { position: static; height: auto; padding: 4px; background: var(--bg-2); border: 0; border-radius: 999px; backdrop-filter: none; gap: 2px; }
  .bc-nav a { flex: none; max-width: none; flex-direction: row; gap: 8px; padding: 0 16px; min-height: 44px; border-radius: 999px; font-size: 15px; }
  .bc-nav a::before { display: none; }
  .bc-nav a[aria-current="page"] { background: var(--surface); box-shadow: 0 2px 8px -4px rgba(28, 26, 23, .3); }
  .bc-nav .bc-icon { width: 18px; height: 18px; }
}

/* ---------- cartes ---------- */
.bc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; min-width: 0; }
.bc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bc-card-head h2 { font-size: 23px; }
.bc-card-total { text-align: right; display: grid; flex: none; }
.bc-card-total b { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.bc-card-total small { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }
.bc-empty { color: var(--ink-soft); background: var(--bg); border: 1px dashed var(--border-2); border-radius: var(--r-sm); padding: 14px; font-size: 15px; }
.bc-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 700; white-space: nowrap; }

/* ---------- message bref ---------- */
.bc-toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; background: var(--night); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px; width: max-content; max-width: calc(100vw - 24px); box-shadow: var(--shadow-lg); animation: bc-toast-in .4s var(--spring) both; }
.bc-toast button { border: 0; background: none; color: var(--gold-light); font-weight: 700; cursor: pointer; min-height: 44px; margin: -10px -8px -10px 0; padding: 0 8px; }
@keyframes bc-toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 760px) { .bc-toast { bottom: 28px; } }

/* ---------- fenêtre : feuille sur téléphone, boîte centrée sur grand écran ---------- */
.bc-sheet-back { position: fixed; inset: 0; z-index: 70; background: rgba(20, 11, 9, .5); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: bc-back-in .25s ease both; }
.bc-sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 8px 18px calc(20px + var(--safe-b)); box-shadow: var(--shadow-lg); animation: bc-sheet-in .38s var(--ease) both; }
.bc-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--border-2); margin: 0 auto 6px; }
.bc-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.bc-sheet-head h2 { font-size: 25px; }
.bc-sheet-head .bc-iconbtn { margin-right: -10px; }
.bc-sheet-back.bc-leaving { animation: bc-back-in .22s ease reverse both; }
.bc-sheet-back.bc-leaving .bc-sheet { animation: bc-sheet-out .22s ease both; }
@keyframes bc-back-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bc-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes bc-sheet-out { to { transform: translateY(40%); opacity: 0; } }
@media (min-width: 640px) {
  .bc-sheet-back { align-items: center; padding: 24px; }
  .bc-sheet { border-radius: var(--r-lg); padding: 20px 24px 24px; animation-name: bc-pop-in; }
  .bc-sheet::before { display: none; }
  @keyframes bc-pop-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
}

/* ---------- réglages ---------- */
.bc-settings { max-width: 640px; margin: 0 auto; display: grid; gap: 14px; }
.bc-settings h1 { margin-bottom: 4px; }
.bc-set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bc-set-row.bc-col { display: grid; justify-content: stretch; }
.bc-set-label { font-weight: 700; }
.bc-stepper { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bc-hours { width: 76px; min-height: var(--h); text-align: center; border: 1px solid var(--border-2); border-radius: var(--r-sm); font-family: var(--display); font-size: 26px; font-weight: 700; background: var(--surface); }
.bc-hours:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bc-daybtns { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.bc-daybtn { min-height: 48px; padding: 0; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-size: 14px; color: var(--ink-soft); transition: background .2s, border-color .2s, color .2s, transform .2s var(--spring); }
.bc-daybtn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.bc-daybtn:active { transform: scale(.92); }
.bc-set-result { font-family: var(--display); font-size: 21px; font-weight: 600; color: var(--accent-dark); }
.bc-tips { display: grid; gap: 10px; }
.bc-tips li { padding-left: 18px; position: relative; color: var(--ink-soft); }
.bc-tips li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.bc-tips b { color: var(--ink); }
.bc-account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bc-account > div { min-width: 0; overflow-wrap: anywhere; }
.bc-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--night); color: var(--gold-light); font-family: var(--display); font-weight: 700; font-size: 24px; flex: none; }
.bc-version { font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
