:root {
  color-scheme: light;
  font-family: Inter, UI, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #2f2e2b;
  background: #f5efe6;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: linear-gradient(180deg, #f8f2e7 0%, #fffaf5 100%);
}

.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.hero-panel {
  display: grid;
  gap: 24px;
  padding: 28px 28px 24px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 60px rgba(86, 64, 51, 0.08);
}

.eyebrow {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ad7f5e;
  margin-bottom: 12px;
}

.hero-panel h1 {
  margin: 0;
  font-size: clamp(2.5rem, 3.8vw, 4.25rem);
  line-height: 1.02;
  color: #3b2f29;
}

.hero-description {
  max-width: 720px;
  margin: 0;
  color: #64594f;
  font-size: 1.05rem;
}

.search-group {
  display: grid;
  gap: 10px;
}

.search-group label {
  font-weight: 600;
  color: #6d5c52;
}

#searchInput {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e3d6c7;
  border-radius: 18px;
  background: #fff;
  font-size: 1rem;
  color: #4f433b;
  outline: none;
}

.search-group input:focus {
  border-color: #b28658;
  box-shadow: 0 0 0 4px rgba(178, 134, 88, 0.12);
}

.content-grid {
  display: grid;
  gap: 28px;
  margin-top: 32px;
  grid-template-columns: minmax(320px, 430px) 1fr;
}

.recipe-form-panel,
.recipe-list-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(167, 135, 99, 0.15);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(104, 79, 62, 0.08);
}

.recipe-form-panel h2,
.recipe-list-panel h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.6rem;
  color: #3b2f29;
}

.list-header p {
  margin: 8px 0 0;
  color: #6d5c52;
}

.form-row {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.form-row label {
  font-weight: 600;
  color: #5e4c42;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  border: 1px solid #e3d6c7;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1rem;
  color: #4f433b;
  background: #fff;
}

.form-row textarea {
  resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #b28658;
  box-shadow: 0 0 0 4px rgba(178, 134, 88, 0.12);
}

.half-width {
  width: 100%;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #a6764d, #d89f71);
  border: none;
  border-radius: 18px;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(168, 118, 75, 0.22);
}

.recipe-grid {
  display: grid;
  gap: 22px;
}

.recipe-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid #f0e4d6;
  box-shadow: 0 18px 40px rgba(111, 86, 64, 0.08);
}

.recipe-card img {
  width: 100%;
  min-height: 200px;
  object-fit: cover;
  border-radius: 20px;
}

.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  color: #7a6355;
  font-size: 0.95rem;
}

.recipe-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff8f0;
}

.recipe-card h3 {
  margin: 0;
  color: #3b2f29;
  font-size: 1.35rem;
}

.recipe-card p {
  margin: 0;
  color: #5f4f47;
}

.recipe-section {
  display: grid;
  gap: 10px;
}

.recipe-section h4 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a6f5f;
}

.recipe-section pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #5f4f47;
}

.recipe-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.delete-button {
  border: 1px solid #e2b297;
  background: #fff5f1;
  color: #9b5d48;
  border-radius: 16px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.delete-button:hover {
  background: #f3d3c4;
  transform: translateY(-1px);
}

@media (max-width: 960px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 24px 16px 40px;
  }

  .hero-panel {
    border-radius: 24px;
  }

  .recipe-form-panel,
  .recipe-list-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .recipe-card {
    padding: 18px;
  }
}

/* ─── App header + user badge ─────────────────────────────────────────────── */

.app-header {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 16px;
}

.user-badge {
  font-size: 0.9rem;
  color: #6d5c52;
}

.user-badge strong {
  color: #3b2f29;
}

.user-badge .change-link {
  color: #ad7f5e;
  text-decoration: none;
  font-weight: 600;
}

.user-badge .change-link:hover {
  text-decoration: underline;
}

/* ─── Email modal ──────────────────────────────────────────────────────────── */

.email-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 33, 26, 0.5);
  backdrop-filter: blur(4px);
}

.email-modal[hidden] {
  display: none;
}

.email-modal-card {
  background: #fffaf5;
  border-radius: 28px;
  padding: 40px 36px;
  width: min(480px, 90vw);
  box-shadow: 0 40px 80px rgba(86, 64, 51, 0.22);
}

.email-modal-card h2 {
  margin: 0 0 10px;
  color: #3b2f29;
  font-size: 1.8rem;
}

.modal-description {
  margin: 0 0 24px;
  color: #64594f;
}
