/* "Mon espace" and the sign-in page. The week grid itself is planner.css;
   this file adds what the app's planning, shopping and library screens do
   around it (cookai_mobile/src/planning, src/screens/Shopping, src/ui/TabBar). */

.espace-page { min-height: 100vh; }
.espace-main { padding: 8px 0 80px; }
.round-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--card); box-shadow: 0 2px 10px -4px rgba(27,26,23,.3); font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer; transition: transform .2s; }
.round-btn:hover { transform: scale(1.06); }
.stepper-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--rule); background: var(--paper); font-size: 20px; cursor: pointer; }
.stepper-btn:hover { border-color: var(--ink); }
.text-btn { border: 0; background: none; padding: 0; color: var(--ink-2); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- the site's navbar (home.css .nav, .btn-ink) with the app's tab bar (src/ui/TabBar.js):
   in the header on a computer, fixed at the bottom on a phone ---------- */
.espace-nav { gap: 24px; }
/* The app's values: 54 px high, paper with a white edge, 44 px touch targets, 23 px ink icons, a 38 px tomato "+". */
.espace-tabs { display: flex; flex: none; align-items: center; justify-content: space-between; box-sizing: border-box; width: 340px; height: 54px; padding: 0 8px; border: 1px solid #fff; border-radius: 27px; background: var(--paper); box-shadow: 0 6px 24px #24161126, 0 2px 8px #24161112; }
.espace-tabs a { display: flex; flex: 1; min-width: 0; height: 44px; align-items: center; justify-content: center; color: var(--ink); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.espace-tabs svg { width: 23px; height: 23px; fill: currentColor; }
.espace-tabs a:hover { transform: translateY(-2px); }
.espace-tabs a:active, .espace-tabs-add:active { transform: scale(.9); }
.espace-tabs-add { display: grid; flex: none; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--tomato); color: #fff; cursor: pointer; transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.espace-tabs-add svg { width: 22px; height: 22px; }
.espace-tabs-add:hover { transform: scale(1.08); }
.espace-user { display: flex; align-items: center; gap: 12px; }
.espace-user form { margin: 0; }
.espace-user .btn { border: 0; white-space: nowrap; cursor: pointer; }
.pro-badge { padding: 3px 10px; border-radius: 10px; background: var(--basil); color: #fff; font-size: 12.5px; font-weight: 800; letter-spacing: .3px; }

/* ---------- planning ---------- */
.week-nav { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.week-nav .planner-week { flex: 1; text-align: center; }
.week-grid.is-four .week-row { grid-template-columns: 58px repeat(4, 1fr); }
.week-cell { width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.week-cell.is-free { display: grid; place-items: center; border: 1.5px dashed #E2D6C3; transition: border-color .2s, background .2s; }
.week-cell.is-free:hover { border-color: #F6B3A1; border-style: solid; background: #FFF6F1; }
.week-plus { color: #C9BBA5; font-size: 22px; font-weight: 700; transition: color .2s; }
.week-cell.is-free:hover .week-plus { color: var(--tomato); }
.week-cell.is-planned { background: var(--flour); }
.week-more { position: absolute; top: 6px; left: 6px; z-index: 1; padding: 1px 7px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; }
.week-cell.is-over { transform: scale(1.05); outline: 3px solid var(--tomato); outline-offset: -3px; background: #FFE9E1; }
.week-cell.is-lifted { opacity: .35; }
.week-row.is-locked { opacity: .38; }
.week-row.is-locked .week-cell { cursor: not-allowed; }
.week-row.is-locked .week-cell.is-free:hover { border-color: #E2D6C3; border-style: dashed; background: none; }
.week-day { position: relative; }
.week-lock { position: absolute; right: -4px; bottom: -4px; font-size: 13px; }
@media (hover: none) { .only-pointer { display: none; } }
.lock-banner { display: grid; gap: 10px; justify-items: center; margin-top: 18px; padding: 16px; border-radius: 20px; background: var(--peach); text-align: center; }
.lock-banner p { margin: 0; color: var(--tomato-deep); font-weight: 800; }
.lock-banner small { color: var(--ink-2); font-size: 13px; }
.lock-banner .btn { padding: 13px 24px; font-size: 16px; }
.lock-banner.is-flash { animation: yc-pulse .6s ease-in-out 2; }
.to-shopping { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 16px 20px; border-radius: 22px; background: var(--basil); color: #fff; transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.to-shopping:hover { transform: translateY(-2px); }
.to-shopping strong { flex: 1; font-family: var(--display); font-size: 17px; }
.to-shopping-count { padding: 3px 10px; border-radius: 12px; background: rgba(255,255,255,.18); font-weight: 800; font-size: 14px; }

/* ---------- bottom sheets (dialog) ---------- */
.sheet { width: min(560px, 100%); max-height: min(86vh, 760px); margin: auto auto 0; padding: 0; border: 0; border-radius: 28px 28px 0 0; background: var(--paper); color: var(--ink); }
.sheet::backdrop { background: rgba(27,26,23,.45); }
.sheet[open] { animation: sheet-up .35s cubic-bezier(.33,1,.68,1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 681px) { .sheet { margin: auto; border-radius: 28px; } }
.sheet-card { display: grid; gap: 12px; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-title { margin: 0; font: 800 22px/1.2 var(--display); }
.sheet-sub { margin: -6px 0 4px; color: var(--mute); font-size: 15px; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); font: 700 16px var(--body); text-align: left; cursor: pointer; }
.menu-row:hover { background: var(--flour); }
.menu-row.is-danger { color: var(--tomato-deep); }
.menu-row[hidden] { display: none; }
.picker-label { margin: 2px 0 0; font-weight: 800; }
.picker-search { width: 100%; box-sizing: border-box; padding: 13px 16px; border: 2px solid var(--rule); border-radius: 16px; background: var(--card); font: inherit; font-size: 16px; }
.picker-search:focus { outline: none; border-color: var(--ink); }
.picker-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 22px; background: var(--flour); }
.picker-tabs button { flex: 1; padding: 9px 10px; border: 0; border-radius: 18px; background: none; color: var(--ink-2); font: 800 14px var(--body); cursor: pointer; }
.picker-tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(27,26,23,.3); }
.picker-list { display: grid; gap: 8px; max-height: 40vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.picker-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 2px solid transparent; border-radius: 16px; background: var(--card); font: inherit; text-align: left; cursor: pointer; }
.picker-item:hover { border-color: var(--ink); }
.picker-item img { width: 56px; height: 56px; flex: none; border-radius: 12px; object-fit: cover; background: var(--flour); }
.picker-item span { display: grid; gap: 2px; }
.picker-item strong { font-size: 15px; line-height: 1.25; }
.picker-item small { color: var(--mute); font-size: 13px; }
.picker-empty { padding: 18px; color: var(--mute); text-align: center; }
.picker-portions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-weight: 700; }
.picker-portions span { flex: 1; }
.picker-portions strong { min-width: 22px; text-align: center; font: 800 20px var(--display); }
.picker-days { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-day { position: relative; }
.picker-day input { position: absolute; opacity: 0; }
.picker-day span { display: inline-block; padding: 9px 14px; border: 2px solid var(--rule); border-radius: 18px; background: var(--card); font-weight: 700; font-size: 14px; cursor: pointer; }
.picker-day input:checked + span { border-color: var(--basil); background: var(--basil-soft, #DCEBDF); }
.picker-day input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.picker-day.is-locked span { color: var(--mute); }
.picker-day i { position: absolute; top: -6px; right: -4px; font-style: normal; font-size: 12px; }
.sheet.is-recipe .picker-search, .sheet.is-recipe .picker-tabs, .sheet.is-recipe .picker-list { display: none; }
.picker-add { justify-content: center; margin-top: 6px; border: 0; cursor: pointer; }
.sheet:not(.is-recipe) .picker-add { display: none; }

.toast { position: fixed; left: 0; right: 0; bottom: 28px; z-index: 50; width: fit-content; max-width: min(520px, calc(100% - 32px)); margin-inline: auto; padding: 13px 20px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; text-align: center; box-shadow: 0 16px 30px -18px rgba(27,26,23,.6); animation: yc-appear .35s cubic-bezier(.33,1,.68,1); }
.toast[hidden] { display: none; }
.toast.is-error { background: var(--tomato-deep); }
.toast.is-lock { background: var(--peach); color: var(--tomato-deep); }

/* ---------- courses (src/screens/Shopping) ---------- */
.courses-progress { display: grid; gap: 8px; margin-bottom: 18px; padding: 16px 18px; border-radius: 20px; background: var(--card); border: 2px solid var(--rule); }
.courses-progress p { margin: 0; }
.courses-progress strong { font: 800 20px var(--display); }
.courses-bar { height: 10px; border-radius: 10px; background: var(--flour); overflow: hidden; }
.courses-bar i { display: block; height: 100%; width: 0; border-radius: 10px; background: var(--basil); transition: width .35s cubic-bezier(.33,1,.68,1); }
.courses-list { display: grid; gap: 22px; }
.aisle-title { margin: 0 0 8px; color: var(--mute); font-size: 13px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.aisle ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.buy label { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); cursor: pointer; transition: opacity .2s; }
.buy input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--basil); }
.buy-text { display: grid; gap: 1px; }
.buy-text strong { display: block; font-size: 16px; }
.buy-text strong::first-letter { text-transform: uppercase; }
.buy-qty { color: var(--basil); font-weight: 800; font-size: 14.5px; }
.buy-text small { color: var(--mute); font-size: 12.5px; }
.buy.is-checked label { opacity: .5; }
.buy.is-checked strong { text-decoration: line-through; }
.buy.is-optional strong::after { content: " (facultatif)"; color: var(--mute); font-weight: 600; font-size: 13px; }

/* ---------- recettes (the app's library) ---------- */
/* The planning's width, its title on the left and the count where the week is. */
.recipes-page { max-width: 720px; margin: 0 auto; }
.recipes-total { color: var(--ink-2); }
.recipes-total[hidden] { display: none; }
.recipes-tools { display: grid; gap: 10px; margin-bottom: 20px; }
@media (min-width: 681px) { .recipes-tools { grid-template-columns: 1fr auto; align-items: center; } .recipes-tools .picker-tabs { min-width: 380px; } }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.recipe-card { position: relative; display: grid; gap: 6px; height: 100%; padding: 8px 8px 14px; border-radius: 22px; background: var(--card); border: 2px solid var(--rule); transition: transform .25s cubic-bezier(.3,1.6,.5,1), border-color .2s; }
.recipe-card:hover { transform: translateY(-4px) rotate(-.5deg); border-color: var(--ink); }
.recipe-cover { aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--flour); }
.recipe-cover img { width: 100%; height: 100%; object-fit: cover; }
.recipe-title { padding: 0 6px; font: 800 16px/1.25 var(--display); }
.recipe-facts { padding: 0 6px; color: var(--mute); font-size: 13px; }
.recipe-status { position: absolute; top: 16px; left: 16px; padding: 3px 9px; border-radius: 10px; background: var(--paper); font-size: 12px; font-weight: 800; }
.recipe-grid.is-revealing li { animation: yc-appear .35s cubic-bezier(.33,1,.68,1) both; animation-delay: calc(var(--row, 0) * 40ms); }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--ink-2); font-weight: 700; }

.espace-empty { display: grid; justify-items: center; gap: 6px; padding: 36px 20px; border: 2px dashed var(--rule); border-radius: 24px; text-align: center; color: var(--ink-2); }
.espace-empty[hidden] { display: none; }
.espace-empty p { margin: 0; }
.espace-empty-title { color: var(--ink); font: 800 20px var(--display); }
.espace-empty .btn { margin-top: 10px; }

/* ---------- connexion ---------- */
.auth { display: grid; justify-items: center; gap: 12px; max-width: 440px; padding: 10px 0 70px; text-align: center; }
.auth-chef { width: 96px; height: 96px; animation: yc-pop .5s cubic-bezier(.3,1.6,.5,1) both; }
.auth-title { margin: 0; font: 800 clamp(30px, 6vw, 40px)/1.1 var(--display); letter-spacing: -0.03em; }
.auth-lead { margin: 0 0 6px; color: var(--ink-2); }
.auth-social { display: grid; gap: 10px; width: 100%; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; border-radius: 24px; border: 0; font: 700 16px var(--body); cursor: pointer; }
.social-btn.is-apple { background: #000; color: #fff; }
.social-btn-google { display: flex; justify-content: center; min-height: 44px; }
.auth-or { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0; color: var(--mute); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.auth-switch { display: flex; gap: 6px; width: 100%; padding: 4px; border-radius: 22px; background: var(--flour); }
.auth-switch a { flex: 1; padding: 10px; border-radius: 18px; color: var(--ink-2); font-weight: 800; font-size: 15px; }
.auth-switch a[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(27,26,23,.3); }
.auth-form { display: grid; gap: 6px; width: 100%; text-align: left; }
.auth-form label { margin-top: 8px; font-weight: 800; font-size: 15px; }
.auth-form input { width: 100%; box-sizing: border-box; padding: 14px 16px; border: 2px solid var(--rule); border-radius: 16px; background: var(--card); font: inherit; }
.auth-form input:focus { outline: none; border-color: var(--ink); }
.auth-form .btn { justify-content: center; margin-top: 16px; border: 0; cursor: pointer; }
.auth-form .errorlist { margin: 2px 0 0; padding: 0; list-style: none; color: var(--tomato-deep); font-size: 14px; font-weight: 600; }
.auth-small { justify-self: center; margin-top: 10px; color: var(--ink-2); font-size: 14.5px; text-decoration: underline; }
.auth-foot { margin: 10px 0 0; color: var(--mute); font-size: 13px; }
.auth-foot a { text-decoration: underline; }
.form-error[hidden] { display: none; }

@media (max-width: 680px) {
  .espace-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .espace-user .btn-small { padding: 10px 16px; font-size: 14px; }
  /* The same tab bar, floating at the bottom as in the app (44 px from each side, 16 px up). */
  .espace-tabs { position: fixed; left: 44px; right: 44px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; width: auto; }
  .week-grid.is-four .week-row { grid-template-columns: 40px repeat(4, 1fr); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
