/* ========================================
   ROOT THEME VARIABLES
======================================== */

:root {
  --primary: #0f766e;
  --primary-light: #ecfdf5;
  --protein: #e05d52;
  --fat: #4f7bd9;
  --carbs: #3ca374;
  --bg: #f4f6f8;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
}

/* ========================================
   BASE
======================================== */

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-dark);
}

.container {
  width: 92%;
  max-width: 1000px;
  margin: 40px auto;
}

/* ========================================
   TOP BAR
======================================== */

.top-bar {
  height: 60px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-weight: 600;
}

.settings-link {
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
}

.header-logo {
  height: 32px;
}

/* ========================================
   CARDS
======================================== */

.card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  margin-bottom: 30px;
}

/* ========================================
   BUTTONS
======================================== */

.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  width: 100%;
  height: 58px;
  padding: 18px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn:hover {
  opacity: 0.9;
}

.secondary-btn {
  background: none;
  border: 1px solid var(--border);
  width: 100%;
  height: 58px;
  padding: 16px;
  border-radius: 16px;
  cursor: pointer;
}

/* ========================================
   WEEK STRIP
======================================== */

.week-strip {
  display: flex;
  width: 100%;
  gap: 6px;
  margin: 20px 0 30px;
}

.week-day {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-weight: 500;
  transition: all 0.2s ease;
}

.week-day.clickable:hover {
  background: #f8fafc;
}

.week-day.locked {
  opacity: 0.35;
  pointer-events: none;
}

.week-day.selected {
  background: #1e7f73;
  color: white;
  border: none;
  box-shadow: 0 6px 18px rgba(15,118,110,0.25);
  opacity: 1;
}

.week-day.today-outline {
  border: 2px solid #1e7f73;
  background: white;
  color: #1e7f73;
}

.week-day.view-only {
  opacity: 0.5;
}

.week-day.future {
  opacity: 0.3;
  pointer-events: none;
}

/* ========================================
   DASHBOARD TOP SECTION
======================================== */

.top-section {
  padding: 50px;
}

.top-row,
.dashboard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 60px;
  margin-bottom: 50px;
}

.goal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.goal-big {
  font-size: 84px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}

.goal-label {
  font-size: 26px;
  margin-top: 14px;
  color: var(--text-muted);
}

.goal-reset {
  font-size: 18px;
  margin-top: 10px;
  color: #9ca3af;
}

/* ========================================
   RING (REFINED PREMIUM)
======================================== */

.ring-wrapper {
  position: relative;
  width: 250px;
  height: 250px;
  flex-shrink: 0;
}

.ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, var(--border) 0%);
}

.ring::after {
  content: "";
  position: absolute;
  inset: 10px;   /* ⬅ thinner ring (was 18px) */
  background: var(--card-bg);
  border-radius: 50%;
  z-index: 1;
}

.ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2;
  text-align: center;
}

.ring-number {
  font-weight: 700;
  font-size: 24px;   /* slightly larger now that there's room */
}

.ring-label {
  font-size: 14px;
  opacity: 0.6;
  margin-top: 6px;
}


.calories-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 20px;
}

/* ========================================
   MACRO BARS
======================================== */

.macro-bars {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.macro-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

.bar-bg {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 20px;
  transition: width 0.4s ease;
}

.protein-fill { background: var(--protein); }
.fat-fill { background: var(--fat); }
.carbs-fill { background: var(--carbs); }

/* ========================================
   DAILY FOOD LOG
======================================== */

#foodEntries {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.meal-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.meal-name {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.meal-macros {
  font-size: 13px;
  font-weight: 600;
   display: flex;
  gap: 14px;
}

.macro-protein { color: var(--protein); padding:0 10px 0 0; }
.macro-fat { color: var(--fat); padding:0 10px 0 0;}
.macro-carbs { color: var(--carbs); padding:0 10px 0 0;}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.delete-btn:hover {
  color: var(--protein);
}

/* ========================================
   AUTH PAGE
======================================== */

.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: var(--bg);
}

.auth-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-card {
  background: white;
  padding: 50px 40px;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
}

.auth-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.6;
}

.auth-card input {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--primary);
}

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

.auth-card .primary-btn {
  margin-top: 15px;
}

.auth-status {
  text-align: center;
  font-size: 14px;
  color: var(--protein);
}

.auth-link {
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: block;
}

.auth-link:hover {
  opacity: 0.8;
}

.auth-logo {
  width: 140px;
  margin: 0 auto 10px auto;
  display: block;
}

/* ========================================
   ONBOARDING
======================================== */

#onboardingForm {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 420px;
  margin: 0 auto;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 5px;
}

.step label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 10px;
}

.step input,
.step select {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-size: 16px;
  background: #fafafa;
  width: 100%;
  box-sizing: border-box;
}

.step input:focus,
.step select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(15,118,110,0.08);
}

/* ========================================
   BOTTOM SHEET
======================================== */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 0;
  background: white;
  border-radius: 28px 28px 0 0;
  padding: 28px 24px 32px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(.22,1,.36,1);
  z-index: 200;
  box-sizing: border-box;
  max-width: 100%;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 50px;
  height: 5px;
  background: #d1d5db;
  border-radius: 10px;
  margin: 0 auto 20px;
}

.sheet-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

.bottom-sheet input {
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-size: 16px;
  background: #fafafa;
  box-sizing: border-box;
}

.bottom-sheet input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(15,118,110,0.08);
}

.macro-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}

.sheet-actions .secondary-btn {
  height: 52px;
  font-weight: 500;
}

.sheet-actions .primary-btn {
  height: 56px;
  font-size: 18px;
}

/* ========================================
   WEEK NAV
======================================== */

.week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.week-arrow {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #555;
}

.week-arrow:hover {
  color: #000;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {

  .top-row,
  .dashboard-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .goal-big { font-size: 48px; }
  .goal-label { font-size: 18px; }
  .goal-reset { font-size: 14px; }

  .ring-wrapper {
    width: 190px;
    height: 190px;
  }

  .calories-text { font-size: 14px; }

  .week-arrow {
    display: none;
  }
}

/* ========================================
   INGREDIENT FORM REFINEMENT
======================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}