/* Tá na Porta — shared stylesheet.
 *
 * Ported from the legacy frontend's Tailwind design system: same palette,
 * type scale, spacing, radii, shadows and entrance animations, expressed as
 * handcrafted CSS. Dark mode is class-based (`html.dark`), toggled by
 * static/theme.js with the system preference as the default. */

/* ── Font: Inter (vendored variable font, no CDN) ─────────────────────── */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: none;
  cursor: pointer;
}
a {
  color: inherit;
}
img,
svg {
  display: block;
  max-width: 100%;
}

/* ── Tokens (legacy Tailwind palette; .dark flips the neutrals) ───────── */
:root {
  --primary: #1364a1;
  --primary-hover: #0f4f81;
  --primary-alt: #3b82c4; /* alternate apartment-tile blue */
  --primary-soft: rgba(19, 100, 161, 0.1);
  --correios-bg: #ffcc00;
  --correios-text: #003478;
  --whatsapp: #25d366;
  --instagram: #e4405f;

  --bg: #ffffff; /* white / gray-950 */
  --surface: #ffffff; /* card bg: white / gray-900 */
  --surface-2: #f9fafb; /* gray-50 / gray-800 */
  --surface-3: #f3f4f6; /* gray-100 / gray-800 */
  --border: #e5e7eb; /* gray-200 / gray-700 */
  --border-soft: #f3f4f6; /* gray-100 / gray-800 */
  --border-strong: #d1d5db; /* gray-300 / gray-600 */
  --text: #111827; /* gray-900 / white */
  --text-2: #4b5563; /* gray-600 / gray-300 */
  --text-3: #374151; /* gray-700 / gray-300 */
  --muted: #6b7280; /* gray-500 / gray-400 */
  --muted-2: #9ca3af; /* gray-400 / gray-500 */
  --input-bg: #ffffff; /* white / gray-800 */

  --red-border: #fecaca; /* red-200 / red-800 */
  --red-bg: #fef2f2; /* red-50 / red-900(.3) */
  --red-title: #b91c1c; /* red-700 / red-400 */
  --red-text: #dc2626; /* red-600 / red-400 */
  --green-bg: #f0fdf4; /* green-50 / green-900(.3) */
  --green-border: #bbf7d0; /* green-200 / green-800 */
  --green-icon-bg: #dcfce7; /* green-100 / green-900(.3) */
  --green-title: #15803d; /* green-700 / green-400 */
  --green-icon: #16a34a; /* green-600 / green-400 */
  --amber-bg: #fef3c7; /* amber-100 / amber-900(.3) */
  --amber-icon: #d97706; /* amber-600 / amber-400 */

  /* Aliases the panel stylesheet consumes. */
  --brand: var(--primary);
  --ok: var(--green-title);
  --ok-bg: var(--green-icon-bg);
  --warn: var(--amber-icon);
  --warn-bg: var(--amber-bg);
  --err: var(--red-text);
  --err-bg: var(--red-bg);

  /* Spacing scale (4px steps) — new CSS uses these tokens; ad-hoc values
   * migrate opportunistically. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-18: 4.5rem;

  --radius: 0.5rem; /* rounded-lg */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
html.dark {
  --primary-soft: rgba(19, 100, 161, 0.2);
  --bg: #030712;
  --surface: #111827;
  --surface-2: #1f2937;
  --surface-3: #1f2937;
  --border: #374151;
  --border-soft: #1f2937;
  --border-strong: #4b5563;
  --text: #ffffff;
  --text-2: #d1d5db;
  --text-3: #d1d5db;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --input-bg: #1f2937;
  --red-border: #991b1b;
  --red-bg: rgba(127, 29, 29, 0.3);
  --red-title: #f87171;
  --red-text: #f87171;
  --green-bg: rgba(20, 83, 45, 0.3);
  --green-border: #166534;
  --green-icon-bg: rgba(20, 83, 45, 0.3);
  --green-title: #4ade80;
  --green-icon: #4ade80;
  --amber-bg: rgba(120, 53, 15, 0.3);
  --amber-icon: #fbbf24;
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Entrance animations (legacy keyframes, verbatim) ─────────────────── */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(16px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.animate-fadeIn {
  animation: fadeIn 0.15s ease-out;
}
.animate-scaleIn {
  animation: scaleIn 0.15s ease-out;
}
.animate-slideInRight {
  animation: slideInRight 0.2s ease-out;
}
.animate-spin {
  animation: spin 1s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .animate-fadeIn,
  .animate-scaleIn,
  .animate-slideInRight {
    animation: none;
  }
}

/* ── Page scaffolding ─────────────────────────────────────────────────── */
.page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  background: var(--bg);
}
/* Wizard variant: fixed viewport, inner content scrolls. */
.page-wizard {
  height: 100dvh;
  min-height: auto;
  overflow: hidden;
}

.logo-band {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6) 0;
}
.logo-band .brand-logo {
  height: 40px;
  width: auto;
}
.logo-band--small .brand-logo {
  height: 32px;
}

/* Theme-aware brand logo (color on light, white on dark). */
.brand-logo-dark {
  display: none;
}
html.dark .brand-logo-light {
  display: none;
}
html.dark .brand-logo-dark {
  display: block;
}

.center-fill {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-6);
  text-align: center;
}

