/* App styles layered on top of Pico.css (classless base). Pico handles the
   typography, inputs, selects, checkboxes and buttons; this file only sets the
   brand accent and the app-specific components Pico does not cover. */

:root {
  /* Brand palette */
  --accent: #d98324;
  --accent-dark: #b96d16;
  --muted: #6b6b6b;
  --error: #c0392b;
  --bg-soft: #faf7f2;

  /* Recolour Pico's primary (buttons, links, focus ring) to the brand accent */
  --pico-primary: var(--accent-dark);
  --pico-primary-hover: #99560d;
  --pico-primary-background: var(--accent);
  --pico-primary-hover-background: var(--accent-dark);
  --pico-primary-border: var(--accent);
  --pico-primary-hover-border: var(--accent-dark);
  --pico-primary-focus: rgba(217, 131, 36, .3);
  --pico-primary-underline: rgba(185, 109, 22, .5);

  /* Slightly tighter reading width for the embedded form */
  --pico-spacing: 1rem;
}

/* Page container (Pico does not constrain body width without .container) */
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Header image on the public pages */
.hero {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1.25rem;
}

h1 { font-size: 1.6rem; }
.lead { color: var(--muted); margin-top: -.4rem; }
.muted { color: var(--muted); }

/* Choice landing */
.choices { display: grid; gap: 1rem; }
.choice {
  display: block;
  padding: 1.25rem 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--bg-soft);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.choice:hover { border-color: var(--accent); }

/* Form fields: Pico styles the controls; we handle wrapper spacing, the
   required marker, the consent checkbox layout and error states. */
.field { margin-bottom: 1.1rem; }
.req { color: var(--error); }
.note { color: var(--muted); font-size: .9rem; }

.checkbox { display: flex; gap: .6rem; align-items: flex-start; }
/* Keep the checkbox a fixed square; without flex-shrink:0 it collapses into a
   thin vertical strip next to the long consent text. */
.checkbox input[type=checkbox] {
  flex: 0 0 auto;
  width: 1.25em;
  height: 1.25em;
  margin: .15rem 0 0;
}

.field-error { color: var(--error); font-size: .875rem; margin-top: .3rem; }
.field--error input,
.field--error select,
.field--error textarea {
  --pico-form-element-border-color: var(--error);
  --pico-form-element-active-border-color: var(--error);
}

.banner { padding: .75rem 1rem; border-radius: var(--pico-border-radius); margin-bottom: 1.25rem; }
.banner--error { background: #fdecea; color: var(--error); }

/* Buttons: a shared look for both <button> and <a> triggers. The class beats
   Pico's element selectors, keeping buttons and button-like links consistent. */
.btn {
  display: inline-block;
  width: auto;
  padding: .65rem 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--pico-border-radius);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--ghost {
  background: transparent;
  color: var(--accent-dark);
  border-color: var(--pico-muted-border-color);
}
.btn--ghost:hover { background: var(--bg-soft); color: var(--accent-dark); }

/* Honeypot: visually and semantically hidden, but present in the DOM. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Address autocomplete dropdown */
.dadata-wrap { position: relative; }
.dadata-list {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  background: var(--pico-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .1);
  max-height: 260px;
  overflow-y: auto;
}
.dadata-item { padding: .5rem .7rem; cursor: pointer; }
.dadata-item.is-active,
.dadata-item:hover { background: var(--bg-soft); }

/* Admin */
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-top form { margin: 0; }
.table-scroll { overflow-x: auto; }
.admin-table .nowrap { white-space: nowrap; }
.admin-table.detail th { width: 34%; vertical-align: top; color: var(--muted); }
.admin-table.detail td.ua { word-break: break-all; font-size: .85rem; color: var(--muted); }

.filter { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.filter label { margin: 0; }
.filter input { width: auto; margin: 0; }
.filter .btn { padding: .5rem 1rem; }
.filter .clear { font-size: .9rem; }
.filter .export { margin-left: auto; }

.pager { display: flex; gap: 1.25rem; align-items: center; margin-top: 1.25rem; }

/* Policy page */
.policy p { margin: 0 0 1rem; }
.doc-version { margin-top: 2rem; color: var(--muted); font-size: .85rem; }
