/* ==========================================================================
   MacroCount — Apple-Inspired Clean Light Theme Stylesheet
   ========================================================================== */

:root {
  /* Apple-inspired Light Palette */
  --bg-base: #FAFAFC;
  --bg-card: #FFFFFF;
  --bg-pill: #F2F4F7;
  --bg-pill-hover: #E5E7EB;

  --text-main: #1D1D1F;
  --text-secondary: #48484A;
  --text-muted: #86868B;

  /* App Brand & Macro Colors */
  --macro-calories: #FF3B30;
  --macro-protein: #007AFF;
  --macro-carbs: #34C759;
  --macro-fat: #FF9500;

  /* Apple & Success Accents */
  --apple-green: #34C759;
  --apple-green-bg: #F0FDF4;
  --apple-green-border: #BBF7D0;

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-card: rgba(0, 0, 0, 0.08);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 20px 48px -12px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-squircle: 0 12px 28px -6px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Plus Jakarta Sans", sans-serif;
  --radius-squircle: 24px;
  --radius-card: 32px;
  --radius-pill: 18px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-base);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient Apple-style Pastel Mesh Gradient Background */
.ambient-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background: 
    radial-gradient(circle at 18% 10%, rgba(255, 219, 215, 0.6) 0%, rgba(255, 235, 230, 0.2) 40%, transparent 65%),
    radial-gradient(circle at 82% 12%, rgba(218, 233, 255, 0.6) 0%, rgba(230, 240, 255, 0.2) 42%, transparent 65%),
    linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 50%, #F5F6F9 100%);
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header */
.header {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  justify-content: center;
}

