/* Fred's Cookbook — cooking.airedetest.be */
:root {
  --bg: #fdfcfa;
  --card: #ffffff;
  --ink: #171512;
  --muted: #71695f;
  --line: #e9e4dc;
  --accent: #b3432b;
  --accent-dark: #93341f;
  --accent-soft: #faf0ec;
  --star: #e8a33d;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 21, 18, .05), 0 6px 20px rgba(23, 21, 18, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(253, 252, 250, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo {
  font-family: var(--serif); font-weight: 600; font-size: 23px; letter-spacing: -.3px;
}
.logo em { font-style: italic; color: var(--accent); }
nav { display: flex; gap: 4px; align-items: center; }
nav a {
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px;
  color: var(--muted); transition: .15s;
}
nav a:hover, nav a.act { color: var(--accent); background: var(--accent-soft); }
.badge {
  display: inline-block; min-width: 19px; text-align: center;
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 11.5px; padding: 1.5px 6px; vertical-align: 2px;
}

/* ---------- Flash ---------- */
.flash {
  margin: 18px 0 0; padding: 13px 18px; border-radius: 10px; font-weight: 500; font-size: 15px;
  background: #eef7ee; border: 1px solid #cfe6cf; color: #1e5a1e;
}
.flash.warn { background: #fdf4e3; border-color: #f0dcb0; color: #7a5a12; }
.flash.err  { background: #fbeeec; border-color: #efc9c2; color: #8c2b18; }

/* ---------- Hero / recherche ---------- */
.hero { padding: 44px 0 8px; text-align: center; }
.hero h1 {
  margin: 0 0 6px; font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 5vw, 44px); letter-spacing: -.5px;
}
.hero p { margin: 0 0 22px; color: var(--muted); font-size: 15.5px; }
.search { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.search input {
  flex: 1; padding: 14px 20px; font: inherit; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--card);
  outline: none; transition: border-color .15s;
}
.search input:focus { border-color: var(--accent); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 19px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.danger:hover { border-color: #c22; color: #c22; }
.btn.small { padding: 7px 14px; font-size: 14px; }

/* ---------- Grille de cartes ---------- */
.grid {
  display: grid; gap: 26px 22px; padding: 30px 0 60px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card { display: flex; flex-direction: column; }
.thumb {
  aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(140deg, #f3ede4, #e9e0d2);
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.card:hover .thumb img { transform: scale(1.045); }
.thumb.ph { display: flex; align-items: center; justify-content: center; }
.thumb.ph span {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: 64px; color: #c9bba5;
}
.card h2 {
  margin: 0 0 5px; font-family: var(--serif); font-weight: 600;
  font-size: 19.5px; line-height: 1.3; letter-spacing: -.2px;
}
.card:hover h2 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.card .meta { color: var(--muted); font-size: 13.5px; margin-bottom: 6px; }
.card .cfoot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

/* ---------- Étoiles ---------- */
.stars { display: inline-flex; gap: 1px; }
.star { color: #ddd5c9; font-size: 17px; line-height: 1; }
.star.on { color: var(--star); }
.starform { display: inline; }
button.star { background: none; border: 0; padding: 0 1px; cursor: pointer; font-size: 23px; transition: transform .1s; }
button.star:hover { transform: scale(1.2); }

/* ---------- Page recette ---------- */
.recipe-hero {
  margin: 26px 0 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  max-height: 480px;
}
.recipe-hero img { width: 100%; max-height: 480px; object-fit: cover; display: block; }
.recipe-head { padding: 30px 0 6px; max-width: 820px; }
.recipe-head h1 {
  margin: 0 0 10px; font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 4.5vw, 42px); line-height: 1.15; letter-spacing: -.5px;
}
.recipe-head .meta {
  color: var(--muted); display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: center; font-size: 15px;
}
.recipe-head .meta a { color: var(--accent); }
.recipe-head .meta .auto-tr { color: var(--accent); font-style: italic; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 0 26px; }

/* Bascule de langue FR / EN */
.lang-toggle {
  display: inline-flex; margin-bottom: 14px;
  border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card);
}
.lang-toggle a {
  padding: 6px 16px; font-size: 14px; font-weight: 600; color: var(--muted); transition: .15s;
}
.lang-toggle a:hover { color: var(--accent); }
.lang-toggle a.on { background: var(--accent); color: #fff; }

.cols { display: grid; grid-template-columns: 340px 1fr; gap: 26px; padding: 0 0 30px; align-items: start; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow);
}
.panel h3 {
  margin: 0 0 14px; font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted);
}
.ing-list { list-style: none; margin: 0; padding: 0; font-size: 15.5px; }
.ing-list li { padding: 8px 0; border-bottom: 1px solid #f1ece4; }
.ing-list li:last-child { border-bottom: 0; }
.ing-list li.ing-head {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  color: var(--accent); border-bottom: 0; padding-top: 14px; font-size: 16.5px;
}

.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps-list li {
  counter-increment: step; position: relative;
  padding: 0 0 18px 52px; font-size: 16px; line-height: 1.65;
}
.steps-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--accent);
}
.steps-list li.step-head { padding-left: 0; counter-increment: none; }
.steps-list li.step-head::before { content: none; }
.steps-list li.step-head {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  color: var(--accent); font-size: 18px; padding-bottom: 10px;
}

/* ---------- Carnet de notes ---------- */
.notes-panel { background: #fbf7ef; border-color: #eee3cd; }
.note { padding: 12px 0; border-bottom: 1px dashed #e3d5b8; }
.note:last-of-type { border-bottom: 0; }
.note .when { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.note .when button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.note .when button:hover { color: #c22; }
.note .body { white-space: pre-wrap; margin-top: 3px; font-size: 15.5px; }
.note-form textarea {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 1.5px solid #e3d5b8; border-radius: 10px; background: #fff; outline: none; resize: vertical;
}
.note-form textarea:focus { border-color: var(--accent); }
.note-form { margin-top: 12px; }
.note-form .btn { margin-top: 8px; }

/* ---------- Formulaires ---------- */
.formgrid { display: grid; gap: 18px; padding: 8px 0 60px; max-width: 820px; margin: 0 auto; }
.formgrid label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
.formgrid input[type=text], .formgrid input[type=url], .formgrid textarea {
  width: 100%; padding: 12px 15px; font: inherit; font-size: 15.5px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); outline: none;
  transition: border-color .15s;
}
.formgrid input:focus, .formgrid textarea:focus { border-color: var(--accent); }
.formgrid textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- Onglets d'import ---------- */
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 4px 0 22px; }
.tab-btn {
  padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  color: var(--muted); transition: .15s;
}
.tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.tab-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-pane { display: none; max-width: 820px; margin: 0 auto 26px; }
.tab-pane.on { display: block; }
.import-box {
  background: var(--accent-soft); border: 1.5px dashed #e4b7a6;
  border-radius: var(--radius); padding: 22px 24px;
}
.import-box label { color: var(--accent-dark); font-weight: 700; font-size: 15px; display: block; margin-bottom: 10px; }
.import-box input[type=url], .import-box textarea {
  width: 100%; padding: 12px 15px; font: inherit; font-size: 15.5px;
  border: 1.5px solid #e4b7a6; border-radius: 10px; background: #fff; outline: none;
}
.import-box input[type=url]:focus, .import-box textarea:focus { border-color: var(--accent); }
.import-row { display: flex; gap: 10px; }
.import-row input { flex: 1; }
.progress { height: 8px; border-radius: 99px; background: #f0e2da; overflow: hidden; margin-top: 12px; display: none; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.ocr-preview { max-width: 240px; max-height: 180px; border-radius: 10px; margin-top: 12px; display: none; box-shadow: var(--shadow); }

.ai-help { max-width: 820px; margin: 10px auto 40px; }
.ai-help details {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 0 20px;
}
.ai-help summary { cursor: pointer; font-weight: 600; padding: 15px 0; color: var(--muted); }
.ai-help pre {
  background: #f7f4ef; border-radius: 10px; padding: 14px 16px; font-size: 13px;
  overflow-x: auto; white-space: pre-wrap;
}

/* ---------- Image de recette dans le formulaire ---------- */
.img-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.img-field img { width: 130px; height: 98px; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow); }

/* ---------- Liste de courses ---------- */
.shop-item { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1ece4; }
.shop-item:last-child { border-bottom: 0; }
.shop-item input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; align-self: center; }
.shop-item label { font-size: 15.5px; }
.shop-item .who { color: var(--muted); font-size: 12.5px; margin-left: auto; text-align: right; flex: none; max-width: 40%; }
.shop-item.done label { text-decoration: line-through; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0 18px; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 14px;
}
.chip form { display: inline; }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 15px; padding: 0 4px; }
.chip button:hover { color: #c22; }

/* ---------- Divers ---------- */
.empty { text-align: center; color: var(--muted); padding: 80px 0; }
.empty .big { font-size: 46px; }
.foot {
  text-align: center; color: var(--muted); font-size: 13.5px;
  padding: 26px 0 34px; border-top: 1px solid var(--line); margin-top: 20px;
  font-family: var(--serif); font-style: italic;
}

/* ---------- Login ---------- */
.login-box { max-width: 400px; margin: 12vh auto; text-align: center; padding: 0 20px; }
.login-box .panel { padding: 40px 34px; }
.login-box h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 6px 0 20px; }
.login-box h1 em { font-style: italic; color: var(--accent); }
.login-box input {
  width: 100%; padding: 13px 16px; font: inherit; text-align: center;
  border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 14px; outline: none;
}
.login-box input:focus { border-color: var(--accent); }
.err { color: #c22; font-weight: 600; margin: 0 0 12px; }

@media print {
  .top, .actions, .chips, .btn, .foot, .note-form, .tabs, .flash { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; box-shadow: none; padding: 0; }
}
