/* ============================================================
   CENTINELA AMSA — Design System v2.0
   Tarjetas Digitales · Apple Wallet · Espacios Confinados
   Mobile-first · Industrial Safety · No external dependencies
   ============================================================ */

/* === TOKENS ================================================ */
:root {
  /* Brand */
  --teal:        #0F5961;
  --teal-deep:   #083B41;
  --teal-mid:    #0C4D54;
  --teal-light:  #1A7A84;
  --teal-card:   #0F5961;
  --gold:        #FFD60A;
  --gold-hover:  #E8C200;
  --cc-red:      #C8102E;
  --cc-red-dark: #A00D25;

  /* Neutrals */
  --white:       #FFFFFF;
  --off-white:   #F8FAFC;
  --border:      #E2E8F0;
  --text:        #0F172A;
  --text-muted:  #64748B;

  /* Status */
  --active-green:  #16A34A;
  --active-bg:     #DCFCE7;
  --active-text:   #15803D;

  /* Shadows */
  --shadow-card: 0 4px 32px rgba(0,0,0,0.28), 0 1px 6px rgba(0,0,0,0.18);
  --shadow-btn:  0 2px 8px rgba(0,0,0,0.22);

  /* Radius */
  --r-sm:   8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
}

/* === RESET ================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }

/* === BASE ================================================== */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--teal-deep);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
  touch-action: manipulation;
  overscroll-behavior: contain;
}

/* === LAYOUT ================================================ */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px;
}

/* === HAZARD TAPE =========================================== */
.hazard-tape {
  height: 10px;
  flex-shrink: 0;
  background: repeating-linear-gradient(
    -45deg,
    var(--gold)  0px, var(--gold) 14px,
    #000        14px, #000        28px
  );
}
.hazard-tape--thin { height: 6px; }

/* === HEADER ================================================ */
.site-header {
  background:
    linear-gradient(160deg, var(--teal) 0%, var(--teal-mid) 55%, var(--teal-deep) 100%);
  padding: 32px 16px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Foto de planta como textura de fondo muy sutil */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets-preview/strip@2x.png');
  background-size: cover;
  background-position: center 35%;
  opacity: 0.08;          /* muy sutil — solo textura */
  pointer-events: none;
}

/* Decorative circle accent */
.site-header::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-full);
  padding: 6px 14px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  position: relative;
}

.brand-pill svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.site-header h1 {
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 10px;
  position: relative;
}

.header-sub {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.9;
  position: relative;
}

/* === SAFARI NOTICE ========================================= */
.notice-bar {
  background: rgba(255,214,10,0.1);
  border-top:    1px solid rgba(255,214,10,0.2);
  border-bottom: 1px solid rgba(255,214,10,0.2);
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  text-align: center;
  line-height: 1.4;
}
.notice-bar svg { flex-shrink: 0; color: var(--gold); }
.notice-bar strong { color: var(--white); }

/* === MAIN ================================================== */
main {
  flex: 1;
  padding: 24px 0 48px;
}

/* === SECTION LABEL ========================================= */
.section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.12);
}

/* === PASS CARD (hero card – active tarjeta) ================ */
.pass-card {
  background: var(--white);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  color: var(--text);
}

/* Top colored panel mimicking Apple Wallet card face */
.pass-card__face {
  background: linear-gradient(160deg, var(--teal-card) 0%, var(--teal-mid) 55%, var(--teal-deep) 100%);
  padding: 0 0 22px;       /* top padding eliminado — lo maneja el strip */
  position: relative;
  overflow: hidden;
}

/* ── Strip preview: espejo exacto del strip.png del .pkpass ─ */
.pass-card__strip-preview {
  width: 100%;
  height: 84px;             /* = dimensiones @1x del strip (320×84) */
  background-image: url('/assets-preview/strip.png');
  background-size: cover;
  background-position: center top;
  border-radius: 0;
  display: block;
  margin-bottom: 18px;
  position: relative;
}
/* Overlay muy sutil para que los badges encima sean legibles */
.pass-card__strip-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(15,89,97,0.18) 100%);
}

/* Contenido debajo del strip (badges + título + stats) con padding propio */
.pass-card__face-content {
  padding: 0 20px;
  position: relative;
}

.pass-card__face::before {
  display: none;   /* removido — el strip ocupa ese espacio */
}

.pass-card__face-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.badge-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--active-bg);
  color: var(--active-text);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--r-full);
}

.dot-pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--active-green);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.wallet-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
}
.wallet-badge svg { width: 13px; height: 13px; }

.pass-card__proto-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.pass-card__title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
}

/* === CC BADGES (controles críticos) ======================== */
.pass-card__cc-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 8px;
  border-radius: var(--r-full);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cc-badge--red {
  background: rgba(200, 16, 46, 0.22);
  border-color: rgba(200, 16, 46, 0.55);
  color: #ff6b85;
}

.cc-badge--teal {
  background: rgba(26, 122, 132, 0.28);
  border-color: rgba(26, 122, 132, 0.6);
  color: rgba(255,255,255,0.85);
}

.cc-badge svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.cc-badge__num {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.cc-badge__name {
  font-weight: 600;
  opacity: 0.85;
  font-size: 0.65rem;
}

.pass-card__stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-block__label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.stat-block__value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
}

