/* ==========================================================================
   Ementa Semanal — Planeamento de Refeições e Lista de Compras
   Estética Editorial Culinária Portuguesa: Papel Quente, Verde Oliveira Escuro & Terracota
   ========================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('./fonts/PlusJakartaSans.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./fonts/Inter.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('./fonts/JetBrainsMono.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-page: #FAF9F5;
  --bg-subtle: #F3F1EA;
  --bg-card: #FFFFFF;
  --bg-accent-soft: #EEF3EF;
  --text-accent-soft: #1F4D3A;

  --border-light: #E6E4DD;
  --border-strong: #CFCBC0;

  --brand-primary: #1F4D3A;
  --brand-primary-hover: #173B2C;
  --brand-terracotta: #C85A32;
  --brand-terracotta-soft: #FDF2EE;
  --brand-terracotta-border: #F2D0C2;

  --text-main: #181816;
  --text-secondary: #3E3D38;
  --text-muted: #63625C;

  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --shadow-subtle: 0 1px 3px rgba(24, 24, 22, 0.04), 0 4px 12px rgba(24, 24, 22, 0.02);
  --shadow-modal: 0 16px 40px rgba(24, 24, 22, 0.14);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

button, input, select {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   TOP HEADER & NAVIGATION
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 249, 245, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: #FAF9F5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Desktop Stepper Navigation */
.step-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.step-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.step-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.step-tab.active {
  background: var(--bg-card);
  color: var(--brand-primary);
  box-shadow: 0 1px 2px rgba(24, 24, 22, 0.08);
  font-weight: 700;
}

.step-badge-count {
  font-size: 0.74rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  font-weight: 700;
}

/* Right Header Area (Mobile status + Auth) */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mobile-header-status {
  display: none;
  align-items: center;
  gap: 5px;
}

.mh-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

.auth-guest-bar,
.auth-user-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-header-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-header-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-header-solid {
  background: var(--brand-primary);
  color: #FFFFFF;
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease;
}

.btn-header-solid:hover {
  background: var(--brand-primary-hover);
}

.sync-status-pill {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
}

.user-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.user-account-btn:hover {
  border-color: var(--border-strong);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--brand-primary);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-name-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   MAIN CONTAINER & PAGE HEADINGS
   ========================================================================== */
.main-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-heading {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* TAGS & PILLS */
.meta-tag,
.pastel-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  line-height: 1.3;
}

.meta-tag-primary,
.badge-mint {
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  border-color: #C9DBD0;
}

.badge-peach {
  background: var(--brand-terracotta-soft);
  color: var(--brand-terracotta);
  border-color: var(--brand-terracotta-border);
}

.badge-butter,
.badge-sky,
.badge-lavender {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.status-pill.status-active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

/* ==========================================================================
   STEP 1: O TEU PERFIL
   ========================================================================== */
.config-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.section-card {
  grid-column: span 12;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-subtle);
  min-width: 0;
}

