/* styles.css — Identidad VARPAL, mobile-first. Diseño propio.
 * Paleta alineada con el sitio público (theme-color #15965b) para que la marca
 * sea una sola en web, en el portal y en la app instalada.
 *
 * Reglas de accesibilidad que este archivo garantiza:
 *   - todo control tocable mide >= 44px (--tap);
 *   - texto de botones y enlaces con contraste >= 4.5:1 (--accent-strong);
 *   - campos a 16px: iOS no hace zoom al enfocarlos;
 *   - foco visible en teclado y movimiento reducido respetado.
 */

:root {
  color-scheme: light;
  --bg: #f4f8f6;
  --panel: #ffffff;
  --line: #d8e2dd;
  --text: #14231c;
  --muted: #566a60;
  --accent: #15965b;
  --accent-strong: #0d7544;
  --accent-dark: #06331c;
  --accent-soft: #e7f4ed;
  --good: #147d4f;
  --good-soft: #eaf6ef;
  --warn: #8a5300;
  --warn-soft: #fdf6e7;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --radius: 18px;
  --tap: 44px;
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

/* Los componentes fijan `display`; sin esto el atributo `hidden` no oculta nada. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 92% 0%, rgba(15, 184, 202, 0.12), transparent 28rem),
    linear-gradient(180deg, #f8fbfa 0%, var(--bg) 42%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: calc(76px + var(--safe));
  -webkit-text-size-adjust: 100%;
}

.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;
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 600;
}
.skip:focus { top: 8px; }

/* ── Barras ─────────────────────────────────────────────────────────────── */
.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  min-height: 72px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(21, 150, 91, 0.14);
  box-shadow: 0 5px 24px rgba(6, 51, 28, 0.06);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent-dark);
  font-size: 13px;
}

.brand img { display: block; width: 126px; height: 56px; object-fit: contain; object-position: left center; }
.brand-product { padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-weight: 700; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe);
}