.header-inner {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-icon {
  height: 20px;
  width: auto;
  object-fit: contain;
}

.header-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.header-pill {
  background-color: var(--apple-green-bg);
  color: #15803D;
  border: 1px solid var(--apple-green-border);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

/* Centered Main Layout */
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 20px 64px;
}

.hero-container {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* App Icon Squircle (Exact look from the app's login view) */
.app-icon-squircle {
  width: 88px;
  height: 88px;
  background-color: #FFFFFF;
  border-radius: var(--radius-squircle);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: var(--shadow-squircle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  padding: 16px;
  transition: transform 0.3s ease;
}

.app-icon-squircle:hover {
  transform: translateY(-2px) scale(1.02);
}

.squircle-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Coming Soon Pill Badge */
.coming-soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--macro-carbs);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
  animation: pulse-ring 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(52, 199, 89, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

/* Hero Typography */
.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.hero-description {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 440px;
  line-height: 1.55;
  margin-bottom: 28px;
}

/* Store Buttons (Apple Centered Style) */
.store-buttons-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-card);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  user-select: none;
  position: relative;
  transition: var(--transition);
}

.store-btn.is-disabled {
  cursor: default;
  opacity: 0.92;
}

.store-btn:hover {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.store-svg {
  flex-shrink: 0;
}

.store-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.18;
}

.store-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.store-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
}

.badge-soon {
  background-color: var(--bg-pill);
  color: var(--text-secondary);
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-left: 2px;
}

.free-badge-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* App Mockup Wrapper (Faithful to actual app dashboard) */
.app-mockup-wrapper {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.3s ease;
}

.app-mockup-wrapper:hover {
  transform: translateY(-2px);
}

/* Date Switcher Bar */
.mockup-date-bar {
  background-color: #FFFFFF;
  border-radius: 18px;
  padding: 11px 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.date-arrow {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.date-arrow:hover {
  color: var(--text-main);
  background-color: var(--bg-pill);
  transform: scale(1.15);
}

.date-center {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.date-cal-icon {
  color: #EF4444;
}

/* Daily Calories & Macros Card */
.mockup-tracker-card {
  background-color: #FFFFFF;
  border-radius: 26px;
  padding: 22px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 13px;
  text-align: left;
}

.tracker-card-head {
  display: flex;
  align-items: center;
}

.tracker-headline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #FF3B30;
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.tracker-cals-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -2px;
}

.tracker-cals-left {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.tracker-cals-big {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-main);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tracker-cals-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tracker-cals-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.tracker-pill-left {
  background-color: #FEE2E2;
  color: #DC2626;
  font-size: 0.725rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  transition: opacity 0.25s ease, background-color 0.3s ease, color 0.3s ease;
}

.tracker-goal-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tracker-bar-line {
  height: 6px;
  background-color: #FEE2E2;
  border-radius: var(--radius-full);
  width: 100%;
  margin: 1px 0 4px;
  overflow: hidden;
  position: relative;
}

.tracker-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF6B6B 0%, #FF3B30 100%);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3 Macro Columns */
.tracker-macros-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.macro-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.col-name {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.name-protein { color: #007AFF; }
.name-carbs { color: #34C759; }
.name-fat { color: #FF9500; }

.col-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-top: 1px;
  transition: opacity 0.25s ease;
}

.col-sub {
  font-size: 0.75rem;
  font-weight: 500;
}

.col-goal {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.col-underline-track {
  height: 3px;
  background-color: rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-full);
  width: 100%;
  overflow: hidden;
}

.col-underline-fill {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.line-protein { background-color: #007AFF; }
.line-carbs { background-color: #34C759; }
.line-fat { background-color: #FF9500; }

/* Subtle value fade transition */
.val-fading {
  opacity: 0.25 !important;
  transform: translateY(-2px);
}

.tracker-fiber-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background-color: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #059669;
  font-size: 0.725rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  margin-top: 2px;
}

/* Meal Card (Breakfast) */
.mockup-meal-card {
  background-color: #FFFFFF;
  border-radius: 20px;
  padding: 16px 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.meal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-sun-badge {
  font-size: 1.05rem;
  line-height: 1;
}

.meal-label {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.meal-cals-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.meal-btn-group {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
}

.meal-scan-btn {
  background-color: #F2F4F7;
  color: var(--text-main);
  border-radius: 13px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 700;
}

.meal-search-btn {
  background-color: #F2F4F7;
  color: var(--text-secondary);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Minimal Centered Footer */
.footer {
  width: 100%;
  padding: 28px 20px 44px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.support-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.support-title {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

.support-email-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-card);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.support-email-pill:hover {
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.email-icon {
  color: var(--text-muted);
}

.email-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.email-link:hover {
  text-decoration: underline;
}

.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 6px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color 0.15s ease;
}

.copy-btn:hover {
  color: var(--text-main);
}

.copy-toast {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: var(--text-main);
  color: #FFFFFF;
  font-size: 0.675rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer Legal Links */
.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.825rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-link:hover,
.footer-link.active {
  color: var(--text-main);
  text-decoration: underline;
}

.dot-sep {
  color: var(--border-card);
  font-size: 0.75rem;
}

.copyright {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Legal Pages (Privacy & Terms)
   ========================================================================== */

.legal-content {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 20px 64px;
}

.legal-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
}

.legal-page .header-inner {
  justify-content: space-between;
}

.legal-back-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.legal-back-link:hover {
  color: var(--text-main);
}

.legal-header {
  margin-bottom: 24px;
  text-align: left;
}

.legal-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--macro-protein);
  margin-bottom: 6px;
}

.legal-title {
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: 6px;
}

.legal-date {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.legal-card {
  background-color: var(--bg-card);
  border-radius: 28px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: left;
}

.legal-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
  margin-bottom: 10px;
}

.legal-section p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 10px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 10px 0 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-section li {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.legal-link {
  color: var(--macro-protein);
  text-decoration: underline;
  font-weight: 600;
}

.contact-box {
  background-color: var(--bg-pill);
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Responsive adjustments */
@media (max-width: 520px) {
  .hero-container {
    padding: 0 4px;
  }

  .store-buttons-container {
    flex-direction: column;
    width: 100%;
  }

  .store-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .app-mockup-wrapper {
    max-width: 100%;
  }

  .legal-card {
    padding: 24px 20px;
  }
}

