:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.88);
  --text: #172033;
  --muted: #647084;
  --line: rgba(23, 32, 51, 0.11);
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --green: #16a34a;
  --orange: #ea580c;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(145deg, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(22, 163, 74, 0.12), transparent 40%),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.login-view {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 34px;
  align-items: center;
}

.login-view h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.6rem, 6.4vw, 6rem);
  line-height: 0.93;
  letter-spacing: 0;
}

.intro {
  max-width: 580px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.eyebrow {
  width: fit-content;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 54px rgba(24, 42, 72, 0.09);
}

.panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.login-panel {
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.metric-card strong {
  font-size: 1.6rem;
}

.metric-card[data-status="good"] strong {
  color: var(--green);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.wide-panel {
  grid-column: span 1;
}

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

.compact-form {
  display: grid;
  gap: 12px;
}

.split-line {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.wide {
  grid-column: 1 / -1;
}

.plan-list {
  display: grid;
  gap: 12px;
}

.plan-day {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.66);
}

.plan-day div,
.meal-list article,
.history-row {
  display: grid;
  gap: 4px;
}

.plan-day span,
.meal-list span,
.history-row span,
.empty {
  color: var(--muted);
}

ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.nutrition-list,
.meal-list,
.history-list {
  display: grid;
  gap: 12px;
}

.history-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.history-row.success {
  border-color: rgba(22, 163, 74, 0.34);
  background: rgba(220, 252, 231, 0.55);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .login-view,
  .topbar,
  .grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

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

@media (max-width: 560px) {
  .login-view h1 {
    font-size: clamp(2.4rem, 13vw, 4.2rem);
  }

  .topbar h1 {
    font-size: clamp(2rem, 12vw, 3.3rem);
  }
}
