/* ============================================================
   Mesa de Partes Virtual — Estilos Principales
   Municipalidad Provincial de Rioja
   ============================================================ */

/* ------------------------------------------------------------
   Variables de diseño
   ------------------------------------------------------------ */
:root {
  --ink:          #1a2332;
  --ink-light:    #4a5568;
  --muted:        #64748b;
  --green:        #0f6f52;
  --green-dark:   #0a5440;
  --green-mid:    #187a5c;
  --green-soft:   #e8f5f0;
  --green-glow:   rgba(15, 111, 82, 0.15);
  --gold:         #c9962a;
  --blue:         #1e6fa5;
  --line:         #e2e8e4;
  --surface:      #ffffff;
  --canvas:       #f4f6f8;
  --danger:       #b03030;
  --danger-soft:  #fff0f0;
  --shadow-sm:    0 2px 8px rgba(15, 111, 82, 0.08);
  --shadow-md:    0 8px 28px rgba(26, 35, 50, 0.10);
  --shadow-lg:    0 20px 54px rgba(26, 35, 50, 0.12);
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --transition:   0.22s ease;
}

/* ------------------------------------------------------------
   Modo oscuro — se activa con data-theme="dark" en <html>
   ------------------------------------------------------------ */
[data-theme="dark"] {
  --ink:          #e8edf3;
  --ink-light:    #a8b8cc;
  --muted:        #8899aa;
  --green:        #34d399;
  --green-dark:   #10b981;
  --green-mid:    #4ade90;
  --green-soft:   #0d2b22;
  --green-glow:   rgba(52, 211, 153, 0.18);
  --gold:         #fbbf24;
  --blue:         #60a5fa;
  --line:         #1e2d3d;
  --surface:      #111827;
  --canvas:       #0d1623;
  --danger:       #f87171;
  --danger-soft:  #2d1515;
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.40);
  --shadow-md:    0 8px 28px rgba(0, 0, 0, 0.50);
  --shadow-lg:    0 20px 54px rgba(0, 0, 0, 0.60);
}

[data-theme="dark"] body {
  background: var(--canvas);
  color: var(--ink);
}

[data-theme="dark"] .topbar {
  background: #0d1623;
  border-bottom-color: var(--line);
}

[data-theme="dark"] .card {
  background: #152032;
  border-color: var(--line);
}

[data-theme="dark"] .security-card,
[data-theme="dark"] .result-card,
[data-theme="dark"] .result-row,
[data-theme="dark"] .document-type-options,
[data-theme="dark"] .document-type-option {
  background: #152032;
  border-color: var(--line);
}

[data-theme="dark"] .document-type-option {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .button.secondary {
  background: transparent;
}

[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #0a1f16 0%, #0d1a22 45%, #1a1a0e 100%);
  border-bottom-color: #1e2d3d;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1a2d42;
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
}

[data-theme="dark"] .section.alt {
  background: #0d1623;
}

[data-theme="dark"] footer {
  background: #0a1220;
  border-top-color: var(--line);
}

/* ------------------------------------------------------------
   Botón de cambio de tema (claro / oscuro)
   ------------------------------------------------------------ */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1.5px solid rgba(15, 111, 82, 0.25);
  border-radius: 20px;
  background: transparent;
  color: var(--green);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.theme-toggle svg {
  flex: none;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

[data-theme="dark"] .theme-toggle {
  border-color: rgba(52, 211, 153, 0.30);
  color: var(--green);
}

[data-theme="dark"] .theme-toggle:hover {
  background: var(--green-soft);
}

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

/* Cuando hay admin-link Y theme-toggle juntos */
.topbar-actions {
  margin-left: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}

.topbar-actions .admin-link,
.topbar-actions .theme-toggle {
  flex: 0 0 auto;
}

/* ------------------------------------------------------------
   Reset y base
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------
   Contenedores
   ------------------------------------------------------------ */
.shell {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}

.narrow {
  width: min(740px, calc(100% - 40px));
  padding: 72px 0;
}

/* ------------------------------------------------------------
   Tipografía
   ------------------------------------------------------------ */
h1, h2, h3 {
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.2;
  margin-top: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(36px, 5vw, 58px);
  max-width: 760px;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 14px;
}

h3 {
  font-size: 22px;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.lead {
  font-size: 18px;
  color: var(--ink-light);
  max-width: 680px;
  line-height: 1.7;
}

/* ------------------------------------------------------------
   Barra superior
   ------------------------------------------------------------ */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(15, 111, 82, 0.06);
}

.brand {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  object-position: left center;
  flex: none;
  background: #fdfdfb;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(15, 111, 82, 0.18);
}

[data-theme="dark"] .brand img {
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.25), 0 2px 8px rgba(0, 0, 0, 0.45);
}

.brand div:not(.topbar-actions) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand b {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.brand span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.admin-link {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  padding: 8px 16px;
  border: 1.5px solid rgba(15, 111, 82, 0.25);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.admin-link:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #dff0e8 0%, #edf5f0 45%, #f8f5e8 100%);
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccddd4;
}

/* Barra de acento institucional en la parte superior */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-mid) 50%, var(--gold) 100%);
}

