* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  padding-bottom: 32px;
}

.m-anuncio-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: min(92vw, 380px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
}

.m-anuncio-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

.m-anuncio-dialog__inner {
  padding: 18px;
}

.m-anuncio-dialog__inner h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.m-anuncio-dialog__inner p {
  margin: 0 0 14px;
  line-height: 1.4;
  font-size: 0.9rem;
}

body.m-page {
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}

.m-hero {
  background: linear-gradient(160deg, #0f766e 0%, #059669 55%, #10b981 100%);
  color: #fff;
  padding: max(16px, env(safe-area-inset-top, 0px)) 20px 24px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(15, 118, 110, 0.3);
}

.m-hero__brand {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.88;
}

.m-hero__sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  opacity: 0.9;
}

.m-hero h1 {
  margin: 10px 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

.m-hero .sub {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  line-height: 1.4;
}

.m-body {
  max-width: 420px;
  margin: -12px auto 0;
  padding: 0 16px 16px;
  position: relative;
  z-index: 1;
}

.m-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-icon-wrap svg {
  width: 32px;
  height: 32px;
}

.m-icon-wrap .fa-solid,
.m-icon-wrap .fa-regular {
  font-size: 1.75rem;
  line-height: 1;
}

.m-card .btn .fa-solid,
.m-card .btn .fa-regular {
  margin-right: 0.35rem;
  font-size: 1.1em;
  vertical-align: -0.1em;
}

.m-link .fa-solid,
.m-link .fa-regular {
  font-size: 1.15rem;
  line-height: 1;
  margin-right: 0.4rem;
}

.m-card .empleado-nombre,
.m-card #empleado-nombre,
.m-card #empleado-label,
.m-card #nombre-guardado {
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  margin: 0 0 14px;
  color: #0f172a;
}

.btn svg,
.m-link svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 6px;
}

.m-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
}

.m-link--accent {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.m-link--ghost {
  background: #fff;
}

.m-status-card {
  text-align: center;
  padding: 28px 20px;
}

.m-status-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.m-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 14px;
  border: 3px solid #e2e8f0;
  border-top-color: #059669;
  border-radius: 50%;
  animation: m-spin 0.8s linear infinite;
}

@keyframes m-spin {
  to {
    transform: rotate(360deg);
  }
}

.wrap { max-width: 420px; margin: 0 auto; padding: 16px; }
.brand-sub {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin: -0.35rem 0 0.75rem;
  font-weight: 600;
}

.field-hint {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.75rem;
  color: #64748b;
}

