/* Safe Recipes — purple primary + green accent palette */

:root {
  --bg: #faf7f2;
  --bg-alt: #f3f0fa;
  --fg: #2a1f14;
  --fg-muted: #6b5a48;
  --primary: #6B46C1;
  --primary-dark: #5539a8;
  --primary-light: #ede8fb;
  --accent: #38A169;
  --accent-light: #e8f5ec;
  --border: #e0d9f5;
  --card-bg: #fff;
  --green: #38A169;
  --green-light: #e8f5ec;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  line-height: 1.2;
}

/* ── Nav ── */
.site-nav {
  position: sticky;
  top: 0;
  background: var(--primary);
  border-bottom: none;
  z-index: 100;
  padding: 0 24px;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  text-decoration: none;
}

.nav-tagline {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
}

.nav-logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

@media (max-width: 480px) {
  .nav-logo-img {
    height: 36px;
  }
}

/* ── Hero ── */
.hero {
  padding: 80px 24px 72px;
  background: var(--primary-light);
}

.hero-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-headline {
  font-size: clamp(32px, 4vw, 52px);
  color: var(--fg);
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 19px;
  color: var(--fg-muted);
  max-width: 480px;
  line-height: 1.65;
}

/* Profile stack visual */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(107, 70, 193, 0.08);
}

.profile-card--dad { border-left: 4px solid var(--primary); }
.profile-card--kid { border-left: 4px solid var(--accent); }
.profile-card--mom { border-left: 4px solid #c96c2f; }

.profile-icon { font-size: 24px; }
.profile-name { font-weight: 600; font-size: 15px; color: var(--fg); flex: 1; }
.profile-tags { font-size: 13px; color: var(--fg-muted); }

.ai-recipe-output {
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.ai-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.ai-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.ai-note {
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
}

/* ── Section shared ── */
.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.section-headline {
  font-size: clamp(26px, 3.5vw, 40px);
  color: var(--primary);
  margin-bottom: 16px;
}

.section-body {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 40px;
}

/* ── Profiles ── */
.profiles {
  background: var(--bg-alt);
  padding: 72px 24px;
}

.profiles-inner { max-width: 1120px; margin: 0 auto; }

.profile-examples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 0;
}

.profile-example {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(107, 70, 193, 0.06);
}

.pe-badge {
  font-size: 32px;
  margin-bottom: 14px;
  display: block;
}

.profile-example h3 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 10px;
}

.profile-example p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Features ── */
.features { padding: 80px 24px; }
.features-inner { max-width: 1120px; margin: 0 auto; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-item {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(107, 70, 193, 0.05);
}

.feature-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 14px;
  filter: saturate(0.8);
}

.feature-item h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 10px;
}

.feature-item p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Community ── */
.community {
  background: var(--primary-light);
  padding: 72px 24px;
}

.community-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.community-list {
  list-style: none;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-list li {
  font-size: 16px;
  color: var(--fg-muted);
  padding-left: 20px;
  position: relative;
}

.community-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.community-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(107, 70, 193, 0.1);
}

.community-quote {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-style: italic;
  color: var(--fg);
  line-height: 1.5;
  margin-bottom: 24px;
}

.community-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.community-avatar { font-size: 28px; }

.community-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

.community-detail {
  font-size: 13px;
  color: var(--fg-muted);
}

/* ── Closing ── */
.closing {
  padding: 96px 24px;
  text-align: center;
  background: var(--primary);
}

.closing-headline {
  font-size: clamp(32px, 5vw, 56px);
  color: #fff;
  margin-bottom: 20px;
}

.closing-body {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Footer ── */
.site-footer {
  background: #1e1b2e;
  padding: 40px 24px;
  text-align: center;
}

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.footer-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
}

.footer-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
}

/* ── Nav links (household page) ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.nav-link--active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ── Household page layout ── */
.hp-header {
  background: var(--primary);
  padding: 48px 24px 40px;
}

.hp-header-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.hp-title {
  font-size: clamp(28px, 4vw, 44px);
  color: #fff;
  margin-bottom: 10px;
}

.hp-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.75);
  max-width: 540px;
  line-height: 1.6;
}

.hp-header .section-label {
  color: #b9f5d0;
}