/* Patrón decorativo sutil */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(15, 111, 82, 0.09) 0%, transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(201, 150, 42, 0.07) 0%, transparent 45%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1.5fr 0.75fr;
  gap: 64px;
  align-items: center;
  padding: 60px 0;
}

/* Asegura que el shell dentro del hero ocupe todo el ancho disponible del flex */
.hero > .shell {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}

.hero-actions,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ------------------------------------------------------------
   Tarjeta de seguridad (hero aside)
   ------------------------------------------------------------ */
.security-card {
  background: #fff;
  border: 1px solid #cce0d6;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}

.security-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.security-card p {
  color: var(--muted);
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

.shield,
.result-icon {
  background: var(--green-soft);
  color: var(--green);
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
}

/* ------------------------------------------------------------
   Botones
   ------------------------------------------------------------ */
.button {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #fff;
  padding: 13px 22px;
  font: 700 15px 'Inter', 'Segoe UI', Arial, sans-serif;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(15, 111, 82, 0.25);
  letter-spacing: 0.01em;
}

.button:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 111, 82, 0.32);
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(15, 111, 82, 0.2);
}

.button.secondary {
  background: #fff;
  color: var(--green);
  border: 1.5px solid rgba(15, 111, 82, 0.35);
  box-shadow: none;
}

.button.secondary:hover {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: none;
}

.button.full {
  width: 100%;
  font-size: 16px;
  padding: 16px;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ------------------------------------------------------------
   Secciones
   ------------------------------------------------------------ */
.section {
  padding: 84px 0;
}

.section.alt {
  background: var(--canvas);
}

.section-heading {
  max-width: 640px;
  margin-bottom: 36px;
}

.section-heading > p:last-child,
.form-intro > p {
  color: var(--muted);
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   Tarjetas (cards)
   ------------------------------------------------------------ */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ------------------------------------------------------------
   Layout del formulario de registro
   ------------------------------------------------------------ */
.form-layout {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 72px;
  align-items: start;
}

.form-intro {
  position: sticky;
  top: 100px;
}

/* Pasos laterales */
.steps {
  list-style: none;
  padding: 20px 0 0;
  margin: 0;
}

.steps li {
  display: flex;
  gap: 16px;
  margin: 0 0 28px;
  align-items: flex-start;
}

.steps li > span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-mid) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex: none;
  box-shadow: 0 4px 10px rgba(15, 111, 82, 0.28);
}

.steps b {
  display: block;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 3px;
}

.steps p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   Formulario de registro
   ------------------------------------------------------------ */
.register-form {
  padding: 36px;
}

.register-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 36px;
}

.register-form fieldset:last-of-type {
  margin-bottom: 28px;
}

.register-form legend {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--ink);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--green-soft);
  width: 100%;
}

/* Grids de campos */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.span-2 {
  grid-column: 1 / -1;
}

/* Labels e inputs */
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid #ccd5d0;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  font: 15px 'Inter', 'Segoe UI', Arial, sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 111, 82, 0.13);
}

input::placeholder,
textarea::placeholder {
  color: #aab5b0;
  font-weight: 400;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

small {
  font-weight: 400;
  color: var(--muted);
  text-align: right;
  font-size: 12px;
}

/* Número de documento con prefijo fijo "Nº" */
.doc-number-field {
  display: flex;
  align-items: stretch;
  border: 1.5px solid #ccd5d0;
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.doc-number-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 111, 82, 0.13);
}

