/* CRUMB website: forms, the cookie-preferences banner and dialog, and policy-update notices.
   Uses the colour tokens defined at the top of site.css; nothing new is invented here.
   Linked from the pages with forms; consent.js adds it to any other page when it needs it. */

/* ---------- Forms (additions to the shared .form styles in site.css) ---------- */

.form select,
.form input[type="number"],
.form input[type="file"] {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--glass-card-strong, var(--canvas));
  box-shadow: var(--glass-sheen, none);
  color: var(--ink);
  font: inherit;
}
.form input[type="file"] { padding: 12px 14px; }
.form input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
/* 16px and up stops iPhone Safari zooming into a field when it is tapped. */
.form input, .form textarea, .form select { font-size: max(1rem, 16px); }
.form__hint { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 0.875rem; font-weight: 400; }
.form__check { align-items: flex-start; }
.form__check input { flex: none; margin-top: 2px; }
.form__check label { font-weight: 600; }
.form__note { min-height: 1.4em; margin-top: 6px; color: var(--terracotta-deep); font-size: 0.875rem; font-weight: 600; }
.form button[type="submit"] { width: 100%; }
@media (min-width: 560px) { .form button[type="submit"] { width: auto; } }
.form button[disabled] { opacity: 0.7; cursor: progress; }
.form .form__legend { margin: 6px 0 12px; font-size: 1.05rem; font-weight: 800; }
.form fieldset { margin: 0 0 8px; padding: 0; border: 0; }

/* The panel shown instead of a form when this copy of the site cannot receive forms. */
.forms-fallback {
  margin-top: 18px;
  padding: clamp(20px, 3vw, 28px);
  border: 2px dashed var(--line-strong);
  border-radius: 20px;
  background: var(--raised);
}
.prose .forms-fallback h3 { margin-top: 0; }
.forms-fallback .btn { margin-top: 14px; }

/* A short call to action near the top of a long page (the creator programme on phones). */
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

/* Restaurant page: how the figures are labelled. */
.source-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 0; list-style: none; }
.prose .source-pills { padding-left: 0; list-style: none; }
.prose .source-pills li { margin-top: 0; }
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
}
.source-pill--published { background: var(--mint); color: var(--mint-deep); }
.source-pill--estimate { background: var(--terracotta-soft); color: var(--terracotta-deep); }
.source-pill--unknown { background: var(--sunk); color: var(--ink); }

.steps { display: grid; gap: 14px; margin-top: 22px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--raised) 78%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}
.prose .step p { margin-top: 6px; color: var(--ink-soft); font-size: 0.975rem; }
.step__emoji { display: block; font-size: 1.5rem; line-height: 1; }
.prose .step h3 { margin-top: 10px; font-size: 1.1rem; }

/* ---------- Cookie preferences: the first-visit banner ---------- */

.consent {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  max-width: 640px;
  max-height: calc(100vh - 32px);
  margin: 0 auto;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--glass-card-edge, var(--line-strong));
  border-radius: var(--radius-card);
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--glass-sheen, none), 0 28px 60px -24px rgba(0, 0, 0, 0.55);
}
/* Floating glass, like the header and the section bar; solid where blur is not available or
   less transparency is asked for (site.css switches every blur off then). */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .consent {
    background: var(--glass-float, color-mix(in srgb, var(--raised) 94%, transparent));
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
  }
}
@media (prefers-reduced-transparency: reduce) { .consent { background: var(--raised); } }
.consent__title { font-size: 1.15rem; letter-spacing: -0.01em; }
.consent__text { margin-top: 8px; color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.5; }
.consent__text a { color: var(--terracotta-deep); font-weight: 700; }
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.consent__actions .consent__btn:last-child { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .consent__actions { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .consent__actions .consent__btn:last-child { grid-column: auto; }
}
@media (max-width: 559.98px) {
  .consent { padding: 16px; }
  .consent__title { font-size: 1.05rem; }
  .consent__text { font-size: 0.875rem; }
  .consent__btn { min-height: 44px; padding: 8px 12px; }
}

/* All three choices look the same: no option is pushed harder than another. */
.consent__btn {
  min-height: 48px;
  padding: 10px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}
.consent__btn:hover { background: var(--sunk); }
.consent__btn--quiet { border-color: transparent; background: none; color: var(--ink-soft); }

/* ---------- Cookie preferences: the dialog ---------- */

.consent-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 24px;
  border: 1px solid var(--glass-card-edge, var(--line-strong));
  border-radius: var(--radius-card);
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--glass-sheen, none), 0 28px 60px -24px rgba(0, 0, 0, 0.55);
}
.consent-dialog::backdrop { background: rgba(17, 19, 21, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.consent-dialog h2 { font-size: 1.4rem; }
.consent-dialog > p { margin-top: 8px; color: var(--ink-soft); font-size: 0.9375rem; }
.consent__category { margin-top: 16px; padding: 16px; border: 1px solid var(--glass-card-line, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--canvas) 70%, transparent); }
.consent__category p { margin-top: 6px; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }
.consent__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.consent__row h3 { font-size: 1.05rem; }
.consent__always { color: var(--mint-deep); font-size: 0.875rem; font-weight: 700; }
.consent__switch { width: 26px; height: 26px; accent-color: var(--terracotta); }
.consent__status { min-height: 1.4em; margin-top: 12px; color: var(--mint-deep); font-weight: 700; font-size: 0.9375rem; }
.consent-dialog .consent__btn--quiet { display: block; margin: 10px auto 0; }

/* ---------- Policy-update notice ---------- */

.policy-notice {
  position: relative;
  display: grid;
  gap: 4px;
  margin: 12px auto 0;
  width: min(var(--wrap), calc(100% - 2 * var(--gutter)));
  padding: 14px 18px;
  border: 2px solid var(--terracotta);
  border-radius: 18px;
  background: var(--terracotta-soft);
  color: var(--ink);
  font-size: 0.9375rem;
}
.policy-notice__title { font-weight: 800; color: var(--terracotta-deep); }
.policy-notice__links a { font-weight: 700; color: var(--terracotta-deep); }
.policy-notice .consent__btn { justify-self: start; min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  .consent, .step { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print {
  .consent, .consent-dialog, .policy-notice { display: none !important; }
}