/* Icon-in-circle heros */
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
}
.icon-circle--primary {
  background: var(--primary-soft);
  color: var(--primary);
}
.icon-circle--amber {
  background: var(--amber-bg);
  color: var(--amber-icon);
}
.icon-circle--gray {
  background: var(--surface-3);
  color: var(--muted-2);
}
.icon-circle--green {
  background: var(--green-icon-bg);
  color: var(--green-icon);
}
.icon-circle--red {
  background: var(--red-bg);
  color: #ef4444;
}
.icon-circle-20 {
  height: 5rem;
  width: 5rem;
}
.icon-circle-20 svg {
  height: 2.5rem;
  width: 2.5rem;
}
.icon-circle-16 {
  height: 4rem;
  width: 4rem;
}
.icon-circle-16 svg {
  height: 2rem;
  width: 2rem;
}

/* ── Type helpers (legacy scale) ──────────────────────────────────────── */
.h-page {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}
.h-page--bold {
  font-weight: 700;
}
.h-state {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--text);
}
.h-state--bold {
  font-weight: 700;
}
.subtext {
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--muted);
}
.body-text {
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--text-2);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius);
  background: var(--primary);
  padding: var(--space-3) var(--space-4);
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary:hover {
  box-shadow: var(--shadow-xl);
}
.btn-primary:active {
  opacity: 0.8;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: var(--shadow-md);
}
.btn-outline {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  padding: var(--space-3) var(--space-4);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  transition: all 0.2s;
  text-decoration: none;
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary);
  color: #ffffff;
}
.btn-outline svg {
  height: 1.25rem;
  width: 1.25rem;
  flex-shrink: 0;
}
.btn-outline--sm {
  font-size: 0.875rem;
}
.btn-ghost-neutral {
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  transition: all 0.15s;
  text-decoration: none;
}
.btn-ghost-neutral:hover {
  background: var(--surface-3);
}
/* Modal footer buttons (legacy uses the smaller radius there) */
.btn-modal-cancel {
  flex: 1;
  border-radius: 0.25rem;
  border: 1px solid var(--border-strong);
  padding: var(--space-2) var(--space-4);
  color: var(--text-3);
  transition: background 0.15s;
}
.btn-modal-cancel:hover {
  background: var(--surface-3);
}
.btn-modal-confirm {
  flex: 1;
  border-radius: 0.25rem;
  background: var(--primary);
  padding: var(--space-2) var(--space-4);
  color: #ffffff;
  transition: background 0.15s;
}
.btn-modal-confirm:hover {
  background: var(--primary-hover);
}
.btn-modal-confirm:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Delivery-type buttons */
.btn-delivery {
  display: flex;
  height: 4rem;
  width: 100%;
  align-items: center;
  gap: var(--space-4);
  border-radius: var(--radius);
  padding: 0 var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  text-decoration: none;
}
.btn-delivery:hover {
  box-shadow: var(--shadow-lg);
}
.btn-delivery:active {
  opacity: 0.8;
}
.btn-delivery--correios {
  background: var(--correios-bg);
  color: var(--correios-text);
}
.btn-delivery--carrier {
  background: var(--primary);
  color: #ffffff;
}
.btn-delivery .btn-delivery-icon {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.btn-delivery--carrier .btn-delivery-icon {
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
}
.btn-delivery--carrier .btn-delivery-icon svg {
  height: 1.25rem;
  width: 1.25rem;
}
.btn-delivery-label {
  flex: 1;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
}
.btn-delivery--correios .btn-delivery-label {
  font-weight: 700;
}
.btn-delivery .chevron {
  height: 1.25rem;
  width: 1.25rem;
  opacity: 0.6;
}

/* ── Wizard chrome ────────────────────────────────────────────────────── */
.wizard-header {
  z-index: 10;
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: var(--space-4);
}
.wizard-header--sticky {
  position: sticky;
  top: 0;
}
.wizard-header-row {
  display: flex;
  align-items: center;
}
.wizard-back {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: color 0.15s;
  text-decoration: none;
}
.wizard-back:hover {
  color: var(--primary);
}
.wizard-back svg {
  height: 1.25rem;
  width: 1.25rem;
}
.wizard-title {
  flex: 1;
  text-align: center;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--text);
}
.wizard-spacer {
  width: 2.5rem;
}

