/* =============================================================
   JTBills — simple public content pages
   (privacy policy, account deletion, 404)
   -------------------------------------------------------------
   Mobile-first. Depends on, and must load after:
     core/assets/css/design-system.css
     core/assets/css/components.css

   These three pages each used to carry their own ~200-line inline
   <style> block and their own Google Fonts link. This file is the
   one place their shared chrome is defined.
   ============================================================= */

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Skip link — first focusable element, visible only on keyboard focus */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-md);
  background: var(--c-primary);
  color: var(--c-text-inverse);
  font-weight: var(--fw-semibold);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--sp-4);
  color: var(--c-text-inverse);
}

/* ---- Top bar ---- */
.page-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 60px;
  padding-inline: var(--sp-5);
  background: color-mix(in srgb, var(--c-surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
}

.page-nav__logo {
  font-size: var(--text-xl);
  font-weight: var(--fw-extrabold);
  color: var(--c-primary);
  letter-spacing: -0.02em;
}

.page-nav__back {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--c-text-muted);
}

.page-nav__back:hover { color: var(--c-primary); }

.page-nav__back:focus-visible,
.page-nav__logo:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Body ---- */
.page-wrap {
  flex: 1;
  width: 100%;
  max-width: 780px;
  margin-inline: auto;
  padding: var(--sp-10) var(--sp-5) var(--sp-16);
}

@media (min-width: 768px) {
  .page-wrap { padding: var(--sp-16) var(--sp-8) var(--sp-20); }
}

.page-header {
  margin-bottom: var(--sp-10);
  text-align: center;
}

.page-tag {
  display: inline-block;
  margin-bottom: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  background: var(--c-primary-bg);
  color: var(--c-primary);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-tag--danger {
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

.page-header h1 {
  font-size: clamp(var(--text-3xl), 1.6rem + 2.4vw, var(--text-5xl));
  font-weight: var(--fw-extrabold);
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.page-header h1 span { color: var(--c-primary); }

.page-header p {
  max-width: 52ch;
  margin: var(--sp-4) auto 0;
  color: var(--c-text-muted);
  font-size: var(--text-sm);
}

/* ---- Content card ---- */
.page-card {
  padding: var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .page-card { padding: var(--sp-10); }
}

.page-section + .page-section {
  margin-top: var(--sp-8);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--c-border);
}

.page-section h2 {
  margin-bottom: var(--sp-3);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
}

.page-section p {
  color: var(--c-text-muted);
  line-height: var(--leading-loose);
  font-size: var(--text-sm);
}

.page-section p + p { margin-top: var(--sp-3); }

.page-section ul {
  margin-top: var(--sp-4);
  display: grid;
  gap: var(--sp-3);
}

.page-section li {
  position: relative;
  padding-left: var(--sp-6);
  color: var(--c-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
}

/* Bullet drawn with ::before so the marker inherits the brand colour
   and stays aligned with the first line of wrapped text. */
.page-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--c-primary);
}

.page-section strong { color: var(--c-text); font-weight: var(--fw-semibold); }

.inline-link {
  color: var(--c-primary);
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ---- Warning banner ---- */
.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  padding: var(--sp-5);
  border: 1px solid var(--c-danger);
  border-radius: var(--radius-lg);
  background: var(--c-danger-bg);
}

.warning-banner__icon {
  flex-shrink: 0;
  font-size: var(--text-2xl);
  line-height: 1;
}

.warning-banner__text {
  color: var(--c-text);
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
}

/* ---- Checkbox row ---- */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-block: var(--sp-6);
}

.checkbox-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--c-primary);
  cursor: pointer;
}

.checkbox-row label {
  color: var(--c-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  cursor: pointer;
}

.required { color: var(--c-danger); }

/* ---- Result panel ---- */
.result-panel {
  display: none;
  padding: var(--sp-10) var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  text-align: center;
}

.result-panel.is-shown { display: block; }

.result-panel__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: var(--sp-4);
}

.result-panel h2 {
  margin-bottom: var(--sp-3);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
}

.result-panel p {
  max-width: 48ch;
  margin-inline: auto;
  color: var(--c-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
}

/* ---- Form feedback ---- */
.form-alert {
  display: none;
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: center;
}

.form-alert.is-error {
  display: block;
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

.form-alert.is-success {
  display: block;
  background: var(--c-success-bg);
  color: var(--c-success);
}

/* ---- Footer ---- */
.page-footer {
  padding: var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-subtle);
  font-size: var(--text-xs);
  text-align: center;
}

/* ---- 404 ---- */
.notfound {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--sp-16) var(--sp-5);
  text-align: center;
}

.notfound__code {
  font-size: clamp(4rem, 2rem + 12vw, 8rem);
  font-weight: var(--fw-extrabold);
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.notfound h1 {
  margin-top: var(--sp-4);
  font-size: clamp(var(--text-xl), 1rem + 2vw, var(--text-3xl));
  font-weight: var(--fw-bold);
}

.notfound p {
  max-width: 44ch;
  margin: var(--sp-4) auto var(--sp-8);
  color: var(--c-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
}

.notfound__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