.doc-number-prefix {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.doc-number-field input {
  flex: 1;
  min-width: 0;
  border: none;
  box-shadow: none;
}

.doc-number-field input:focus {
  border: none;
  box-shadow: none;
}

/* Identity input con botón lateral */
.identity-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.identity-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.identity-input-row input {
  flex: 1;
}

.identity-icon-button {
  flex: none;
  padding: 0 12px;
}

.identity-icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.identity-status {
  display: block;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.4;
}

/* Grilla identidad: 2 + col-extra */
.identity-grid {
  grid-template-columns: 1fr 1fr;
}

/* ------------------------------------------------------------
   Carga de archivos (documento principal y anexos)
   ------------------------------------------------------------ */
.upload-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 22px;
}

.upload-field-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-field-head > b {
  font-size: 15px;
  color: var(--ink);
}

.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font: italic 700 11px/1 Georgia, serif;
  cursor: help;
}

.upload-hint {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.upload-button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  padding: 9px 16px;
  border-radius: 999px;
  background: #171b21;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition);
}

.upload-button:hover {
  background: var(--green-dark);
}

.upload-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

[data-theme="dark"] .upload-button {
  background: #2a3140;
}

[data-theme="dark"] .upload-button:hover {
  background: var(--green-dark);
}

.upload-file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.upload-file-card {
  margin-top: 10px;
  border-radius: var(--radius-md);
  background: var(--canvas);
  border: 1px solid var(--line);
  overflow: hidden;
}

.upload-file-list .upload-file-card {
  margin-top: 0;
}

.upload-file-card-head {
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.upload-file-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.upload-file-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.upload-file-info b {
  font-size: 13.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.upload-file-info span {
  font-size: 12px;
  color: var(--muted);
}

.upload-file-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.upload-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--blue);
  cursor: pointer;
  transition: background var(--transition);
}

.upload-icon-btn:hover {
  background: var(--green-soft);
}

.upload-icon-btn.danger {
  color: var(--danger);
}

.upload-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-button.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   Visor de documento (modal)
   ------------------------------------------------------------ */
.pdf-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.pdf-modal[hidden] {
  display: none;
}

.pdf-modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: min(900px, 100%);
  height: min(85vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.pdf-modal-head b {
  font-size: 16px;
  font-family: 'Merriweather', Georgia, serif;
  color: var(--ink);
}

.pdf-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition);
}

.pdf-modal-close:hover {
  background: var(--canvas);
  color: var(--ink);
}

.pdf-modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pdf-modal-frame {
  flex: 1;
  border: 0;
  background: #525659;
}

/* ------------------------------------------------------------
   Consentimiento y ayuda
   ------------------------------------------------------------ */
.consent {
  flex-direction: row;
  align-items: flex-start;
  font-weight: 400;
  font-size: 13.5px;
  color: var(--ink-light);
  margin: 6px 0 22px;
  line-height: 1.55;
  gap: 12px;
}

.consent input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--green);
  margin-top: 2px;
}

.consent a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-help {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

/* ------------------------------------------------------------
   Avisos / Notificaciones
   ------------------------------------------------------------ */
.notice {
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  margin: 24px auto;
  font-size: 14px;
  line-height: 1.55;
}

.notice-warning {
  background: #fff9e6;
  color: #6e4c0c;
  border: 1px solid #e8cc80;
}

.notice-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #e5b8b8;
}

.notice-success {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid #aed4c2;
}

/* ------------------------------------------------------------
   Tarjeta de resultado (constancia)
   ------------------------------------------------------------ */
.result-card {
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
}

.result-card .result-icon {
  margin: 0 auto 24px;
  width: 64px;
  height: 64px;
  font-size: 28px;
}

.result-card.error .result-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.tracking-number {
  font: 700 32px 'Merriweather', Georgia, serif;
  letter-spacing: 0.05em;
  color: var(--green);
  padding: 18px 24px;
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  margin: 28px 0;
  display: inline-block;
}

.summary {
  text-align: left;
  margin: 28px 0;
}

.summary div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.summary dd {
  margin: 0;
  font-weight: 600;
}

.result-card .actions {
  justify-content: center;
}

/* Texto de dt/span en summary */
.summary dt,
.result-row span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

/* ------------------------------------------------------------
   Resultados de búsqueda (tabla 4 columnas)
   ------------------------------------------------------------ */