.tab {
  flex: 1;
  min-width: 0;
  min-height: 60px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.tab svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tab.is-active { color: var(--accent-strong); box-shadow: inset 0 3px 0 var(--accent); }

@media (min-width: 720px) {
  .tabbar { justify-content: center; }
  .tab { flex: 0 1 180px; }
}

/* ── Contenido ──────────────────────────────────────────────────────────── */
.view { padding: 22px 16px 30px; max-width: 720px; margin: 0 auto; }
/* Un dato largo del servidor (tracking, descripción, número de factura) se parte en vez de ensanchar la página. */
.view { overflow-wrap: anywhere; }
.row > * { min-width: 0; }
.row > .badge { flex: 0 1 auto; max-width: 60%; white-space: normal; text-align: center; }
/* Destinos de foco programático (título de cada pantalla): sin recuadro, el foco sólo lo mueve. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

h1 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; outline: none; }
h2 { font-size: 17px; margin: 24px 0 10px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.lead { color: var(--muted); font-size: 16px; margin-bottom: 18px; }

.card {
  background: var(--panel);
  border: 1px solid rgba(20, 125, 79, 0.16);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.login-hero { padding: 8px 2px 18px; }
.login-hero h1 { max-width: 590px; font-size: clamp(28px, 7vw, 42px); line-height: 1.08; letter-spacing: -0.035em; margin: 8px 0 12px; }
.login-hero .lead { max-width: 610px; font-size: 16px; line-height: 1.55; }
.eyebrow { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 800; letter-spacing: 0.02em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0 4px; }
.feature { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; border: 1px solid rgba(20,125,79,.14); border-radius: 14px; background: rgba(255,255,255,.76); }
.feature-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: #fff; font-size: 21px; font-weight: 900; }
.feature strong, .feature small { display: block; }
.feature strong { font-size: 14px; }
.feature small { color: var(--muted); font-size: 11px; line-height: 1.2; }

.login-card { box-shadow: 0 14px 42px rgba(6,51,28,.09); }
.login-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-card-heading h2 { margin: 0; font-size: 19px; }
.login-card-heading p { margin: 1px 0 0; color: var(--muted); font-size: 13px; }
.step-number { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-strong); color: #fff; font-weight: 900; }
.input-shell { position: relative; }
.input-shell > span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 9px; z-index: 1; }
.input-shell input { padding-left: 36px; border-width: 2px; }
.primary-arrow { justify-content: space-between !important; padding-left: 20px !important; padding-right: 20px !important; box-shadow: 0 8px 20px rgba(13,117,68,.2); }
.privacy-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 12px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.privacy-note span { color: var(--accent); font-size: 9px; }

@media (max-width: 430px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature { padding: 9px 11px; }
  .feature-icon { width: 44px; height: 44px; }
  .brand-product { display: none; }
}

/* Entrada de marca y dirección de casillero (experiencia móvil completa). */
.login-mode { background: #f1f5f3; }
.login-mode .appbar { display: none; }
.login-mode .view { max-width: 560px; padding: 0 0 40px; }
.login-mode .login-hero {
  position: relative;
  overflow: hidden;
  padding: calc(34px + env(safe-area-inset-top, 0px)) 24px 82px;
  border-radius: 0 0 36px 36px;
  background: linear-gradient(145deg,#042b1e 0%,#07563a 58%,#0b8050 100%);
  color: #fff;
  text-align: center;
}
.login-mode .login-hero::after { content: ""; position: absolute; width: 240px; height: 240px; right: -130px; bottom: -150px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.035),0 0 0 70px rgba(255,255,255,.02); }
.login-brand-plate { width: min(310px,86vw); margin: 0 auto 22px; padding: 12px 18px; border-radius: 22px; background: #fff; box-shadow: 0 12px 35px rgba(0,0,0,.22); }
.login-brand-plate img { display: block; width: 100%; height: 104px; object-fit: contain; }
.login-mode .login-hero .eyebrow { color: #9df2c8; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); }
.login-mode .login-hero h1 { max-width: 440px; margin: 16px auto 9px; color: #fff; font-size: clamp(31px,8vw,44px); }
.login-mode .login-hero .lead { max-width: 430px; margin: 0 auto; color: rgba(255,255,255,.8); }
.login-mode .feature-grid { max-width: 430px; margin: 22px auto -48px; position: relative; z-index: 1; }
.login-mode .feature { flex-direction: column; justify-content: center; min-height: 122px; padding: 12px 6px; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.95); color: var(--text); box-shadow: 0 10px 28px rgba(1,38,24,.18); }
.login-mode .feature-icon { background: linear-gradient(145deg,#15a768,#087348); }
.login-mode .feature small { margin-top: 2px; }
.login-mode #login-status { margin: 52px 18px 0; }
.login-mode .login-card { position: relative; margin: 52px 18px 0; padding: 22px; border: 0; border-radius: 24px; box-shadow: 0 18px 48px rgba(6,51,28,.12); }
.login-mode #login-status:not([hidden]) + .login-card { margin-top: 14px; }
.login-mode .login-card-heading { justify-content: center; text-align: center; }
.login-mode .step-number { background: #0c7f4d; }
.login-mode input { border-radius: 13px; }
.login-mode button.primary { min-height: 54px; border-radius: 14px; background: linear-gradient(135deg,#0b8d55,#096a42); }

.address-panel { margin: 0 0 15px; padding: 21px 18px 18px; border-left: 5px solid #17a969; border-radius: 4px 22px 22px 4px; background: linear-gradient(145deg,#f1f8f5,#fff); box-shadow: 0 10px 30px rgba(6,51,28,.07); }
.address-heading { display: flex; align-items: flex-start; gap: 11px; }
.address-pin { display: grid; place-items: center; flex: none; width: 31px; height: 31px; margin-top: 1px; border-radius: 50%; background: #dff5e9; color: #0b8d55; font-size: 9px; box-shadow: inset 0 0 0 7px #effaf4; }
.address-panel .eyebrow { min-height: 0; padding: 0; background: transparent; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.address-panel h2 { margin: 4px 0 12px; font-size: 19px; }
.address-panel > p { color: var(--muted); font-size: 13px; }
.address-card { margin-top: 15px; padding: 15px; border: 1px solid rgba(20,125,79,.15); border-radius: 15px; background: #fff; }
.address-card p { display: grid; grid-template-columns: 94px 1fr; gap: 8px; margin: 0; padding: 5px 0; font-size: 13px; }
.address-card strong { color: var(--accent-dark); }
.copy-address { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin-top: 12px; border: 0; border-radius: 13px; background: var(--accent-dark); color: #fff; font: inherit; font-size: 13px; font-weight: 800; }

.support-panel { margin: 28px 0 8px; padding: 24px 18px; border-top: 1px solid var(--line); text-align: center; }
.support-panel .eyebrow { min-height: 0; padding: 0; background: transparent; text-transform: uppercase; font-size: 10px; letter-spacing: .1em; }
.support-panel h2 { margin: 4px 0 14px; font-size: 18px; }
.support-panel > a { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid rgba(20,125,79,.14); border-radius: 16px; background: #fff; color: var(--text); text-align: left; text-decoration: none; box-shadow: 0 8px 25px rgba(6,51,28,.06); }
.support-panel .support-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 14px; background: #dbf7e8; color: #13a663; font-size: 9px; box-shadow: inset 0 0 0 10px #ecfbf3; }
.support-panel strong,.support-panel small { display: block; }.support-panel small { margin-top: 2px; color: var(--muted); }.support-panel b { margin-left: auto; color: var(--accent); font-size: 24px; }

@media (max-width: 430px) {
  .login-mode .feature-grid { grid-template-columns: repeat(3,1fr); }
  .login-mode .feature strong { font-size: 12px; }
  .login-mode .feature small { font-size: 9px; }
  .address-card p { grid-template-columns: 82px 1fr; }
}

.card.tappable { cursor: pointer; }
.card.tappable:active { background: var(--accent-soft); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row.top { align-items: flex-start; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent-dark);
  white-space: nowrap;
}
.badge.ok { background: var(--good-soft); color: var(--good); border-color: #b8dfcc; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #efd19a; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: #f3b8b4; }

.notice {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  font-size: 15px;
}
.notice.warn { background: var(--warn-soft); border-color: #efd19a; color: #6b4000; }
.notice.bad { background: var(--bad-soft); border-color: #f3b8b4; color: #8a1c14; }
.notice p:last-child { margin-bottom: 0; }

/* ── Inicio ─────────────────────────────────────────────────────────────── */
.hero { padding: 4px 0 8px; }

.action-grid { display: grid; gap: 12px; }

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 84px;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.action-card:active { background: var(--accent-soft); }
.action-card.primary-card { border-color: var(--accent); background: var(--accent-soft); }

.action-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.primary-card .action-icon { background: var(--accent-strong); color: #fff; }
.action-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.action-text { flex: 1; min-width: 0; }
.action-text strong { display: block; font-size: 17px; }
.action-text span { display: block; color: var(--muted); font-size: 14px; }
.action-card .chevron { flex: none; color: var(--muted); font-size: 22px; }

.attention {
  border: 1px solid #efd19a;
  background: var(--warn-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.attention strong { display: block; margin-bottom: 4px; }
.attention button { margin-top: 10px; }

@media (min-width: 620px) {
  .action-grid { grid-template-columns: 1fr 1fr; }
  .action-grid .span-2 { grid-column: 1 / -1; }
}

/* ── Inicio 2026: panel logístico inspirado en la claridad de una app nativa ── */
.brand-product { display: flex; flex-direction: column; line-height: 1.08; }
.brand-product strong { color: var(--accent-dark); font-size: 14px; }
.brand-product small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }

.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 190px;
  margin: -6px 0 14px;
  padding: 24px 22px;
  border-radius: 28px;
  background: linear-gradient(135deg, #073d2b 0%, #08704c 57%, #16a86a 100%);
  color: #fff;
  box-shadow: 0 18px 48px rgba(4, 70, 44, .18);
}
.home-hero::before, .home-hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.home-hero::before { width: 190px; height: 190px; right: -48px; top: -82px; border: 1px solid rgba(255,255,255,.22); box-shadow: 0 0 0 22px rgba(255,255,255,.04), 0 0 0 48px rgba(255,255,255,.025); }
.home-hero::after { width: 82px; height: 82px; right: 54px; bottom: -50px; background: rgba(58,225,160,.16); }
.home-hero .eyebrow { background: rgba(255,255,255,.14); color: #d9ffed; border: 1px solid rgba(255,255,255,.16); }
.home-hero h1 { max-width: 70%; margin: 13px 0 7px; color: #fff; font-size: clamp(30px, 8vw, 42px); letter-spacing: -.04em; }
.home-hero p { max-width: 80%; margin: 0; color: rgba(255,255,255,.82); font-size: 14px; line-height: 1.45; }
.route-orbit { position: absolute; right: 18px; bottom: 24px; width: 112px; height: 54px; transform: rotate(-10deg); }
.route-line { position: absolute; inset: 25px 8px auto; border-top: 2px dashed rgba(255,255,255,.45); }
.route-dot { position: absolute; top: 21px; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.12); }
.route-dot.start { left: 0; }.route-dot.end { right: 0; background: #7bf1b9; }
.route-plane { position: absolute; left: 48px; top: 8px; color: #fff; font-size: 23px; transform: rotate(-12deg); }

.locker-panel {
  display: grid;
  gap: 18px;
  margin: -42px 14px 15px;
  position: relative;
  z-index: 2;
  padding: 19px;
  border: 1px solid rgba(16, 133, 82, .13);
  border-radius: 22px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 13px 35px rgba(6,51,28,.12);
}
.locker-panel .eyebrow { min-height: 0; padding: 0; background: transparent; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.locker-panel h2 { margin: 4px 0 5px; color: var(--accent-dark); font-size: 29px; line-height: 1.05; letter-spacing: .03em; }
.locker-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.locker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.locker-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 45px; padding: 9px 10px; border: 0; border-radius: 13px; background: var(--accent-strong); color: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.locker-action.soft { background: var(--accent-soft); color: var(--accent-strong); }
.locker-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.locker-missing { margin-top: -28px; }

.overview-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 0 0 22px; border: 1px solid rgba(20,125,79,.14); border-radius: 20px; background: var(--line); box-shadow: 0 7px 24px rgba(6,51,28,.05); }
.overview-strip button { min-width: 0; min-height: 96px; padding: 13px 7px; border: 0; background: #fff; color: var(--text); font: inherit; text-align: center; cursor: pointer; }
.overview-strip span, .overview-strip strong, .overview-strip small { display: block; overflow: hidden; text-overflow: ellipsis; }
.overview-strip span { color: var(--muted); font-size: 11px; font-weight: 700; }
.overview-strip strong { margin: 4px 0 2px; color: var(--accent-dark); font-size: 20px; line-height: 1.1; }
.overview-strip small { color: var(--accent-strong); font-size: 9px; font-weight: 750; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 24px 1px 12px; }
.section-heading .eyebrow { min-height: 0; padding: 0; background: transparent; text-transform: uppercase; font-size: 10px; letter-spacing: .1em; }
.section-heading h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.025em; }
.section-heading .link-button { flex: none; margin-bottom: 1px; font-size: 12px; }

.action-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
.action-grid .span-2 { grid-column: 1 / -1; }
.action-card { position: relative; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 178px; padding: 15px; overflow: hidden; border-color: rgba(20,125,79,.13); border-radius: 20px; box-shadow: 0 8px 28px rgba(6,51,28,.055); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.action-card::after { content: ""; position: absolute; width: 82px; height: 82px; right: -42px; top: -42px; border-radius: 50%; background: rgba(21,150,91,.055); }
.action-card:active { transform: scale(.98); }
.action-card.primary-card { flex-direction: row; align-items: center; min-height: 106px; background: linear-gradient(120deg,#e7f7ee,#f8fffb); box-shadow: none; }
.action-icon { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(145deg,#e6f7ee,#d9f0e4); }
.action-icon svg { width: 32px; height: 32px; }
.action-text strong { font-size: 15px; line-height: 1.2; }
.action-text span { margin-top: 5px; font-size: 11px; line-height: 1.35; }
.action-card .chevron { position: absolute; right: 13px; bottom: 9px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 18px; }
.action-card.primary-card .chevron { position: static; margin-left: auto; }

@media (min-width: 620px) {
  .locker-panel { grid-template-columns: 1fr auto; align-items: center; }
  .locker-actions { min-width: 290px; }
  .action-grid { grid-template-columns: repeat(3, 1fr); }
  .action-grid .span-2 { grid-column: span 2; }
}

@media (max-width: 430px) {
  .brand-product { display: none; }
  .view { padding-left: 13px; padding-right: 13px; }
  .home-hero { padding-left: 20px; padding-right: 20px; }
}

/* ── Formularios ────────────────────────────────────────────────────────── */
label, legend { display: block; font-size: 15px; font-weight: 600; margin: 0 0 6px; padding: 0; }
fieldset { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; margin: 0 0 6px; }
.req { color: var(--bad); }

input[type="tel"],
input[type="text"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #9fb2a8;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

textarea { min-height: 96px; resize: vertical; }

input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); background: #fff8f7; }

:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--accent-strong); outline-offset: 1px; border-color: var(--accent-strong); }

.field { margin-bottom: 16px; }
.field-error { color: var(--bad); font-size: 14px; font-weight: 600; margin: 6px 0 0; }
.field-ok { color: var(--good); font-size: 14px; font-weight: 600; margin: 6px 0 0; }

button.primary,
button.secondary,
a.primary,
a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--accent-strong);
}

button.primary, a.primary { background: var(--accent-strong); color: #fff; }
button.secondary, a.secondary { background: var(--panel); color: var(--accent-strong); }
button.danger { background: var(--panel); color: var(--bad); border-color: var(--bad); }
button[disabled] { opacity: 0.6; cursor: not-allowed; }

.spaced { margin-top: 10px; }

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  margin-left: -8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Fila de acciones de un paso: Atrás / Siguiente */
.actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 8px; }
.actions button { width: 100%; }
@media (min-width: 520px) {
  .actions { flex-direction: row; justify-content: space-between; }
  .actions button { width: auto; min-width: 150px; }
}

/* Opciones elegibles: tarjetas con radio/checkbox reales (teclado y lector de pantalla) */
.choice { display: grid; gap: 10px; margin-bottom: 14px; }

.choice button,
.choice label.option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 12px 14px;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid #9fb2a8;
  background: var(--panel);
  font: inherit;
  font-weight: 400;
  cursor: pointer;
}
.choice button[aria-pressed="true"],
.choice label.option:has(input:checked) { border-color: var(--accent-strong); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-strong); }
.choice label.option:has(input:focus-visible) { outline: 3px solid var(--accent-strong); outline-offset: 2px; }
.choice strong { display: block; }
.choice .option-text { flex: 1; min-width: 0; }
.choice .option-text span { display: block; color: var(--muted); font-size: 14px; }

.choice input[type="radio"]:focus-visible { outline: none; }

.choice input[type="radio"],
.check input[type="checkbox"] { width: 24px; height: 24px; flex: none; accent-color: var(--accent-strong); margin: 0; }

.check { display: flex; align-items: flex-start; gap: 12px; min-height: var(--tap); padding: 10px 0; font-weight: 400; margin: 0; cursor: pointer; }

/* Contador de bultos */
.stepper { display: flex; align-items: stretch; gap: 8px; max-width: 260px; }
.stepper button {
  flex: none;
  width: 52px;
  min-height: 52px;
  border-radius: 10px;
  border: 2px solid var(--accent-strong);
  background: var(--panel);
  color: var(--accent-strong);
  font: inherit;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}
.stepper input { text-align: center; min-height: 52px; font-size: 20px; font-weight: 700; }

.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

details.more { margin: 0 0 16px; }
details.more summary { min-height: var(--tap); display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-strong); cursor: pointer; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; font-size: 16px; line-height: 1; }
details.more[open] summary::before { content: "−"; }
details.more[open] summary { margin-bottom: 10px; }

/* ── Progreso de la solicitud ───────────────────────────────────────────── */
.progress { margin: 0 0 14px; }
.progress-label { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.progress-label strong { color: var(--text); }
.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li { flex: 1; height: 8px; border-radius: 999px; background: var(--line); }
.steps li.done { background: var(--accent); }
.steps li.current { background: var(--accent-strong); }

.error-summary {
  border: 2px solid var(--bad);
  background: var(--bad-soft);
  color: #8a1c14;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 600;
}
.error-summary ul { margin: 6px 0 0 18px; padding: 0; font-weight: 400; }
.error-summary a { color: inherit; }

/* ── Resumen y confirmación ─────────────────────────────────────────────── */
.summary-card .row { margin-bottom: 4px; }
.summary-card h3 { margin: 0; }
.summary-card dl { margin: 6px 0 0; }
.summary-card dt { color: var(--muted); font-size: 14px; }
.summary-card dd { margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }

.success { text-align: center; padding: 8px 0 4px; }
.success-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #fff;
}
.success-mark svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.reference { display: inline-block; margin: 6px 0 14px; padding: 6px 14px; border-radius: 8px; background: var(--accent-soft); font-weight: 800; letter-spacing: 0.04em; font-size: 18px; }

ol.next-steps { margin: 0 0 14px 20px; padding: 0; }
ol.next-steps li { margin-bottom: 6px; }

.empty { text-align: center; padding: 28px 12px; }
.empty .action-icon { margin: 0 auto 12px; width: 56px; height: 56px; }

ul.checklist { list-style: none; margin: 0 0 12px; padding: 0; }
ul.checklist li { position: relative; padding: 6px 0 6px 30px; }
ul.checklist li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 12px; height: 7px; border-left: 3px solid var(--accent-strong); border-bottom: 3px solid var(--accent-strong); transform: rotate(-45deg); }

/* ── Evidencia ──────────────────────────────────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }

.gallery figure { margin: 0; }

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  display: block;
}

.gallery figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

.compare { display: grid; gap: 12px; }
@media (min-width: 620px) { .compare { grid-template-columns: 1fr 1fr; } }

canvas.signature {
  width: 100%;
  height: 180px;
  border: 1px dashed var(--accent-strong);
  border-radius: 8px;
  background: var(--panel);
  touch-action: none;
  display: block;
}

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  padding: 8px 0 8px 16px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}
.timeline li.reached { border-left-color: var(--accent); color: var(--text); }
.timeline strong { display: block; font-size: 15px; }

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(76px + var(--safe));
  z-index: 20;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-dark);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(6, 51, 28, 0.24);
}
.toast.bad { background: var(--bad); }

.spinner { color: var(--muted); padding: 32px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ── Barra superior: campana de alertas ─────────────────────────────────── */
.appbar-actions { display: flex; align-items: center; gap: 4px; }

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--accent-dark);
  cursor: pointer;
}
.icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.is-active { background: var(--accent-soft); color: var(--accent-strong); }

.count-dot {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* ── Módulos: resumen, filtros y datos ──────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.stat {
  min-width: 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat .stat-label { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.stat .stat-value { display: block; font-size: 17px; overflow-wrap: anywhere; }
.stat.warn { border-color: #efd19a; background: var(--warn-soft); }
.stat.warn .stat-value { color: var(--warn); }
.stat.ok .stat-value { color: var(--good); }
@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child { grid-column: 1 / -1; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip {
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid #9fb2a8;
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.facts-grid dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 6px 0 0; }
.facts-grid dt { color: var(--muted); font-size: 13px; }
.facts-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 339px) { .facts-grid dl { grid-template-columns: 1fr; } }

.invoice-card h2, .quote-card h2 { margin: 0; font-size: 17px; }
.invoice-card.overdue { border-color: #f3b8b4; }
.invoice-card.pending { border-color: #efd19a; }
.tracking { overflow-wrap: anywhere; }
.package-card details.more { margin: 8px 0 0; }
.package-card .link-button { margin-top: 4px; }

.alert-card.bad { border-color: #f3b8b4; background: #fffafa; }
.alert-card.warn { border-color: #efd19a; background: #fffdf8; }
.alert-card button { margin-top: 4px; }
.attention.bad { border-color: #f3b8b4; background: var(--bad-soft); }
.attention h2 { margin: 0 0 6px; font-size: 17px; }
.attention-items { list-style: none; margin: 0; padding: 0; }
.attention-items li { padding: 8px 0; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.attention-items li:first-child { border-top: 0; padding-top: 0; }
.attention-items strong { display: block; margin: 0; }
.attention-items span { display: block; font-size: 14px; color: var(--muted); }
.attention-items .link-button { margin: 2px 0 0 -8px; }
.attention > .link-button { margin-top: 2px; }

/* Filas del menú "Más": botones y enlaces con el mismo aspecto */
.menu-list { gap: 10px; }
a.menu-row { text-decoration: none; }
.action-text .badge { display: inline-block; margin-left: 4px; vertical-align: middle; }

a.primary, a.secondary { text-decoration: none; }
main a:not(.primary):not(.secondary):not(.menu-row):not(.link-button) { color: var(--accent-strong); font-weight: 600; text-underline-offset: 3px; }
a.spaced { margin-top: 10px; }

/* Acciones del cliente: enlace de pago de una factura y resultado de una prealerta. */
.invoice-card > a.primary { margin-top: 12px; }
.notice > h2:first-child { margin-top: 0; font-size: 18px; }
.repack-card .facts-grid { margin: 8px 0 12px; }