.section-card.half {
  grid-column: span 6;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.section-desc {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.sub-label {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* People Selector & Calorie Cards */
.people-count-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.pill-choice {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: center;
}

.pill-choice:hover {
  border-color: var(--border-strong);
}

.pill-choice.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.people-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.person-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  min-width: 0;
}

.person-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.person-name-input {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  flex: 1;
  min-width: 0;
}

.person-name-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.person-kcal-box {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.person-kcal-input {
  width: 62px;
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 3px 4px;
  border-radius: 4px;
  text-align: center;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.preset-btn {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.14s ease;
}

.preset-btn.active, .preset-btn:hover {
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.same-pot-explainer {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.86rem;
}

/* Supermarket Grid & Budget */
.supermarket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.supermarket-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.supermarket-card:hover {
  border-color: var(--border-strong);
}

.supermarket-card.active {
  background: var(--bg-accent-soft);
  border-color: var(--brand-primary);
}

.sm-name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sm-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.budget-box {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.budget-box-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.budget-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.9rem;
}

.budget-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.budget-val-pill {
  background: #FFFFFF;
  color: var(--brand-primary);
  font-weight: 700;
}

.budget-slider {
  width: 100%;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.budget-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Counters & Cook Mode */
.counters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.counter-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.counter-label {
  font-weight: 700;
  font-size: 0.9rem;
}

.counter-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.stepper-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:hover {
  border-color: var(--brand-primary);
}

.stepper-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  min-width: 20px;
  text-align: center;
}

.cook-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cook-mode-pill {
  justify-content: flex-start;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

/* Appliances Grid */
.appliances-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.app-pill {
  justify-content: center;
  text-align: center;
}

/* Cold Lunch Toggle & Filter Pills */
.cold-lunch-toggle-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 14px;
}

.cold-lunch-toggle-card.active {
  background: var(--bg-accent-soft);
  border-color: var(--brand-primary);
}

.cold-lunch-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}

.cold-lunch-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.toggle-pill:hover {
  border-color: var(--border-strong);
}

.toggle-pill.active {
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.toggle-pill.dislike.active {
  background: var(--brand-terracotta-soft);
  color: var(--brand-terracotta);
  border-color: var(--brand-terracotta);
  text-decoration: line-through;
}

/* Primary & Secondary Buttons */
.cta-bar {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-primary-green {
  background: var(--brand-primary);
  color: #FFFFFF;
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover,
.btn-primary-green:hover {
  background: var(--brand-primary-hover);
}

.btn-secondary,
.btn-soft-mint {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover,
.btn-soft-mint:hover {
  background: var(--bg-subtle);
}

.btn-danger-outline {
  background: transparent;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-md);
  padding: 9px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   STEP 2: ESCOLHER PRATOS DA SEMANA
   ========================================================================== */
.mobile-slots-bar {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.ms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ms-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ms-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.86rem;
}

.ms-cost {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.ms-jump-btn {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.ms-pills-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.ms-pills-scroll::-webkit-scrollbar {
  display: none;
}

.ms-slot-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ms-slot-pill.filled {
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  border-color: #C9DBD0;
}

.ms-slot-pill.active {
  border-color: var(--brand-primary);
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 0 0 1px var(--brand-primary);
}

.picker-layout {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 20px;
  align-items: start;
}

.picker-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-subtle);
  min-width: 0;
}

.picker-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.picker-topbar-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-autofill-top {
  padding: 7px 12px;
  font-size: 0.8rem;
}

.picker-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.picker-photo-wrap {
  position: relative;
  height: 250px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.picker-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.picker-photo-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 24, 22, 0.35) 0%, transparent 45%, rgba(24, 24, 22, 0.2) 100%);
  pointer-events: none;
}

.picker-photo-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.picker-photo-badges .meta-tag,
.picker-photo-badges .pastel-badge {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-main);
  border-color: rgba(24, 24, 22, 0.12);
}

.picker-body {
  padding: 16px;
}

.picker-title {
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.28;
}

.picker-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0 0 14px;
}

.picker-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.btn-swipe {
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.14s ease;
  text-align: center;
}

.swipe-text {
  font-weight: 700;
  font-size: 0.88rem;
}

.swipe-sub {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
}

.btn-swipe-pass {
  background: var(--bg-page);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-swipe-pass:hover {
  background: var(--bg-subtle);
}

.btn-swipe-like {
  background: var(--brand-primary);
  color: #FFFFFF;
  border: 1px solid var(--brand-primary);
}

.btn-swipe-like:hover {
  background: var(--brand-primary-hover);
}

.btn-swipe-double {
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  border: 1px solid #B8D0C2;
}

.picker-portion-preview {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.allergens-note {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.keyboard-hint {
  text-align: center;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Weekly Slots Board */
.board-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-subtle);
  min-width: 0;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.board-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.board-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.slots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 14px;
  max-height: 480px;
  overflow-y: auto;
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  cursor: pointer;
  min-width: 0;
}

.slot-row.filled {
  background: #FFFFFF;
  border-color: #C9DBD0;
}

.slot-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.board-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   STEP 3 & 4: EMENTA DA SEMANA & LISTA DE COMPRAS
   ========================================================================== */
.summary-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-subtle);
  min-width: 0;
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.32rem;
  font-weight: 700;
  margin: 4px 0 2px;
  color: var(--text-main);
}

.step-section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.day-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.day-filter-bar::-webkit-scrollbar {
  display: none;
}

.day-filter-pill {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.day-filter-pill.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.meals-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.plan-meal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.plan-meal-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.plan-meal-img {
  width: 92px;
  height: 76px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.raw-pot-box {
  font-size: 0.83rem;
  color: var(--text-secondary);
  background: var(--bg-page);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.portion-scale-box {
  background: var(--bg-accent-soft);
  border: 1px solid #C9DBD0;
  border-radius: var(--radius-md);
  padding: 11px 12px;
}

.portion-person-line {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  margin-top: 7px;
}

/* Shopping List Companion & Aisles */
.shopping-companion-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.sc-progress-info {
  flex: 1;
  min-width: 190px;
}

.sc-progress-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.sc-progress-track {
  height: 7px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.sc-progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.sc-filter-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sc-filter-btn {
  font-size: 0.78rem;
  padding: 6px 11px;
}

.aisles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.aisle-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-subtle);
  min-width: 0;
}

.aisle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.shop-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}

.shop-item-row:last-child {
  border-bottom: none;
}

.shop-item-row.checked {
  opacity: 0.48;
  text-decoration: line-through;
}

.shop-item-row.hidden-checked {
  display: none;
}

/* ==========================================================================
   MODALS (RECIPE & AUTH / ACCOUNT)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 24, 22, 0.48);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: var(--shadow-modal);
}

.auth-modal-box {
  max-width: 460px;
}

.modal-drag-handle {
  display: none;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-strong);
  margin: 0 auto 12px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 5px;
}

.modal-close-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Auth Modal Elements */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.auth-tab {
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.auth-tab.active {
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(24, 24, 22, 0.08);
}

.auth-helper-text {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.auth-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 12px;
  background: var(--brand-terracotta-soft);
  color: var(--brand-terracotta);
  border: 1px solid var(--brand-terracotta-border);
}

.auth-alert.success {
  background: var(--bg-accent-soft);
  color: var(--brand-primary);
  border-color: #C9DBD0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field input {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 0.92rem;
  color: var(--text-main);
  background: #FFFFFF;
}

.form-field input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.auth-submit-btn {
  width: 100%;
  margin-top: 4px;
}

.account-profile-box {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.account-user-name {
  font-weight: 700;
  font-size: 0.96rem;
}

.account-user-email {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.save-week-row {
  display: flex;
  gap: 8px;
}

.saved-weeks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.saved-week-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
}

.account-footer-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* ==========================================================================
   STICKY MOBILE BOTTOM NAV (Hidden on desktop)
   ========================================================================== */
.mobile-bottom-nav,
.mb-bottom-nav {
  display: none;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (<= 960px, <= 768px, <= 480px)
   ========================================================================== */
@media (max-width: 960px) {
  .section-card.half { grid-column: span 12; }
  .picker-layout { grid-template-columns: 1fr; }
  .meals-plan-grid { grid-template-columns: 1fr; }
  .summary-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  .header-inner {
    padding: 9px 12px;
    gap: 8px;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .brand-title {
    font-size: 0.96rem;
  }

  .step-nav {
    display: none !important;
  }

  .mobile-header-status {
    display: inline-flex;
  }

  .sync-status-pill {
    display: none;
  }

  .btn-header-ghost,
  .btn-header-solid {
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .user-name-label {
    max-width: 72px;
    font-size: 0.78rem;
  }

  .main-container {
    padding: 14px 12px 28px;
  }

  .page-heading {
    font-size: 1.28rem;
  }

  .config-grid {
    gap: 12px;
  }

  .section-card {
    padding: 15px 13px;
  }

  .people-count-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .people-cards-grid {
    grid-template-columns: 1fr;
  }

  .supermarket-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .counters-row {
    grid-template-columns: 1fr;
  }

  .cook-mode-grid {
    grid-template-columns: 1fr;
  }

  .appliances-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-bar {
    flex-direction: column;
  }

  .cta-bar button {
    width: 100%;
  }

  .mobile-slots-bar {
    display: block;
  }

  .picker-stage {
    padding: 12px;
  }

  .picker-photo-wrap {
    height: 190px;
  }

  .picker-body {
    padding: 13px 11px;
  }

  .picker-title {
    font-size: 1.08rem;
  }

  .keyboard-hint {
    display: none;
  }

  .summary-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .kpi-card {
    padding: 11px 12px;
  }

  .kpi-value {
    font-size: 1.12rem;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions button {
    flex: 1;
    padding: 9px 10px;
    font-size: 0.82rem;
  }

  .plan-meal-card {
    padding: 14px 12px;
  }

  .plan-meal-img {
    width: 78px;
    height: 70px;
  }

  .aisles-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-box {
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    padding: 14px 16px 26px;
    border-bottom: none;
  }

  .modal-drag-handle {
    display: block;
  }

  .mobile-bottom-nav,
  .mb-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
  }

  .mb-nav-item {
    appearance: none;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-family: var(--font-heading);
    cursor: pointer;
  }

  .mb-nav-item.active {
    background: var(--bg-accent-soft);
    color: var(--brand-primary);
  }

  .mb-nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mb-nav-icon {
    display: inline-flex;
    line-height: 1;
  }

  .mb-nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.1;
  }

  .mb-nav-badge {
    position: absolute;
    top: -4px;
    right: -22px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--brand-primary);
    color: #FFFFFF;
    line-height: 1.15;
  }

  .mb-badge-butter {
    background: var(--bg-subtle);
    color: var(--text-main);
    border: 1px solid var(--border-strong);
  }
}

@media (max-width: 480px) {
  .mobile-header-status {
    display: none;
  }

  .person-card-top {
    flex-direction: column;
    align-items: stretch;
  }

  .person-name-input {
    width: 100%;
  }

  .person-kcal-box {
    justify-content: space-between;
  }

  .picker-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-autofill-top {
    width: 100%;
    text-align: center;
  }
}

@media print {
  .app-header, .picker-actions, .cta-bar, .mobile-bottom-nav, .no-print { display: none !important; }
  body { background: #FFFFFF; padding-bottom: 0 !important; }
  .step-panel { display: block !important; }
}

/* Aviso de site em testes */
.beta-testing-banner{background:#1F4D3A;color:#F4F1E8;text-align:center;padding:8px 16px;font-size:.85rem;font-weight:600;letter-spacing:.01em;}
.beta-testing-banner span{display:inline-block;background:#C85A32;color:#fff;padding:2px 8px;border-radius:999px;font-size:.72rem;font-weight:700;text-transform:uppercase;margin-right:8px;letter-spacing:.04em;}
@media (max-width:768px){.beta-testing-banner{padding:6px 10px;font-size:.74rem;line-height:1.35}.beta-testing-banner span{font-size:.64rem;padding:1px 6px;margin-right:4px}}