.results {
  margin-top: 30px;
}

.result-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.result-row div {
  display: flex;
  flex-direction: column;
}

.status {
  color: var(--green);
  font-weight: 700;
}

/* ------------------------------------------------------------
   Timeline clásico (no público)
   ------------------------------------------------------------ */
.timeline {
  border-left: 3px solid #c0d8cc;
  margin-left: 8px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  margin: 20px 0 20px -8px;
}

.timeline-item > span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 5px;
  flex: none;
}

.timeline-item p {
  margin: 3px 0;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Formulario de búsqueda simple
   ------------------------------------------------------------ */
.search-form {
  padding: 24px;
  display: grid;
  grid-template-columns: 0.65fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

/* ------------------------------------------------------------
   Privacidad
   ------------------------------------------------------------ */
.privacy-content {
  padding: 36px 42px;
  margin-bottom: 28px;
}

.privacy-content h2 {
  font-size: 18px;
  font-family: 'Merriweather', Georgia, serif;
  margin: 32px 0 10px;
  color: var(--green-dark);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--green-soft);
}

.privacy-content h2:first-child {
  margin-top: 0;
}

.privacy-content p {
  color: var(--ink-light);
  line-height: 1.72;
  margin: 0 0 4px;
}

.privacy-version {
  margin-top: 28px !important;
  font-size: 13px;
  color: var(--muted) !important;
  font-style: italic;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
footer {
  background: linear-gradient(135deg, #132b20 0%, #1a3828 100%);
  color: #fff;
  padding: 40px 0;
}

footer .shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

footer b {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 15px;
}

footer span {
  color: #9abfac;
  font-size: 13px;
}

footer a {
  color: #9abfac;
  text-decoration: none;
}

footer a:hover {
  color: #fff;
}

/* ------------------------------------------------------------
   Autocompletado de tipo de documento
   ------------------------------------------------------------ */
.document-type-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.document-type-control {
  position: relative;
}

.document-type-options {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  overflow: hidden;
  background: #fff;
  border: 1.5px solid var(--green);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(26, 35, 50, 0.16);
  max-height: 260px;
  overflow-y: auto;
}

.document-type-options[hidden],
.document-type-option[hidden] {
  display: none;
}

.document-type-option {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #edf0ee;
  background: #fff;
  color: var(--ink);
  font: 14px 'Inter', 'Segoe UI', Arial, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.document-type-option:last-child {
  border-bottom: 0;
}

.document-type-option:hover,
.document-type-option.is-active {
  background: var(--green-soft);
  color: var(--green-dark);
}

/* ------------------------------------------------------------
   Responsive — Tablet (≤ 900px)
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .hero-grid,
  .form-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-grid {
    padding: 52px 0;
  }

  .form-intro {
    position: static;
  }

  .search-form {
    grid-template-columns: 1fr 1fr;
  }

  .search-form .button {
    grid-column: 1 / -1;
  }

  .result-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------------------
   Responsive — Móvil (≤ 580px)
   ------------------------------------------------------------ */
@media (max-width: 580px) {
  .shell {
    width: min(100% - 24px, 1120px);
  }

  .brand {
    height: 64px;
  }

  .brand img {
    width: 56px;
    height: 40px;
  }

  .brand b {
    font-size: 13px;
  }

  .brand span {
    display: none;
  }

  .admin-link {
    display: none;
  }

  .hero {
    min-height: calc(100vh - 64px);
  }

  .hero-grid {
    padding: 40px 0;
  }

  .section {
    padding: 56px 0;
  }

  .security-card {
    padding: 20px;
  }

  .search-form,
  .field-grid,
  .result-row {
    grid-template-columns: 1fr;
  }

  .register-form {
    padding: 22px 18px;
  }

  .span-2 {
    grid-column: auto;
  }

  .result-card {
    padding: 30px 22px;
  }

  .summary div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tracking-number {
    font-size: 24px;
  }

  footer .shell {
    flex-direction: column;
    text-align: center;
  }

  .privacy-content {
    padding: 24px 20px;
  }
}

/* ------------------------------------------------------------
   Impresión
   ------------------------------------------------------------ */
@media print {
  .topbar,
  .actions,
  footer {
    display: none;
  }

  .result-card {
    box-shadow: none;
    border: 0;
  }

  .narrow {
    padding: 0;
  }
}
