:root {
  --brand: #5b6bc7;
  --brand-deep: #3f4a9e;
  --brand-soft: #eef0fb;
  --pink: #e98bba;
  --pink-soft: #fdeef5;
  --lilac: #b9a7e3;
  --ink: #171a2b;
  --muted: #6e7391;
  --line: #e7e8f2;
  --canvas: #f6f6fb;
  --white: #fff;
  --ok: #0f8a6a;
  --danger: #c8385c;
  --radius: 22px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 43, 0.05);
  --shadow-md: 0 18px 40px -22px rgba(63, 74, 158, 0.35);
  --shadow-lg: 0 40px 80px -40px rgba(63, 74, 158, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.receipt__code,
.brand {
  font-family: Outfit, Inter, ui-sans-serif, system-ui, sans-serif;
}

.shell {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Fondo ---------- */

.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.aurora-blob--blue {
  width: 46rem;
  height: 46rem;
  top: -22rem;
  right: -14rem;
  background: radial-gradient(circle, rgba(91, 107, 199, 0.5), transparent 65%);
}

.aurora-blob--pink {
  width: 34rem;
  height: 34rem;
  top: 18rem;
  left: -16rem;
  background: radial-gradient(circle, rgba(233, 139, 186, 0.45), transparent 65%);
}

.aurora-blob--lilac {
  width: 30rem;
  height: 30rem;
  bottom: -14rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(185, 167, 227, 0.4), transparent 65%);
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 232, 242, 0.9);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand img {
  display: block;
  height: 38px;
  width: auto;
}

.site-header__meta {
  text-align: right;
}

.site-header__meta p {
  margin: 6px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge--ok {
  background: #e6f6f1;
  color: var(--ok);
}

/* ---------- Hero ---------- */

.page {
  position: relative;
  z-index: 1;
  padding-top: 48px;
  padding-bottom: 72px;
}

.hero {
  margin-bottom: 34px;
}

.hero__eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink);
}

.hero__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero__title span {
  background: linear-gradient(100deg, var(--brand) 20%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 14px 0 0;
  max-width: 46ch;
  color: var(--muted);
}

/* ---------- Stepper ---------- */

.stepper ol {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.step-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.step-pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.35s ease;
}

.step-pill.active::before,
.step-pill.done::before {
  background: linear-gradient(90deg, var(--brand), var(--pink));
}

.step-pill__dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.25s ease;
}

.step-pill.active .step-pill__dot {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(91, 107, 199, 0.14);
}

.step-pill.done .step-pill__dot {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--white);
}

.step-pill.active,
.step-pill.done {
  color: var(--ink);
}

.step-pill__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Card ---------- */

.card {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 34px;
}

.panel {
  display: grid;
  gap: 20px;
  animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel__head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.panel__head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* ---------- Campos ---------- */

.grid {
  display: grid;
  gap: 16px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field > span em {
  font-style: normal;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a8adc4;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #d3d6e8;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(91, 107, 199, 0.13);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7391' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
}

/* ---------- Empresas ---------- */

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

.company-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 18px 52px 18px 20px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease, box-shadow 0.2s ease;
}

.company-card::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #d3d6e8;
  transition: 0.2s ease;
}

.company-card:hover {
  transform: translateY(-2px);
  border-color: #c9cfef;
  box-shadow: var(--shadow-md);
}

.company-card.selected {
  border-color: var(--brand);
  background: linear-gradient(180deg, #fbfcff, var(--white));
  box-shadow: 0 0 0 3px rgba(91, 107, 199, 0.12);
}

.company-card.selected::after {
  border-color: var(--brand);
  background: var(--brand)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E")
    center / 13px no-repeat;
}

.company-card h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.company-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.company-card .tag {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.company-card .tag--pink {
  background: var(--pink-soft);
  color: #b8477e;
}

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

.campus-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 52px 18px 18px;
}

.campus-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-soft), var(--pink-soft));
  color: var(--brand);
}