.search-wrap {
  position: relative;
  margin-top: var(--space-3);
}
.search-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  height: 1rem;
  width: 1rem;
  transform: translateY(-50%);
  color: var(--muted-2);
}
.search-input {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-10);
  color: var(--text);
}
.search-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 1px var(--primary);
}
.search-input::placeholder {
  color: var(--muted-2);
}

.wizard-main {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-4) 0;
}

/* Option cards (navigate levels) */
.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.option-card {
  display: flex;
  width: 100%;
  align-items: center;
  gap: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-4);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  text-decoration: none;
}
.option-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.option-card .icon-circle {
  height: 2.5rem;
  width: 2.5rem;
  flex-shrink: 0;
}
.option-card .icon-circle svg {
  height: 1.25rem;
  width: 1.25rem;
}
.option-label {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.option-card .chevron {
  height: 1.25rem;
  width: 1.25rem;
  color: var(--muted-2);
}

/* Deliverable tiles (3-col grid, groups alternate the two blues) */
.tile-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.tile-group-label {
  margin-bottom: var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.tile {
  border-radius: var(--radius);
  padding: var(--space-3);
  text-align: center;
  font-weight: 600;
  color: #ffffff;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.tile:hover {
  box-shadow: var(--shadow-lg);
}
.tile:active {
  opacity: 0.8;
}
.tile--alt {
  background: var(--primary-alt);
}
.empty-note {
  margin-top: var(--space-6);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Destination chips + count badge */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chips--center {
  justify-content: center;
}
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border-radius: 9999px;
  background: var(--primary-soft);
  padding: var(--space-1) var(--space-3);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}
.chip svg {
  height: 0.875rem;
  width: 0.875rem;
}
.chip-badge {
  position: absolute;
  right: -0.375rem;
  top: -0.375rem;
  display: flex;
  height: 1.25rem;
  width: 1.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
}
/* Chip forms submit − / × without looking like forms. */
.chip-form {
  display: inline-flex;
  margin: 0;
}

/* Sticky bottom action bar inside the scrolling main */
.sticky-bar {
  position: sticky;
  bottom: 0;
  margin: var(--space-6) calc(-1 * var(--space-4)) 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: var(--space-3) var(--space-4);
}
.sticky-bar-row {
  display: flex;
  gap: var(--space-3);
}
.sticky-bar-row > * {
  flex: 1;
}

/* ── Modals / popups ──────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}
.modal-card {
  margin: 0 var(--space-4);
  display: flex;
  max-height: 80vh;
  width: 100%;
  max-width: 24rem;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
}
html.dark .modal-card {
  background: #1f2937; /* gray-800, as legacy modals use */
}
.modal-title {
  margin-bottom: var(--space-4);
  text-align: center;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}
.modal-title--tight {
  margin-bottom: var(--space-2);
}
.modal-message {
  margin-bottom: var(--space-6);
  text-align: center;
  color: var(--text-2);
  white-space: pre-line;
}
.modal-chips {
  margin-bottom: var(--space-5);
  display: flex;
  max-height: 10rem;
  justify-content: center;
  overflow-y: auto;
  /* room for the count badge, which overflows the chip */
  padding: var(--space-2) var(--space-2) 0;
}
.modal-actions-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.modal-actions-row {
  display: flex;
  gap: var(--space-3);
}
.modal-icon {
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: center;
}
.modal-icon svg {
  height: 3rem;
  width: 3rem;
}
.modal-icon--error svg {
  color: #ef4444;
}
.modal-icon--success svg {
  color: #22c55e;
}

/* ── Forms ────────────────────────────────────────────────────────────── */
.field {
  margin-bottom: var(--space-4);
}
.field:last-child {
  margin-bottom: 0;
}
.field-label {
  margin-bottom: var(--space-1);
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-3);
}
.field-label--medium {
  font-weight: 500;
}
.text-input {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  padding: var(--space-2) var(--space-3);
  color: var(--text);
}
.text-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 1px var(--primary);
}
.text-input::placeholder {
  color: var(--muted-2);
}

/* Protocol lookup: TNP-prefixed mono input */
.protocol-input-wrap {
  position: relative;
}
.protocol-prefix {
  pointer-events: none;
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  height: 100%;
  align-items: center;
  padding: var(--space-3) 0 var(--space-3) var(--space-4);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  color: var(--text);
}
.protocol-input {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-18);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  color: var(--text);
}
.protocol-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 1px var(--primary);
}
.protocol-input::placeholder {
  color: var(--muted-2);
}

