/**
 * Shared foundation for every server-rendered /civic-action route.
 *
 * Design tokens, the global reset and the top-level layout primitives
 * (.app / .screen) that every route builds on. Loaded unconditionally by
 * templates/partials/app-head.php; per-route stylesheets (sign-in.css,
 * app.css) layer on top via $iod_styles.
 *
 * Palette: the site's light "brutalist" system — a cream surface, dark ink
 * text and an orange accent, with ink-alpha borders and the signature
 * `4px 4px 0` offset shadow. Headings use Space Grotesk, body Montserrat
 * (loaded via Google Fonts in the shared document head).
 */
:root {
  --bg: #FFF5EB;
  --bg2: #FBECDD;
  --card: #FFFFFF;
  --card2: #FFF5EB;
  --border: rgba(20, 17, 15, .12);
  --border2: rgba(20, 17, 15, .22);
  --text: #14110F;
  --sub: #4D4642;
  --muted: #B3B2B0;
  --o400: #FF8A47;
  --o500: #F26E22;
  --o500-bg: #F6E9A7;
  --o600: #D2560F;
  --green: #15803D;
  --green-bg: #A7F6C7;
  --red: #DC2626;
  --blue: #2563EB;
  --purple: #7C3AED;
  --gold: #B45309;
  --ink-shadow: #14110F;
  --glow: 4px 4px 0 var(--ink-shadow);
  --radius: 18px;
  --font-head: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent
}

html,
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-head)
}

.app {
  max-width: 894px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: 40px
}

.screen {
  display: none;
  padding: 24px;
  animation: fadeUp .4s ease
}

.screen.active {
  display: block
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 22px;
  border: 2px solid var(--ink-shadow);
  border-radius: 2px;
  box-shadow: var(--glow);
  font-family: var(--font-head);
  font-size: 18px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow .12s ease, transform .12s ease;
}

@media only screen and (max-width: 560px) {
  .btn {
    padding: 17px;
  }
}

.btn:hover {
  box-shadow: 6px 6px 0 var(--ink-shadow);
  transform: translate(-2px, -2px)
}

.btn:active {
  box-shadow: 1px 1px 0 var(--ink-shadow);
  transform: translate(2px, 2px)
}

.btn:disabled {
  opacity: .6;
  cursor: default;
  box-shadow: var(--glow);
  transform: none
}

@media (prefers-reduced-motion: reduce) {

  .btn:hover,
  .btn:active {
    transform: none
  }
}

.btn-primary {
  background: var(--o500);
  color: var(--text)
}

.btn-ghost {
  background: var(--card);
  color: var(--text)
}

.btn-ghost:hover {
  background: var(--bg)
}

.btn-pair {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.btn-pair .btn {
  flex: 1
}

@media only screen and (max-width: 560px) {
  .btn-pair {
    flex-direction: column;
    gap: 20px
  }
}

/* ---- Fields ---- */
.field {
  margin-bottom: 20px
}

.auth-input {
  width: 100%;
  background: var(--card);
  border: 2px solid var(--ink-shadow);
  border-radius: 4px;
  box-shadow: var(--glow);
  padding: 18px 20px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: transform .12s ease, box-shadow .12s ease,
    border-color .15s ease, background-color .15s ease;
}

.auth-input::placeholder {
  color: var(--sub);
  opacity: .8
}

.auth-input:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink-shadow);
}

.auth-input:focus {
  --ink-shadow: var(--o500);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink-shadow);
  border-color: var(--o500);
}

.auth-input:focus-visible {
  outline: none
}

@media (prefers-reduced-motion: reduce) {
  .auth-input {
    transition: box-shadow .15s ease, border-color .15s ease;
  }

  .auth-input:hover,
  .auth-input:active,
  .auth-input:focus {
    transform: none
  }
}
/* ---- Utilities ---- */

/* Visually hidden but exposed to assistive tech — for labels a sighted user
   reads from the layout itself (e.g. a dialog's accessible name). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
