/*
 * Growth Partner — secondary pages (UX overhaul 7a)
 *
 * The pages without a ticket of their own: installaties, FAVV, EPB, Nieuw
 * KBO-bedrijf, feedback, the login/unlock card and the /admin shell. Built from
 * the gp- components in ux_components.css; this file only adds the page-level
 * glue (page head, card stacks, table and form chrome, login card, admin tab
 * row). Spec: the mock-up's app.css (card, table.t, .in) and the login card.
 *
 * Rules: classes only (CSP), text colours via the tokens (AA 4.5:1, guarded by
 * test/assets/color_contrast_test.rb), green is a fill never a text colour.
 * Pico makes <button>/<form>/<input> full width, so widths are restated.
 * Phone rules at the bottom.
 */

/* ── Page head: plain title, optional quiet meta, actions on the right ── */
.gp-page-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  margin: 0 0 16px;
}
.gp-page-meta { color: var(--gp-body); font-size: 0.9rem; }
.gp-page-actions { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.gp-page-actions form { margin: 0; }
.gp-page-lead { margin: -8px 0 16px; max-width: 62ch; color: var(--gp-body); }

/* Back link above a show page: a quiet navy text link, 40px tall target. */
.gp-back {
  display: inline-flex; align-items: center; min-height: 40px; margin: 0 0 4px;
  color: var(--gp-navy); font-weight: 600; font-size: 0.85rem; text-decoration: none;
}
.gp-back:hover { text-decoration: underline; }

/* ── Stacks and grids of cards ── */
.gp-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gp-card-grid {
  display: grid; gap: 16px; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}
.gp-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.gp-card > h2, .gp-card > h3 { margin: 0; }
.gp-card > p { margin: 0; }
.gp-card form { margin: 0; }
.gp-card dl { margin: 0; }
.gp-card dd:last-child { margin-bottom: 0; }

/* A score badge sits inline in a page head or a table cell. */
.gp-score-blocked { background: var(--gp-red-tint); color: var(--gp-red-ink); border-color: var(--gp-red-border); }

/* ── Tables: label header row, hairline rows, white card behind ── */
.gp-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.9rem; }
.gp-table thead th {
  text-align: left; white-space: nowrap; padding: 10px 14px;
  font-family: var(--gp-font-heading); font-weight: 700; font-size: 0.7rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--gp-body);
  border-bottom: 1px solid var(--gp-line); background: transparent;
}
.gp-table thead th a { color: var(--gp-body); text-decoration: none; }
.gp-table thead th a:hover { color: var(--gp-navy); }
.gp-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--gp-line); vertical-align: middle; }
.gp-table tbody tr:last-child td { border-bottom: 0; }
.gp-card-flush > .overflow-auto { margin: 0; }
.gp-card-flush > .gp-card-title { padding: 16px 20px 4px; }
.gp-card-flush > .gp-details { padding: 0; }

/* A collapsible section inside a card. The card is the WRAPPER: a <details>
   never gets display (Pico/Chrome gotcha in frontend.md). */
.gp-details > summary { margin: 0; }
.gp-details.details-section { margin-top: 0; }
.gp-details[open] > summary { margin-bottom: 12px; }

/* ── Filter bar in a card ── */
.gp-filters.filters { margin: 0; background: transparent; border: 0; padding: 0; }
.gp-results { margin: 0; color: var(--gp-body); font-size: 0.85rem; }

/* ── Forms ── inputs 40px tall, one column, full width of their card */
.gp-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.gp-form label { margin: 0; font-weight: 600; color: var(--gp-ink); font-size: 0.9rem; }
.gp-form label small { font-weight: 400; color: var(--gp-body); }
.gp-form input:not([type=checkbox]):not([type=radio]):not([type=submit]),
.gp-form select, .gp-form textarea {
  margin: 4px 0 0; min-height: 40px; border-radius: 10px; border-color: var(--gp-line);
}
.gp-form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.gp-form [type=submit], .gp-form .gp-btn { width: auto; align-self: flex-start; }
.gp-form-error { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--gp-red-tint); color: var(--gp-red-ink); border: 1px solid var(--gp-red-border); }
.gp-form-error ul { margin: 0; padding-left: 1.2rem; }
.gp-narrow { max-width: 40rem; }

