/* ===== Foodlab · kraft-paper / label stijl ===== */

:root {
  --kraft: #c9a876;
  --kraft-dark: #b08d5b;
  --kraft-deep: #8a6d3b;
  --paper: #f7f0e1;
  --paper-2: #efe4cc;
  --ink: #3a2e21;
  --ink-soft: #6b5a45;
  --line: #d8c7a0;
  --shadow: rgba(58, 46, 33, 0.25);

  /* Categorie-kleuren */
  --cat-jam: #c0455b;
  --cat-chutney: #b5651d;
  --cat-compote: #8e5a9e;
  --cat-groente: #4f7942;
  --cat-anders: #5a7d8c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Courier Prime", "Courier New", monospace;
  color: var(--ink);
  min-height: 100vh;
  background-color: var(--kraft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

.hidden {
  display: none !important;
}

/* ===== Label-kaart (kraft-paper met tape) ===== */
.label-card {
  position: relative;
  background: var(--paper);
  background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='40' height='40' filter='url(%23p)' opacity='0.04'/%3E%3C/svg%3E");
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 10px 30px var(--shadow);
}

/* Washi-tape hoeken */
.tape {
  position: absolute;
  width: 90px;
  height: 26px;
  background: rgba(214, 197, 156, 0.75);
  border: 1px dashed rgba(138, 109, 59, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.tape-tl {
  top: -12px;
  left: 22px;
  transform: rotate(-4deg);
}
.tape-br {
  bottom: -12px;
  right: 22px;
  transform: rotate(-3deg);
}

/* ===== Buttons ===== */
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: 3px;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
  letter-spacing: 0.02em;
}
.btn:active {
  transform: translateY(1px);
}
.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: #4d3d2c;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover {
  background: rgba(58, 46, 33, 0.08);
}
.btn-danger {
  background: var(--cat-jam);
  color: #fff;
  border-color: #8f2f40;
}
.btn-danger:hover {
  background: #a83a4d;
}

/* ===== Login ===== */
.view {
  min-height: 100vh;
}
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem 2rem;
}
.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}
.brand-mark {
  font-size: 2.5rem;
}
.brand-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 2.4rem;
  margin: 0.2rem 0 0;
  letter-spacing: -0.02em;
}
.brand-sub {
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: var(--ink-soft);
  margin: 0.1rem 0 0;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.login-form label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--line);
  border-radius: 3px;
  padding: 0.6rem 0.7rem;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--kraft-deep);
  box-shadow: 0 0 0 3px rgba(138, 109, 59, 0.15);
}
.login-form .btn {
  margin-top: 0.5rem;
}
.login-hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 0.6rem 0 0;
}
.login-sent {
  text-align: center;
}
.login-sent .check {
  font-size: 2.5rem;
  margin: 0;
}
.login-sent p {
  color: var(--ink-soft);
}
.login-sent strong {
  color: var(--ink);
}

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 3px 12px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.topbar-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 1.4rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.user-email {
  font-size: 0.85rem;
  opacity: 0.85;
}
.topbar .btn-ghost {
  color: var(--paper);
  border-color: var(--paper);
}
.topbar .btn-ghost:hover {
  background: rgba(247, 240, 225, 0.15);
}

/* ===== Controls ===== */
.controls {
  max-width: 1100px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.search-wrap {
  flex: 1 1 260px;
}
.filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.filters select {
  width: auto;
  cursor: pointer;
}

/* ===== Recepten-grid ===== */
.recipes-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 4rem;
}
.recipe-count {
  font-size: 0.85rem;
  color: var(--paper);
  opacity: 0.9;
  margin: 0.25rem 0 1rem;
  text-shadow: 0 1px 2px var(--shadow);
}
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.recipe-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 8px solid var(--cat, var(--kraft-deep));
  border-radius: 4px;
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 6px 18px var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.recipe-card:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  box-shadow: 0 12px 26px var(--shadow);
}
.card-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  background: var(--cat, var(--kraft-deep));
}
.badge-season {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.card-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0;
}
.card-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
}
.card-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: auto;
}
.tag-chip {
  font-family: "Caveat", cursive;
  font-size: 1rem;
  line-height: 1;
  background: var(--paper-2);
  border: 1px dashed var(--line);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  color: var(--ink-soft);
}
.card-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.6rem;
  margin-top: 0.2rem;
}

/* Categorie-accenten */
.cat-jam { --cat: var(--cat-jam); }
.cat-chutney { --cat: var(--cat-chutney); }
.cat-compote { --cat: var(--cat-compote); }
.cat-groente { --cat: var(--cat-groente); }
.cat-anders { --cat: var(--cat-anders); }

/* ===== Empty / loading ===== */
.empty-state,
.loading-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--paper);
  text-shadow: 0 1px 2px var(--shadow);
}
.empty-emoji {
  font-size: 3rem;
  margin: 0;
}
.empty-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  margin: 0.4rem 0 0.2rem;
}
.empty-sub {
  opacity: 0.9;
  margin: 0;
}

/* ===== Modals ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 27, 18, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
  overflow-y: auto;
  z-index: 50;
}
.modal {
  width: 100%;
  max-width: 680px;
  padding: 2rem 1.75rem 1.75rem;
}
.modal-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
}
.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}
.modal-close:hover {
  color: var(--ink);
}

.recipe-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.field-full {
  grid-column: 1 / -1;
}
.field label {
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ===== Detail-weergave ===== */
.detail-card {
  max-width: 640px;
}
.detail-header {
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}
.detail-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  font-size: 1.9rem;
  margin: 0.5rem 0 0.4rem;
}
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}
.detail-meta-item {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
}
.detail-meta-item .k {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  display: block;
}
.detail-meta-item .v {
  font-weight: 700;
}
.detail-section h3 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  margin: 1.2rem 0 0.4rem;
}
.detail-section p,
.detail-section li {
  white-space: pre-wrap;
  line-height: 1.55;
}
.detail-section ul {
  margin: 0;
  padding-left: 1.2rem;
}
.detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
}
.detail-created {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 1rem;
}

.confirm-card {
  max-width: 420px;
  text-align: center;
}
.confirm-card .modal-actions {
  justify-content: center;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(200%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.8rem 1.4rem;
  border-radius: 4px;
  box-shadow: 0 8px 24px var(--shadow);
  z-index: 100;
  transition: transform 0.3s ease;
  font-weight: 700;
  max-width: 90vw;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  background: var(--cat-jam);
}

/* ===== Responsive ===== */
@media (max-width: 560px) {
  .recipe-form {
    grid-template-columns: 1fr;
  }
  .controls {
    padding: 0 1rem;
  }
  .recipes-main {
    padding: 1.25rem 1rem 4rem;
  }
  .topbar {
    padding: 0.8rem 1rem;
  }
  .user-email {
    display: none;
  }
}