/* ── Info blocks ──────────────────────────────────────────────────────── */
.warning-box {
  border-radius: var(--radius);
  border: 1px solid var(--red-border);
  background: var(--red-bg);
  padding: var(--space-4);
}
.warning-box-head {
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.warning-box-head svg {
  height: 1.25rem;
  width: 1.25rem;
  color: #ef4444;
}
.warning-box-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--red-title);
}
.warning-box-text {
  font-size: 1rem;
  color: var(--red-text);
}

/* Status pills (confirmation page) */
.status-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
}
.status-pill svg {
  height: 1.25rem;
  width: 1.25rem;
  flex-shrink: 0;
}
.status-pill--wait {
  background: var(--surface-2);
}
html.dark .status-pill--wait {
  background: #1f2937;
}
.status-pill--wait span {
  font-size: 0.875rem;
  color: var(--text-2);
}
.status-pill--wait svg {
  color: var(--primary);
}
.status-pill--ok {
  background: var(--green-bg);
}
.status-pill--ok span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--green-title);
}
.status-pill--ok svg {
  color: #16a34a;
}
.status-pill--error {
  background: var(--red-bg);
}
.status-pill--error span {
  font-size: 0.875rem;
  color: var(--red-text);
}
.status-pill--error svg {
  color: #ef4444;
}

/* Detail rows (correios review, protocol detail) */
.detail-card {
  width: 100%;
  max-width: 24rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.detail-rows > * + * {
  border-top: 1px solid var(--border-soft);
}
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
}
.detail-row--plain {
  padding: var(--space-3) 0;
}
.detail-row--stacked {
  display: block;
  padding: var(--space-3) 0;
}
.detail-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}
.detail-value {
  font-size: 0.875rem;
  color: var(--text);
}
.badge-green {
  border-radius: 9999px;
  background: var(--green-icon-bg);
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--green-title);
}

/* Receipt code (phase-4 addition, styled in the same language) */
.receipt-code {
  border-radius: var(--radius);
  border: 1px dashed var(--primary);
  background: var(--primary-soft);
  padding: var(--space-3) var(--space-5);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  color: var(--primary);
  text-align: center;
}

/* ── Footer (institutional) ───────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  padding: var(--space-6);
}
html.dark .site-footer {
  background: #111827; /* gray-900 */
}
.site-footer-inner {
  margin: 0 auto;
  max-width: 28rem;
  text-align: center;
}
.site-footer-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
}
html.dark .site-footer-title {
  color: #e5e7eb;
}
.site-footer-sub {
  margin-top: var(--space-1);
  font-size: 0.75rem;
  color: var(--muted);
}
.site-footer-links {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}
.footer-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: 9999px;
  background: var(--whatsapp);
  padding: var(--space-2) var(--space-4);
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  text-decoration: none;
}
.footer-whatsapp:hover {
  box-shadow: var(--shadow-lg);
}
.footer-whatsapp svg {
  height: 1rem;
  width: 1rem;
}
.footer-instagram {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
  text-decoration: none;
}
.footer-instagram:hover {
  color: var(--instagram);
}
.footer-instagram svg {
  height: 1rem;
  width: 1rem;
}
.site-footer-legal {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.site-footer-copy {
  font-size: 10px;
  color: var(--muted-2);
}
.theme-toggle {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--muted-2);
  transition: color 0.15s;
}
.theme-toggle:hover {
  color: var(--primary);
}
.theme-toggle svg {
  height: 1rem;
  width: 1rem;
}
/* Sun shows in dark mode (tap → light), moon in light mode. */
.theme-toggle .icon-sun {
  display: none;
}
html.dark .theme-toggle .icon-sun {
  display: block;
}
html.dark .theme-toggle .icon-moon {
  display: none;
}

/* Delivery-type block (bottom of the entrega page) */
.delivery-actions {
  padding: 0 var(--space-6) var(--space-8);
}
.delivery-actions-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Timed reveals (slow-connect softening; manual confirmation fallback).
   Pure CSS: hidden until the animation delay elapses. */
.reveal-10s,
.reveal-30s {
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}
.reveal-10s {
  animation-delay: 10s;
}
.reveal-30s {
  animation-delay: 30s;
}

/* ── Utility helpers used by templates ────────────────────────────────── */
.mt-1 {
  margin-top: var(--space-1);
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-2 {
  margin-bottom: var(--space-2);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-6 {
  margin-bottom: var(--space-6);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.w-full {
  width: 100%;
}
.max-w-sm {
  max-width: 24rem;
}
.hidden {
  display: none;
}