/* Buttons that are Pico submit inputs: a gp-btn restated for <input>. */
input.gp-btn, button.gp-btn { width: auto; }

/* ── Feedback ── */
.gp-feedback-item { gap: 8px; }
.gp-feedback-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gp-feedback-meta { color: var(--gp-body); font-size: 0.8rem; }
.gp-feedback-body p { margin: 0 0 8px; }
.gp-feedback-body p:last-child { margin-bottom: 0; }
.gp-feedback-note { padding: 10px 14px; border-radius: 10px; background: var(--gp-surface); border: 1px solid var(--gp-line); }
.gp-feedback-note p { margin: 0; }
.gp-feedback-list { display: flex; flex-direction: column; gap: 12px; }

/* ── Login / unlock card ── centred, wordmark with the green square */
.login-layout { background: var(--gp-surface); }
.login-card {
  background: #fff; border: 1px solid var(--gp-line); border-radius: 14px;
  box-shadow: none; padding: 32px 28px; max-width: 26rem;
  display: flex; flex-direction: column; gap: 4px;
}
.gp-login-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 0 4px; font-family: var(--gp-font-heading); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.25em; text-transform: uppercase; color: var(--gp-navy);
}
.gp-login-mark { width: 11px; height: 11px; background: var(--gp-green); flex: none; display: inline-block; }
.login-card .gp-login-title {
  margin: 8px 0 0; text-align: center; font-family: var(--gp-font-heading);
  font-weight: 700; font-size: 1.25rem; color: var(--gp-navy);
}
.login-card .login-subtitle { color: var(--gp-body); margin: 0 0 16px; }
.login-card form { margin: 0; }
.login-card input:not([type=checkbox]):not([type=submit]) { min-height: 44px; border-radius: 10px; }
.login-card input[type=submit] { width: 100%; margin: 4px 0 0; }
.login-card fieldset { margin: 0 0 12px; }
.login-card .flash-notice, .login-card .flash-alert { margin: 0 0 16px; }
.login-card .gp-login-links { margin: 16px 0 0; text-align: center; font-size: 0.85rem; }

/* ── Admin shell ── .admin-nav is a .gp-tabs row of LINKS (not role=tab):
   the group dividers stay decorative; the row scrolls sideways on a phone
   instead of wrapping onto a second line. */
.admin-nav { margin: 0 0 16px; gap: 22px; }
.admin-nav-divider { align-self: center; flex: none; width: 1px; height: 18px; background: var(--gp-line); margin: 0 -6px; }
.admin-nav > .admin-nav-link { padding: 10px 0; border-radius: 0; font-size: 0.9rem; }
.admin-nav > .admin-nav-link:focus-visible { outline: 2px solid var(--gp-navy); outline-offset: 2px; }
/* The Pico width resets for admin tables (.admin-table td form/button,
   .admin-inline-form) stay in application.css, unchanged. */

/* ── Phone ── (kept last) */
@media (max-width: 768px) {
  .gp-page-actions { margin-left: 0; width: 100%; }
  .gp-card-grid { grid-template-columns: minmax(0, 1fr); }
  .gp-table thead th, .gp-table tbody td { padding: 10px; }
  .gp-form input:not([type=checkbox]):not([type=radio]):not([type=submit]), .gp-form select, .gp-form textarea { min-height: 44px; font-size: 1rem; }
  .gp-form [type=submit], .gp-form .gp-btn { width: 100%; min-height: 44px; }
  .gp-filters.filters > * { flex: 1 1 100%; max-width: none; }
  .login-card { padding: 24px 18px; }
  .login-layout { align-items: flex-start; padding-top: 12vh; }
  .gp-back { min-height: 44px; }
}
