@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* MoiteKalorii брандинг: "Яж спокойно. Ние броим." */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --text: #0F172A;
  --text-muted: #64748B;
  --accent: #22C55E;
  --accent-2: #F59E0B;
  --danger: #EF4444;
  --radius: 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3, h4, .brand {
  font-family: 'Manrope', 'Inter', sans-serif;
}

.value, .stat-box .value {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { background: rgba(34, 197, 94, 0.1); color: var(--accent); }
.nav-links a.logout { color: var(--danger); }
.nav-links a.logout:hover { background: rgba(239, 68, 68, 0.08); }

.content {
  flex: 1;
  padding: 32px 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

h2 { margin-top: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; color: var(--text-muted); font-weight: 700; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 0.95rem;
}

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
}

textarea { min-height: 90px; resize: vertical; }

button, .btn {
  background: var(--accent);
  color: #0b1210;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: transform 0.1s, opacity 0.15s;
}

button:hover, .btn:hover { opacity: 0.9; }
button:active { transform: scale(0.98); }

ul { list-style: none; padding: 0; }

li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

progress {
  width: 100%;
  height: 14px;
  border-radius: 8px;
  overflow: hidden;
  appearance: none;
}
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 8px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }

.error { color: var(--danger); }
.success { color: var(--accent); }

.auth-page .content {
  max-width: 380px;
  display: flex;
  align-items: center;
  min-height: 80vh;
}

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-box {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 18px;
  flex: 1;
  min-width: 120px;
}
.stat-box .label { color: var(--text-muted); font-size: 0.8rem; }
.stat-box .value { font-size: 1.4rem; font-weight: 700; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.photo-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.photo-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.photo-card .photo-info {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.photo-card .photo-info .date { font-weight: 600; }
.photo-card .photo-info .weight { color: var(--accent); }
.photo-card .photo-info .note { color: var(--text-muted); margin-top: 2px; }

.photo-card .photo-select {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.photo-card .photo-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(20,20,24,0.7);
  color: var(--danger);
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.compare-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.compare-col {
  flex: 1;
  min-width: 220px;
  text-align: center;
}

.compare-col img {
  width: 100%;
  border-radius: var(--radius);
}