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

:root {
  --purple:  #764ba2;
  --blue:    #667eea;
  --grad:    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad-h:  linear-gradient(135deg, #5a6fd6 0%, #6a3d96 100%);
  --white:   #ffffff;
  --bg:      #f4f4f8;
  --text:    #2d2d2d;
  --muted:   #888;
  --border:  #e8e8e8;
  --radius:  16px;
  --shadow:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-l:0 20px 60px rgba(0,0,0,0.22);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Layout mit Gradient-Header ────────────────────────────────────────────── */
body.has-nav { padding-top: 64px; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.navbar-brand {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.3px;
}
.navbar-brand span { opacity: 0.75; font-weight: 400; }
.navbar-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.18); color: #fff; }
.nav-user {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.15);
  padding: 6px 12px;
  border-radius: 99px;
}
.nav-logout {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-logout:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── Page container ────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}
.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card-sm { padding: 24px; }

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}
.page-header p {
  color: var(--muted);
  margin-top: 4px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(102,126,234,0.4);
}
.btn-primary:hover { background: var(--grad-h); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(102,126,234,0.5); }
.btn-secondary { background: #f0f0f4; color: #555; }
.btn-secondary:hover { background: #e4e4ea; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}
.form-control {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.form-control:focus { border-color: var(--purple); background: #fff; }

/* TOP 3 inputs */
.top3 { display: flex; flex-direction: column; gap: 8px; }
.top3-row { display: flex; align-items: center; gap: 10px; }
.top3-num {
  font-size: 18px;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* Choice buttons */
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice-btn {
  flex: 1;
  min-width: 100px;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  font-size: 14px;
  font-family: inherit;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.choice-btn:hover { border-color: var(--purple); color: var(--purple); background: #f5f0ff; }
.choice-btn.selected { border-color: var(--purple); background: var(--purple); color: #fff; }
.choice-hidden { display: none; }

/* ── Alert ──────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}
.alert-error { background: #fee2e2; color: #dc2626; }
.alert-success { background: #d1fae5; color: #065f46; }

/* ── Login page ─────────────────────────────────────────────────────────────── */
.login-body {
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 24px;
  padding: 44px 40px 36px;
  box-shadow: var(--shadow-l);
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.login-icon { font-size: 52px; margin-bottom: 12px; }
.login-title { font-size: 26px; font-weight: 800; color: var(--text); }
.login-sub { color: var(--muted); font-size: 14px; margin-top: 6px; margin-bottom: 28px; }
.login-card .form-control { text-align: center; font-size: 16px; }

/* Name chips (Wer bist du?) */
.name-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 20px; }
.name-chip {
  padding: 10px 18px;
  background: #f5f0ff;
  border: 2px solid #d8c8f0;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  color: var(--purple);
  cursor: pointer;
  transition: all 0.2s;
}
.name-chip:hover, .name-chip.selected { background: var(--purple); color: #fff; border-color: var(--purple); }
.divider { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0; position: relative; }
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ── Gemeinsame Hero-Section ─────────────────────────────────────────────────── */
.page-hero {
  background: var(--grad);
  padding: 48px 20px 36px;
  text-align: center;
  color: #fff;
}
.page-hero h1 { font-size: 28px; font-weight: 800; }
.page-hero p  { opacity: 0.85; margin-top: 6px; font-size: 15px; }
.page-hero .hero-emoji { font-size: 48px; margin-bottom: 10px; }
.page-hero .hero-actions { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Dashboard grid ─────────────────────────────────────────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.profile-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}
.profile-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.15); }
.profile-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}
.profile-card-img img { width: 100%; height: 100%; object-fit: cover; }
.profile-card-body { padding: 16px; }
.profile-card-name { font-size: 17px; font-weight: 700; }
.profile-card-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }

.profile-card-add {
  background: #fafafa;
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 240px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}
.profile-card-add:hover { border-color: var(--purple); color: var(--purple); }
.profile-card-add-icon { font-size: 36px; }

/* ── Profil-Seite ────────────────────────────────────────────────────────────── */
.profil-hero {
  background: var(--grad);
  padding: 48px 20px 80px;
  text-align: center;
  color: #fff;
  position: relative;
}
.profil-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,0.5);
  object-fit: cover;
  font-size: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  margin: 0 auto 16px;
  overflow: hidden;
}
.profil-photo img { width: 100%; height: 100%; object-fit: cover; }
.profil-name { font-size: 32px; font-weight: 800; }
.profil-meta { opacity: 0.85; font-size: 15px; margin-top: 4px; }

.profil-body { max-width: 720px; margin: -48px auto 0; padding: 0 20px 40px; position: relative; }
.profil-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; margin-bottom: 20px; }
.profil-card h2 { font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--purple); margin-bottom: 18px; }
.profil-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.profil-row:last-child { border-bottom: none; }
.profil-q { color: var(--muted); min-width: 200px; flex-shrink: 0; }
.profil-a { font-weight: 600; color: var(--text); }
.profil-edit-btn { position: absolute; top: 16px; right: 20px; }

/* ── Bearbeiten ──────────────────────────────────────────────────────────────── */
.form-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.step-tab {
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--border);
  background: #fafafa;
  color: var(--muted);
  transition: all 0.2s;
}
.step-tab.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.step-tab:hover:not(.active) { border-color: var(--purple); color: var(--purple); }

.form-section { display: none; }
.form-section.active { display: block; }

/* Foto-Upload Preview */
.photo-upload-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.photo-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--border);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Essens-Generator ────────────────────────────────────────────────────────── */
.food-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.food-chip {
  padding: 10px 18px;
  border-radius: 99px;
  border: 2px solid var(--border);
  background: #fafafa;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.food-chip.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.food-chip:hover { border-color: var(--purple); }

.result-box {
  text-align: center;
  padding: 32px;
  background: var(--grad);
  border-radius: var(--radius);
  color: #fff;
  margin-top: 24px;
  display: none;
}
.result-box.show { display: block; animation: pop 0.4s cubic-bezier(0.175,0.885,0.32,1.275); }
@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.result-emoji { font-size: 56px; margin-bottom: 10px; }
.result-label { font-size: 14px; opacity: 0.85; }
.result-name  { font-size: 32px; font-weight: 800; margin-top: 6px; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .navbar { padding: 0 14px; }
  .navbar-brand span { display: none; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
  .container { padding: 20px 14px; }
  .card { padding: 20px; }
  .profil-card { padding: 20px; }
  .profil-q { min-width: 140px; }
  .login-card { padding: 32px 22px 28px; }
  .profil-body { padding: 0 12px 32px; }
}
