/* ===== Tema Windows 11 dark (Fluent) — mesma identidade do Treinos Mauriana ===== */
:root {
  --bg: #1b1b1b;
  --bg-elev: #202020;
  --card: #2b2b2b;
  --card2: #323232;
  --control: #2d2d2d;
  --stroke: rgba(255,255,255,.06);
  --stroke-strong: rgba(255,255,255,.11);
  --txt: #ffffff;
  --muted: #a0a0a0;
  --accent: #ff8c42;          /* laranja (Receitas) — o Treinos é azul */
  --accent-soft: rgba(255,140,66,.14);
  --accent-press: #e6792f;
  --on-accent: #2e1500;
  --ok: #6ccb5a;
  --danger: #ff7b7b;
  --warn: #ffb454;
  --radius: 8px;
  --radius-sm: 6px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background: radial-gradient(1100px 560px at 50% -260px, #262626 0%, rgba(0,0,0,0) 62%), var(--bg);
  background-attachment: fixed;
  color: var(--txt);
  min-height: 100vh; min-height: 100dvh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.16em; flex: 0 0 auto; display: inline-block; }

/* --- Polimento de interação (igual nos 2 apps) --- */
button { font-family: inherit; -webkit-user-select: none; user-select: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--txt);
  -webkit-box-shadow: 0 0 0 1000px var(--control) inset;
  caret-color: var(--txt);
  transition: background-color 9999s ease-in-out 0s;
}

#app { max-width: 600px; margin: 0 auto; padding: 0 16px 28px; }
body.has-nav #app { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px 4px;
  padding: 14px 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--stroke);
}
.appbar h1 { font-size: 21px; font-weight: 600; margin: 0; flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; }
.appbar h1 .title-ic { color: var(--accent); width: 24px; height: 24px; }
.appbar h1 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  background: var(--card); border: 1px solid var(--stroke); color: var(--txt);
  width: 40px; height: 40px; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--card2); }