/* Gold divider strip */
.pass-card__divider {
  height: 3px;
  background: linear-gradient(90deg,
    var(--gold) 0%,
    #E8C200 50%,
    var(--gold) 100%);
}

/* Bottom white action panel */
.pass-card__actions {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* === BUTTONS =============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  min-height: 52px;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: all 160ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.975); }

/* Primary – download */
.btn-primary {
  background: var(--gold);
  color: #000;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: var(--shadow-btn);
  letter-spacing: 0.01em;
}
.btn-primary:hover { background: var(--gold-hover); }
.btn-primary svg  { flex-shrink: 0; }

/* Outline – secondary action */
.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}
.btn-outline:hover { background: rgba(15,89,97,0.07); }

/* Filled teal – upload */
.btn-upload {
  background: var(--teal);
  color: var(--white);
}
.btn-upload:hover { background: var(--teal-light); }

/* Red – critical */
.btn-critical {
  background: var(--cc-red);
  color: var(--white);
}
.btn-critical:hover { background: var(--cc-red-dark); }

/* Back link */
.btn-back {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-back:hover { background: rgba(255,255,255,0.18); }

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* === STEPS CARD ============================================ */
.steps-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.steps-heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.steps-heading svg { flex-shrink: 0; }

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-size: 0.9rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.step-body strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.step-body p {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.58);
  line-height: 1.45;
}

/* === UPCOMING / STUBS ====================================== */
.upcoming-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 16px;
}

.upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.upcoming-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}
.upcoming-title svg { color: rgba(255,255,255,0.4); }

.badge-dev {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,0.1);
}

.stub-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.15);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  cursor: default;
}

.stub-item__left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stub-item__left svg { opacity: 0.35; flex-shrink: 0; }

.stub-soon {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.4);
  padding: 3px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
}

/* === FORM PAGE ============================================= */
.form-card {
  background: var(--white);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  color: var(--text);
  margin-bottom: 20px;
}

.form-card__header {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  padding: 22px 22px 24px;
  color: var(--white);
}

.form-card__eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-card__header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.form-card__header p {
  font-size: 0.82rem;
  opacity: 0.75;
}

.form-card__body {
  padding: 22px;
}

.form-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #FEFCE8;
  border-left: 3px solid var(--gold);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  color: #78350F;
  margin-bottom: 22px;
  line-height: 1.5;
}
.form-notice svg { flex-shrink: 0; margin-top: 1px; color: #92400E; }
.form-notice strong { color: #451A03; }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.form-label-opt {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--off-white);
  transition: border-color 150ms ease, background 150ms ease;
  -webkit-appearance: none;
  min-height: 52px;
}
.form-input:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--white);
}

.form-input[type="file"] {
  padding: 12px 16px;
  font-size: 0.9rem;
  cursor: pointer;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

/* === ALERTS ================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert strong { display: block; margin-bottom: 2px; }

.alert--warn    { background: #FEFCE8; color: #713F12; border-left: 3px solid var(--gold); }
.alert--success { background: #F0FDF4; color: #14532D; border-left: 3px solid var(--active-green); }
.alert--error   { background: #FFF1F2; color: #881337; border-left: 3px solid var(--cc-red); }
.alert--info    { background: #EFF6FF; color: #1E3A5F; border-left: 3px solid #3B82F6; }

/* === SUCCESS / CONFIRMATION ================================ */
.result-card {
  background: var(--white);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  color: var(--text);
  margin-bottom: 20px;
}

.result-card__header {
  background: linear-gradient(135deg, #14532D 0%, #16A34A 100%);
  padding: 24px 22px;
  color: var(--white);
  text-align: center;
}

.result-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.result-card__header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.result-card__header p {
  font-size: 0.82rem;
  opacity: 0.75;
}

.result-card__body {
  padding: 22px;
}

.meta-table {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 20px;
}
.meta-row {
  display: flex;
  padding: 11px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.meta-row:last-child { border-bottom: none; }
.meta-row__key {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 100px;
  flex-shrink: 0;
}
.meta-row__val { color: var(--text); }

/* === ERROR PAGE ============================================ */
.error-card {
  background: var(--white);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  color: var(--text);
  margin-bottom: 20px;
}
.error-card__header {
  background: linear-gradient(135deg, var(--cc-red-dark) 0%, var(--cc-red) 100%);
  padding: 24px 22px;
  text-align: center;
  color: var(--white);
}
.error-card__header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.error-card__header p { font-size: 0.82rem; opacity: 0.8; }
.error-card__body { padding: 22px; }
.error-card__body p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

/* === FOOTER ================================================ */
.site-footer { margin-top: auto; }

.footer-body {
  padding: 20px 16px 24px;
  text-align: center;
}
.footer-brand {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.footer-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}

/* === UTILITIES ============================================= */
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* === RESPONSIVE ============================================ */
@media (min-width: 480px) {
  .form-actions { flex-direction: row; }
  .form-actions .btn { flex: 1; }
}

@media (min-width: 640px) {
  .container      { padding: 0 24px; }
  .site-header    { padding: 36px 24px 44px; }
  main            { padding: 32px 0 64px; }
  .pass-card__face { padding: 24px 24px 26px; }
  .pass-card__actions { padding: 24px; }
}

/* === ACCESSIBILITY ========================================= */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .dot-pulse  { animation: none; }
  .btn        { transition: none; }
  .form-input { transition: none; }
}