.campus-card__icon svg {
  width: 22px;
  height: 22px;
}

.campus-card.selected .campus-card__icon {
  color: var(--brand-deep);
}

.campus-card__body {
  display: grid;
  gap: 2px;
}

.campus-card__hint {
  color: var(--muted);
  font-size: 12.5px;
}

.skeleton {
  height: 92px;
  border-radius: 18px;
  background: linear-gradient(100deg, #f1f2f8 30%, #e9ebf5 50%, #f1f2f8 70%);
  background-size: 220% 100%;
  animation: sweep 1.3s linear infinite;
}

@keyframes sweep {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -20% 0;
  }
}

.summary {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(120deg, var(--brand-soft), var(--pink-soft));
  border: 1px solid rgba(91, 107, 199, 0.16);
  font-size: 13.5px;
}

.summary strong {
  font-size: 14.5px;
}

.summary span {
  color: var(--muted);
}

/* ---------- Dropzone ---------- */

.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 30px 20px;
  border: 1.5px dashed #cfd4ea;
  border-radius: 18px;
  background: #fbfbfe;
  text-align: center;
  transition: 0.2s ease;
}

.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--brand);
  background: #f7f8ff;
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.dropzone__icon svg {
  width: 20px;
  height: 20px;
}

.dropzone__title {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 14px;
}

.dropzone__hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 12.5px;
  box-shadow: var(--shadow-sm);
}

.chip span {
  color: var(--muted);
}

.chip button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #f1f2f8;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: 0.15s ease;
}

.chip button:hover {
  background: var(--pink-soft);
  color: var(--danger);
}

/* ---------- Alertas ---------- */

.alert {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14px;
  animation: rise 0.3s ease;
}

.alert--error {
  background: #fdf2f5;
  border-color: #f6d3de;
  color: #96274a;
}

.alert--ok {
  background: #eff9f5;
  border-color: #c9ecdf;
  color: #0b6c53;
}

/* ---------- Constancia ---------- */

.receipt {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.receipt__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--lilac), var(--pink));
}

.receipt__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.receipt__head img {
  height: 30px;
  width: auto;
}

.receipt__label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.receipt__code {
  margin: 6px 0 22px;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(100deg, var(--brand-deep), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.receipt__details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 20px 0 0;
  border-top: 1px dashed #e3d5e6;
}

.receipt__details dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.receipt__details dd {
  margin: 4px 0 0;
  font-weight: 500;
  font-size: 14px;
}

.receipt__foot {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Acciones ---------- */

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.actions__right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--primary {
  background: linear-gradient(120deg, var(--brand), var(--brand-deep));
  color: var(--white);
  box-shadow: 0 12px 24px -14px rgba(63, 74, 158, 0.8);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -16px rgba(63, 74, 158, 0.85);
}

.btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn--ghost {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: #cfd4ea;
  background: #fbfbfe;
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.legal {
  margin: 26px auto 0;
  max-width: 60ch;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .shell {
    padding: 0 18px;
  }

  .card {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .grid--2,
  .grid--3,
  .receipt__details {
    grid-template-columns: 1fr;
  }

  .step-pill__label {
    display: none;
  }

  .stepper ol {
    gap: 10px;
  }

  .site-header__meta p {
    display: none;
  }

  .actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .actions__right {
    margin-left: 0;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ---------- Impresión ---------- */

@media print {
  .aurora,
  .site-header,
  .hero,
  .stepper,
  .alert,
  .actions,
  .legal {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page {
    padding: 0;
  }

  .card {
    border: none;
    box-shadow: none;
    padding: 0;
    background: none;
    backdrop-filter: none;
  }

  .receipt {
    border: 1px solid #c9cfef;
    box-shadow: none;
  }

  .receipt__code {
    color: #3f4a9e;
    -webkit-text-fill-color: #3f4a9e;
  }
}