.brand { text-align: center; font-size: 11px; font-weight: 700; color: #059669; text-transform: uppercase; letter-spacing: .08em; }
h1 { text-align: center; font-size: 1.5rem; margin: 8px 0 4px; }
.sub { text-align: center; color: #64748b; font-size: 14px; margin-bottom: 20px; }
.card,
.m-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}

.m-body .card,
.m-body .m-card {
  margin-top: 0;
}
label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
input, select {
  width: 100%;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 14px;
  background: #fff;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}
.btn-primary { background: #059669; color: #fff; }
.btn-primary:disabled { opacity: .55; cursor: wait; }
.btn-accent { background: #4f46e5; color: #fff; }
.msg-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 12px;
  display: none;
}
.msg-error.show { display: block; }
.gps-aviso {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
  text-align: center;
}
.gps-aviso.hidden {
  display: none;
}
.msg-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
}
.msg-warn.show { display: block; }
.msg-ok {
  background: #059669;
  color: #fff;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  display: none;
}
.msg-ok.show { display: block; }
.hidden { display: none !important; }
legend { font-size: 14px; font-weight: 700; padding: 0 4px; }
fieldset { border: none; padding: 0; margin: 0; }
.step2 { border: 2px solid #059669; }
.status { text-align: center; font-size: 13px; color: #64748b; margin: 8px 0; }

/* —— Asistencia (móvil, corporativo) —— */
.m-page--asist {
  background: #e8edf3;
}

.m-hero--corp {
  background: linear-gradient(165deg, #0f172a 0%, #1e3a5f 52%, #334155 100%);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.35);
}

.m-hero--corp .m-hero__brand i {
  margin-right: 0.35rem;
  opacity: 0.9;
}

.m-icon-wrap--corp {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.m-body--asist {
  max-width: 440px;
}

.m-pipeline {
  list-style: none;
  margin: 0 0 12px;
  padding: 12px 8px;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.m-pipeline__step {
  flex: 1;
  text-align: center;
  min-width: 0;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.m-pipeline__step.is-active,
.m-pipeline__step.is-done {
  opacity: 1;
}

.m-pipeline__step.is-active .m-pipeline__icon {
  background: #1e3a5f;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.2);
}

.m-pipeline__step.is-done .m-pipeline__icon {
  background: #0d9488;
  color: #fff;
}

.m-pipeline__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 4px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.85rem;
}

.m-pipeline__label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  line-height: 1.2;
}

.m-status-line {
  text-align: center;
  font-size: 0.82rem;
  color: #475569;
  margin: 0 0 12px;
  min-height: 1.2em;
  font-weight: 600;
}

.m-asist-card {
  border-radius: 18px;
  border-color: #dbe3ee;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.m-asist-detect {
  text-align: center;
  padding: 12px 4px 8px;
}

.m-asist-detect p {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.45;
}

.m-spinner--dark {
  border-color: #e2e8f0;
  border-top-color: #1e3a5f;
}

.m-empleado-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.m-empleado-chip__avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1e3a5f, #0d9488);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.m-empleado-chip__role {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.m-empleado-chip__name {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.m-auth-hint {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.45;
  text-align: center;
}

.gps-aviso i {
  margin-right: 0.35rem;
}

.btn--corp {
  background: linear-gradient(180deg, #1e3a5f 0%, #0f2744 100%);
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.35);
}

.btn--corp:disabled {
  opacity: 0.65;
}

.m-asist-success {
  text-align: center;
  padding-top: 8px;
}

.m-asist-success__icon {
  font-size: 3rem;
  color: #0d9488;
  margin-bottom: 8px;
  line-height: 1;
}

.m-asist-success__icon .fa-circle-info {
  color: #1e3a5f;
}

.m-asist-success__title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: #0f172a;
}

.m-asist-success__msg {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.5;
}

.m-asist-fallback__icon {
  text-align: center;
  font-size: 2.5rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.m-asist-fallback__title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.1rem;
  color: #0f172a;
}

.m-asist-fallback__text {
  margin: 0 0 18px;
  text-align: center;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
}

.m-anuncio-dialog__kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0d9488;
}

.m-anuncio-dialog__kicker i {
  margin-right: 0.3rem;
}

/* —— PWA install (Mi Ficha) —— */
.pwa-install-banner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #99f6e4;
  text-align: center;
}

.pwa-install-banner.hidden {
  display: none;
}

.pwa-install-banner__text {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.45;
}

.pwa-install-banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #0f766e;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.pwa-install-banner__btn:active {
  transform: scale(0.98);
}

.pwa-ios-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.pwa-ios-modal.hidden {
  display: none;
}

.pwa-ios-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.pwa-ios-modal__card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 20px 18px 18px;
  border-radius: 18px 18px 14px 14px;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
}

.pwa-ios-modal__card h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  color: #0f172a;
}

.pwa-ios-modal__steps {
  margin: 0 0 16px;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.55;
}

.pwa-ios-modal__steps li + li {
  margin-top: 8px;
}

.pwa-ios-modal__steps i {
  color: #0f766e;
}

@media (prefers-color-scheme: dark) {
  .pwa-install-banner {
    background: linear-gradient(135deg, #134e4a 0%, #115e59 100%);
    border-color: #0f766e;
  }

  .pwa-install-banner__text {
    color: #ecfdf5;
  }

  .pwa-ios-modal__card {
    background: #1e293b;
  }

  .pwa-ios-modal__card h2 {
    color: #f1f5f9;
  }

  .pwa-ios-modal__steps {
    color: #cbd5e1;
  }
}
