:root {
  --bg: #faf6ef;
  --card: #ffffff;
  --ink: #2f2a25;
  --muted: #8a7f72;
  --accent: #b4552d;
  --line: #e7ddcd;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.6 Georgia, "Times New Roman", serif;
}
.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem 1.5rem;
  padding: 1.2rem 1.5rem; border-bottom: 2px solid var(--line);
}
.brand { font-size: 1.6rem; font-weight: bold; color: var(--ink);
         text-decoration: none; }
nav { display: flex; gap: 1.2rem; }
nav a { color: var(--ink); }
nav a.accent { color: var(--accent); font-weight: bold; }
main { max-width: 64rem; margin: 0 auto; padding: 1.5rem; }
#filtre input[type=search] {
  width: 100%; font: inherit; font-size: 1.2rem;
  padding: .7rem 1rem; border: 2px solid var(--line); border-radius: .6rem;
  background: var(--card);
}
.toggle { display: block; margin: .7rem 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1.2rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip {
  padding: .25rem .9rem; border: 1.5px solid var(--line);
  border-radius: 999px; background: var(--card); cursor: pointer;
}
.chip:has(input:checked) {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.grid {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.card {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: .8rem; overflow: hidden; text-decoration: none;
  color: var(--ink);
}
.card img, .card .placeholder {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: flex;
  align-items: center; justify-content: center; font-size: 3rem;
  background: var(--bg);
}
.card h3 { margin: .6rem .9rem .1rem; font-size: 1.1rem; }
.card .cat { margin: 0 .9rem .8rem; color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); font-size: 1.2rem; text-align: center;
         padding: 3rem 0; }
.recipe h1 { margin-bottom: .2rem; }
.recipe .meta { color: var(--muted); display: flex; gap: 1rem;
                flex-wrap: wrap; margin-top: 0; }
.recipe h2 { font-size: 1.2rem; border-bottom: 1.5px solid var(--line);
             padding-bottom: .3rem; }
.ingredients li { margin: .25rem 0; }
.steps { white-space: pre-wrap; }
.originals { display: flex; gap: 1rem; flex-wrap: wrap; }
.originals img { max-width: 18rem; border-radius: .6rem;
                 border: 1.5px solid var(--line); }
.recipe-form label { display: block; margin: 1rem 0; }
.recipe-form input, .recipe-form textarea {
  width: 100%; font: inherit; padding: .5rem .7rem; margin-top: .25rem;
  border: 1.5px solid var(--line); border-radius: .5rem; background: var(--card);
}
.recipe-form .row { display: flex; gap: 1rem; flex-wrap: wrap; }
.recipe-form .row label { flex: 1 1 10rem; }
button {
  font: inherit; font-weight: bold; color: #fff; background: var(--accent);
  border: 0; border-radius: .6rem; padding: .7rem 1.6rem; cursor: pointer;
}
button.danger { background: #fff; color: #a33; border: 1.5px solid #a33; }
.danger-form { margin-top: 2rem; }
.notice { background: #fdf0e5; border: 1.5px solid var(--accent);
          border-radius: .6rem; padding: .8rem 1rem; }
.preview { max-width: 14rem; border-radius: .6rem;
           border: 1.5px solid var(--line); }
.import-form { margin-top: 1.5rem; display: flex; flex-direction: column;
               gap: 1rem; align-items: flex-start; }
.file-label {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .8rem 1rem; border: 1.5px solid var(--line);
  border-radius: .6rem; cursor: pointer; background: var(--card);
}

/* --- management actions --- */
.recipe .actions { display: flex; gap: .8rem; align-items: center;
                   margin: .4rem 0 1rem; }
.recipe .actions form { margin: 0; }
a.button {
  display: inline-block; text-decoration: none; font-weight: bold;
  padding: .55rem 1.3rem; border-radius: .6rem;
}
a.button.secondary {
  color: var(--accent); background: var(--card);
  border: 1.5px solid var(--accent);
}

/* --- loading states --- */
.search-row { position: relative; }
.spinner {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.search-row .spinner {
  position: absolute; right: 1rem; top: 50%; margin-top: -.7rem;
  opacity: 0; transition: opacity .15s ease;
}
.search-row .spinner.htmx-request { opacity: 1; }
#ocr-overlay {
  position: fixed; inset: 0; z-index: 10; display: none;
  background: rgba(250, 246, 239, .93);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem; text-align: center; font-size: 1.2rem; padding: 2rem;
}
#ocr-overlay.visible { display: flex; }
.spinner.big { width: 3rem; height: 3rem; border-width: 5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- motion --- */
#rezultate .grid, #rezultate .empty { animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); }
                    to { opacity: 1; transform: none; } }
.card { transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px);
              box-shadow: 0 6px 18px rgba(47, 42, 37, .12); }
button { transition: transform .1s ease; }
button:active { transform: scale(.97); }
button:disabled { opacity: .6; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --- bulk import --- */
.sep { border: 0; border-top: 2px solid var(--line); margin: 2.5rem 0 1.5rem; }
#drop-zone {
  border: 2px dashed var(--line); border-radius: .8rem;
  background: var(--card); padding: 2.5rem 1.5rem; text-align: center;
  font-size: 1.1rem; transition: border-color .15s ease,
  background-color .15s ease;
}
#drop-zone.peste { border-color: var(--accent); background: #fdf0e5; }
#drop-zone button {
  background: none; border: none; color: var(--accent); font: inherit;
  font-weight: bold; text-decoration: underline; padding: 0; cursor: pointer;
}
#lot-list { list-style: none; padding: 0; margin: 1rem 0; }
.lot-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: .5rem .2rem; border-bottom: 1.5px solid var(--line);
  animation: fadein .2s ease;
}
.lot-item span:first-child { overflow: hidden; text-overflow: ellipsis;
                             white-space: nowrap; }
.lot-chip { flex-shrink: 0; color: var(--muted); }
.lot-chip.lucru { color: var(--accent); }
.lot-chip.ok a { color: #2e7d32; }
.lot-chip.atentie a { color: var(--accent); }
.lot-chip.eroare { color: #a33; }
#lot-summary { font-weight: bold; }