.hp-main {
  padding: 40px 24px 80px;
  min-height: calc(100vh - 200px);
  background: var(--bg);
}

.hp-inner {
  max-width: 1120px;
  margin: 0 auto;
}

/* ── Member cards grid ── */
.hp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.member-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(107,70,193,0.07);
  transition: box-shadow 0.15s;
}

.member-card:hover {
  box-shadow: 0 4px 20px rgba(107,70,193,0.13);
}

.mc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.mc-avatar { font-size: 32px; flex-shrink: 0; }

.mc-info { flex: 1; min-width: 0; }

.mc-name {
  font-size: 18px;
  color: var(--fg);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-constraint-count {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
}

.mc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mc-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.12s;
  line-height: 1;
}

.mc-btn:hover { background: var(--bg-alt); }

.mc-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mc-tag-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.mc-tag-cat {
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
  white-space: nowrap;
}

.mc-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.mc-tag--allergy { background: #fde8e8; color: #c53030; }
.mc-tag--dislike { background: #fef3cd; color: #7b5800; }
.mc-tag--goal    { background: var(--green-light); color: #276749; }

.mc-no-tags {
  font-size: 13px;
  color: var(--fg-muted);
  font-style: italic;
}

/* ── Empty state ── */
.hp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
}

.hp-empty-icon { font-size: 56px; margin-bottom: 16px; }

.hp-empty-msg {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Add button ── */
.hp-add-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 18px 28px;
  font-size: 16px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}

.hp-add-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.hp-add-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 400;
  flex-shrink: 0;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,20,50,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay--open {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(30,20,50,0.25);
}

.modal--sm { max-width: 400px; padding: 28px; }
.modal--sm .delete-confirm-msg {
  font-size: 16px;
  color: var(--fg-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 22px;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.modal-close:hover { background: var(--bg-alt); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 28px 28px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* ── Form ── */
#member-form {
  padding: 0 28px;
}

.form-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group--avatar { flex-shrink: 0; }
.form-group--name   { flex: 1; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.req { color: var(--accent); }

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-error {
  font-size: 13px;
  color: #c53030;
  min-height: 18px;
  margin-bottom: 4px;
}

/* ── Avatar picker ── */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.avatar-opt {
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 20px;
  padding: 4px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  text-align: center;
  line-height: 1;
}

.avatar-opt:hover { background: var(--bg-alt); }

.avatar-opt--active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.avatar-preview {
  font-size: 32px;
  text-align: center;
  margin-top: 4px;
}

/* ── Color picker ── */
.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-opt {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}

.color-opt:hover { transform: scale(1.15); }

.color-opt--active {
  border-color: var(--fg);
  transform: scale(1.15);
}

/* ── Tag presets ── */
.tag-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag-preset {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.12s;
}

.tag-preset:hover { border-color: var(--primary); color: var(--primary); }

.tag-preset--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tag-custom-row {
  display: flex;
  gap: 8px;
}

.tag-custom-input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg);
  background: var(--bg);
  outline: none;
}

.tag-custom-input:focus { border-color: var(--primary); }

.tag-add-btn {
  padding: 7px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.12s;
}

.tag-add-btn:hover { background: var(--primary-light); }

/* ── Selected tags ── */
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
}

.selected-tag--allergy { background: #fde8e8; color: #c53030; }
.selected-tag--dislike  { background: #fef3cd; color: #7b5800; }
.selected-tag--goal     { background: var(--green-light); color: #276749; }

.selected-tag-remove {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
}

.selected-tag-remove:hover { opacity: 1; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn--ghost {
  background: var(--bg-alt);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.btn--ghost:hover:not(:disabled) { background: var(--border); }

.btn--danger {
  background: #e53e3e;
  color: #fff;
}

.btn--danger:hover:not(:disabled) { background: #c53030; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-grid,
  .community-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero { padding: 56px 20px 48px; }
  .profiles { padding: 56px 20px; }
  .features { padding: 56px 20px; }
  .community { padding: 56px 20px; }
  .closing { padding: 64px 20px; }

  .profile-examples,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual { order: -1; }
  .profile-card { padding: 10px 14px; }
}