@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800;900&display=swap");

:root {
  --bg: #effaf5;
  --surface: #ffffff;
  --surface-soft: #f1fbf6;
  --primary: #05b86b;
  --primary-dark: #047a4c;
  --primary-light: #18c979;
  --accent: #f6c36a;
  --text: #202538;
  --muted: #626d7b;
  --border: #dfe8e3;
  --danger: #c45b4b;
  --shadow: 0 18px 45px rgba(32, 37, 56, 0.12);
  --font-main: "Manrope", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 0%, rgba(5, 184, 107, 0.14), transparent 34%),
    radial-gradient(circle at 100% 14%, rgba(223, 244, 255, 0.78), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-screen {
  padding: 20px 18px 92px;
  min-height: 100vh;
  animation: fadeIn 180ms ease-out;
}

.hidden {
  display: none !important;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark) 58%, var(--primary-light));
  color: #fff;
  box-shadow: 0 24px 60px rgba(5, 184, 107, 0.24);
}

.progress-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.progress-mini-grid span {
  display: block;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: #fff;
}

.macro-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.macro-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.86);
}

.legend-color {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 999px;
}

.legend-calories {
  background: var(--accent);
}
.legend-protein {
  background: #86efac;
}
.legend-carbs {
  background: #fdba74;
}
.legend-fat {
  background: #c4b5fd;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.top-row,
.section-title,
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: inherit;
  opacity: 0.74;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 900;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
  letter-spacing: -0.025em;
  color: var(--text);
  font-weight: 900;
}

h3 {
  margin-bottom: 4px;
  font-size: 15px;
  color: var(--text);
  font-weight: 900;
}

p {
  font-weight: 500;
}

.hero-copy {
  max-width: 250px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.avatar {
  width: 56px !important;
  height: 56px !important;
  display: block !important;
  border-radius: 18px !important;
  background: url("./icons/LOGO.png?v=logo-png-20260629") center / contain
    no-repeat !important;
  box-shadow: none !important;
  color: transparent !important;
  font-size: 0 !important;
  overflow: visible !important;
}

.avatar::before,
.avatar::after {
  display: none !important;
  content: none !important;
}

.progress-ring {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--primary-light) var(--progress, 0%),
    rgba(255, 255, 255, 0.22) 0
  );
}

.progress-ring span,
.progress-ring small {
  grid-area: 1 / 1;
}

.progress-ring span {
  margin-top: -12px;
  font-size: 28px;
  font-weight: 900;
}

.progress-ring small {
  margin-top: 34px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.secondary-summary-grid {
  margin-top: 0;
}

.remaining-info-card {
  padding: 12px 16px;
}

.remaining-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.remaining-info-row:last-child {
  border-bottom: 0;
}

.remaining-info-row span {
  color: var(--muted);
  font-size: 13px;
}

.remaining-info-row strong {
  font-size: 14px;
  color: var(--text);
}

.summary-card,
.section-card,
.timeline-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(32, 37, 56, 0.07);
}

.summary-card {
  padding: 16px;
}

.summary-card span,
.summary-card small,
.helper-text,
.empty-state,
.timeline-card p,
.section-card p {
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 20px;
  color: var(--text);
}

.section-card {
  margin-top: 14px;
  padding: 18px;
}

.accent-card {
  background: linear-gradient(140deg, #ffffff, var(--surface-soft));
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 900;
}

.plan-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.plan-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.plan-list li:last-child {
  border-bottom: 0;
}

.field-label {
  display: block;
  margin: 12px 0 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

textarea:focus,
input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(5, 184, 107, 0.12);
}

.primary-button,
.secondary-button {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 18px;
  padding: 15px 18px;
  font-weight: 900;
}

.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(5, 184, 107, 0.22);
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.danger-button {
  color: var(--danger);
  background: #fff4f1;
}

.photo-source-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.photo-source-row .photo-source-button {
  margin-top: 0;
}

.quick-grid,
.goal-template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-button,
.goal-template-button {
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 900;
  text-align: left;
  padding: 12px;
}

.quick-button strong,
.goal-template-button strong,
.quick-button small,
.goal-template-button small {
  display: block;
}

.quick-button small,
.goal-template-button small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.goal-template-grid {
  grid-template-columns: 1fr;
}

.goal-template-button {
  min-height: 76px;
}

.timeline-card {
  padding: 10px 18px;
}

.timeline-card article {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-card article:last-child {
  border-bottom: 0;
}

.timeline-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-soft);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
}

.check-row:last-child {
  border-bottom: 0;
}

.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary-light);
}

.log-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.log-item:last-child {
  border-bottom: 0;
}

.log-item strong {
  display: block;
  margin-bottom: 4px;
}

.log-item small,
.log-item time {
  color: var(--muted);
}

.log-main {
  min-width: 0;
}

.log-main small {
  display: block;
  line-height: 1.45;
}

.log-item-detailed {
  align-items: flex-start;
}

.log-item-detailed time {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
}

.log-actions {
  margin-top: 4px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  width: min(calc(100% - 28px), 402px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 30px rgba(32, 37, 56, 0.12);
}

.nav-item {
  border: 0;
  border-radius: 17px;
  padding: 9px 4px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.nav-item span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 900;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(5, 184, 107, 0.22);
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(32, 37, 56, 0.38);
  backdrop-filter: blur(10px);
}

.access-gate.hidden {
  display: none !important;
}

.access-card {
  width: min(100%, 390px);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.access-card h1 {
  color: var(--primary-dark);
}

#access-gate-message {
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 800;
}

.fitara-tester-toggle {
  display: block;
  margin: 6px auto 0;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

#fitara-tester-fallback {
  margin-top: 10px;
}

.fitara-legal-links {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

.fitara-legal-links a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .phone-shell {
    width: 100%;
    box-shadow: none;
  }

  .app-screen {
    padding-inline: 14px;
  }

  .access-gate {
    padding: 16px;
  }

  .access-card {
    width: 100%;
    max-width: 360px;
    padding: 20px;
  }

  .access-card h1 {
    font-size: 28px;
  }
}

@media (min-width: 720px) {
  body {
    padding: 32px;
  }

  .phone-shell {
    min-height: 860px;
    border-radius: 38px;
  }

  .bottom-nav {
    bottom: 46px;
  }
}