.icon-btn.danger { color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--stroke-strong); background: var(--card); color: var(--txt);
  padding: 13px 16px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
  cursor: pointer; width: 100%;
}
.btn .ico { width: 18px; height: 18px; }
.btn:hover { background: var(--card2); }
.btn:active { transform: scale(.99); }
.btn-primary { background: var(--accent); color: var(--on-accent); border: 0; }
.btn-primary:hover { background: #5cc9ff; }
.btn-ghost { background: transparent; border-color: var(--stroke); }
.btn-danger { background: transparent; border-color: rgba(255,123,123,.4); color: var(--danger); }
.btn-row { display: flex; gap: 10px; }

/* ---------- Search ---------- */
.search { position: relative; margin-bottom: 16px; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { width: 100%; padding: 12px 14px 12px 40px; }

input, textarea, select {
  background: var(--control); border: 1px solid var(--stroke-strong);
  border-bottom: 2px solid var(--stroke-strong); color: var(--txt);
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 16px; width: 100%; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-bottom-color: var(--accent); }
textarea { resize: vertical; min-height: 58px; line-height: 1.45; }
label.fld { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

/* ---------- Recipe cards (home) ---------- */
.recipe-list { display: flex; flex-direction: column; gap: 12px; }
.recipe-card {
  background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius);
  padding: 16px; cursor: pointer; display: flex; align-items: center; gap: 14px;
}
.recipe-card:hover { background: var(--card2); }
.recipe-card .emoji { width: 46px; height: 46px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.recipe-card .emoji .ico { width: 24px; height: 24px; }
.recipe-card .rc-main { flex: 1; min-width: 0; }
.recipe-card .rc-name { font-size: 16px; font-weight: 600; }
.recipe-card .rc-sub { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; align-items: center; gap: 10px; }
.recipe-card .rc-sub span { display: inline-flex; align-items: center; gap: 4px; }
.recipe-card .rc-sub .ico { width: 14px; height: 14px; }
.empty { text-align: center; color: var(--muted); margin-top: 60px; }
.empty .ico { width: 48px; height: 48px; opacity: .5; }
.empty p { margin: 14px 0; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 10px 26px rgba(255,140,66,.35);
  display: flex; align-items: center; justify-content: center; z-index: 30;
}
.fab .ico { width: 26px; height: 26px; }

/* ---------- Recipe detail ---------- */
.section-title { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 22px 2px 10px; display: flex; align-items: center; gap: 8px; }
.section-title .ico { width: 16px; height: 16px; }
.panel { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); overflow: hidden; }
.ing-line, .step-line { padding: 13px 16px; border-bottom: 1px solid var(--stroke); display: flex; gap: 12px; align-items: flex-start; }
.ing-line:last-child, .step-line:last-child { border-bottom: 0; }
.ing-line .q { color: var(--accent); font-weight: 600; white-space: nowrap; }
.step-line .num { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-elev); color: var(--accent); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.step-line .st-body { flex: 1; }
.step-line .st-timer { color: var(--warn); font-size: 12px; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.step-line .st-timer .ico { width: 13px; height: 13px; }
.servings-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-elev); color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.servings-badge .ico { width: 15px; height: 15px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.action-grid .btn { flex-direction: column; padding: 22px 12px; gap: 10px; font-size: 16px; }
.action-grid .btn .ico { width: 30px; height: 30px; }
.action-grid .cook { background: var(--accent); color: var(--on-accent); border: 0; }
.action-grid .shop { background: var(--card); border: 1px solid var(--stroke-strong); }

/* ---------- Servings stepper ---------- */
.serv-prompt { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 26px 18px; text-align: center; margin-top: 10px; }
.serv-prompt .ico-big { color: var(--accent); }
.serv-prompt .ico-big .ico { width: 40px; height: 40px; }
.serv-prompt h2 { font-size: 19px; font-weight: 600; margin: 12px 0 20px; }
.stepper { display: inline-flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.stepper button .ico { width: 24px; height: 24px; }
.stepper .val { font-size: 40px; font-weight: 800; min-width: 64px; }

/* ---------- Shopping ---------- */
.shop-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--stroke); cursor: pointer; }
.shop-item:last-child { border-bottom: 0; }
.shop-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--stroke-strong); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: transparent; }
.shop-item.done .shop-check { background: var(--ok); border-color: var(--ok); color: #06210f; }
.shop-check .ico { width: 16px; height: 16px; }
.shop-item.done .si-name { text-decoration: line-through; color: var(--muted); }
.si-main { flex: 1; min-width: 0; }
.si-name { font-weight: 600; }
.si-qty { color: var(--accent); font-size: 13px; }
.shop-item.done .si-qty { color: var(--muted); }
.si-price { color: var(--muted); font-size: 14px; white-space: nowrap; }
.shop-total { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding: 16px; background: var(--card); border: 1px solid var(--stroke-strong); border-radius: var(--radius); font-size: 16px; }
.shop-total b { font-size: 22px; color: var(--accent); }

/* ---------- Cooking step ---------- */
.cook-progress { margin: 6px 2px 18px; }
.cook-progress .bar { height: 6px; background: var(--bg-elev); border-radius: 999px; overflow: hidden; }
.cook-progress .bar > i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.cook-progress .lbl { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.cook-step { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 22px 20px; min-height: 160px; }
.cook-step .st-num { color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.cook-step .st-text { font-size: 20px; line-height: 1.45; margin-top: 10px; }
.cook-ings { margin-top: 14px; }
.cook-ings details { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 0 16px; }
.cook-ings summary { padding: 14px 0; cursor: pointer; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.cook-ings summary .ico { width: 16px; height: 16px; }
.cook-ings ul { margin: 0 0 14px; padding-left: 20px; line-height: 1.8; color: var(--muted); }
.cook-ings ul b { color: var(--accent); }

/* Timer */
.timer-box { margin-top: 16px; background: var(--bg-elev); border: 1px solid var(--stroke-strong); border-radius: var(--radius); padding: 20px; text-align: center; }
.timer-box.done { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,180,84,.25); } }
.timer-display { font-size: 52px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.timer-display.done { color: var(--warn); }
.timer-controls { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.timer-controls button { width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: var(--card2); color: var(--txt); }
.timer-controls button .ico { width: 24px; height: 24px; }
.timer-controls .play { background: var(--accent); color: var(--on-accent); }
.timer-msg { color: var(--warn); margin-top: 10px; font-weight: 600; display: none; align-items: center; justify-content: center; gap: 6px; }
.timer-box.done .timer-msg { display: flex; }

.cook-nav { display: flex; gap: 10px; margin-top: 18px; }
.done-screen { text-align: center; margin-top: 50px; }
.done-screen .big { color: var(--ok); }
.done-screen .big .ico { width: 64px; height: 64px; }
.done-screen h2 { font-size: 24px; margin: 16px 0 8px; }

/* Form rows (edit) */
.row-card { background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.row-card .grid { display: grid; gap: 8px; }
.ing-grid { grid-template-columns: 1fr 70px 70px; }
.ing-grid .full { grid-column: 1 / -1; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.row-head .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.row-head .icon-btn { width: 32px; height: 32px; }
.add-row { border-style: dashed; background: transparent; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- Login / cadastro ---------- */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 32px 24px; text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,.45); }
.auth-card .logo { color: var(--accent); }
.auth-card .logo .ico { width: 52px; height: 52px; }
.auth-card h1 { margin: 6px 0 4px; font-size: 25px; font-weight: 600; }
.auth-card h1 span { color: var(--accent); }
.tagline { color: var(--muted); margin: 0 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.link-btn { background: none; border: 0; color: var(--accent); margin-top: 16px; cursor: pointer; font-size: 15px; }
.error { background: rgba(255,123,123,.12); color: var(--danger); padding: 10px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 14px; }

/* ---------- Chip admin / autor ---------- */
.admin-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; flex: 0 0 auto; }
.admin-chip .ico { width: 14px; height: 14px; }
.rc-sub .by { color: var(--accent); }

/* ---------- Navegação inferior (Fluent) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(32,32,32,.82); backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--stroke-strong);
  display: flex; justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-btn { background: none; border: 0; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; flex: 1; position: relative; padding-top: 6px; }
.nav-btn .ico { width: 22px; height: 22px; }
.nav-btn span:last-child { font-size: 11px; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active::before { content: ""; position: absolute; top: 0; width: 18px; height: 3px; border-radius: 3px; background: var(--accent); }

/* ---------- Banner de instalar (igual nos 2 apps) ---------- */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom));
  background: var(--card); border: 1px solid var(--stroke-strong); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 8px; z-index: 30;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 14px;
}
.install-banner .ico { width: 18px; height: 18px; color: var(--accent); }
.install-banner #install-btn { margin-left: auto; background: var(--accent); border: 0; color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; }
.install-banner .x { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }

/* ---------- Admin ---------- */
.icon-btn.warn { color: var(--warn); }
.setting-row { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 14px 16px; }
.setting-row > div:first-child { flex: 1; }
.set-name { font-weight: 600; }
.set-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--control); border: 1px solid var(--stroke-strong); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: var(--muted); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(22px); background: var(--on-accent); }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--stroke); }
.user-row:last-child { border-bottom: 0; }
.user-row.is-blocked { opacity: .55; }
.u-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.u-main { flex: 1; min-width: 0; }
.u-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.u-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.u-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.u-actions .icon-btn { width: 34px; height: 34px; }
.u-actions .icon-btn .ico { width: 17px; height: 17px; }
.utag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; }
.utag.admin { background: var(--accent-soft); color: var(--accent); }
.utag.blocked { background: rgba(255,123,123,.15); color: var(--danger); }
.utag.you { background: var(--bg-elev); color: var(--muted); }
