/* ============================================================
   Preinscripción en pasos — estilos del wizard (StudentSession#enrollments_wizard)
   Salen del lienzo de diseño "Rediseño de inscripción CODEX".
   Marca: marino #003366, cian #00bcd4, violeta #6b46c1, crema #f3f4f6.
   El cian del botón baja un paso (#00838f) para que el texto blanco se lea.
   Todo cuelga de .ew para no tocar el resto del panel.
   ============================================================ */

.ew { color: var(--pc-ink); }
.ew *, .ew *::before, .ew *::after { box-sizing: border-box; }

.ew-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; max-width: 1080px; margin: 0 auto; }
.ew-main { min-width: 0; max-width: 640px; width: 100%; margin: 0 auto; }
.ew-aside { display: none; }

/* Ruta: Elegir → Reservar → Pagar → Listo */
.ew-route { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 8px 0 4px; list-style: none; }
.ew-route li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ew-route li + li::before { content: ''; position: absolute; top: 19px; right: 50%; width: 100%; height: 3px; border-radius: 2px; background: var(--pc-line); }
.ew-route li.done::before, .ew-route li.now::before { background: linear-gradient(90deg, var(--pc-cyan), var(--pc-purple)); }
.ew-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 2px solid var(--pc-line); color: #8696a8; }
.ew-route li.done .ew-dot { background: linear-gradient(135deg, var(--pc-cyan), var(--pc-purple)); border-color: transparent; color: #fff; }
.ew-route li.now .ew-dot { border-color: var(--pc-cyan); color: var(--pc-ink); box-shadow: 0 0 0 5px rgba(0, 188, 212, 0.18); }
.ew-route li.wait .ew-dot { border-color: #f59e0b; color: #92400e; background: #fef3c7; box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.2); }
.ew-route li.wait .ew-lbl { color: var(--pc-ink); }
.ew-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pc-muted); }
.ew-route li.done .ew-lbl, .ew-route li.now .ew-lbl { color: var(--pc-ink); }

/* Encabezado de cada decisión */
.ew-step-head { display: flex; align-items: center; gap: 12px; padding: 20px 0 12px; }
.ew-step-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: rgba(107, 70, 193, 0.1); color: var(--pc-purple); }
.ew-step-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; color: var(--pc-ink); }

/* Fichas */
.ew-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ew-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 120px; padding: 14px 10px; background: #fff; border: 1.5px solid var(--pc-line); border-radius: 16px; color: var(--pc-ink); text-align: center; text-decoration: none; font-size: 14px; font-weight: 700; line-height: 1.2; }
.ew-tile:hover { border-color: var(--pc-cyan); color: var(--pc-ink); }
.ew-tile:focus-visible { outline: 3px solid rgba(0, 188, 212, 0.45); outline-offset: 2px; }
.ew-tile.off { border-style: dashed; background: transparent; color: var(--pc-muted); }
.ew-tile small { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--pc-muted); }
.ew-tile small.ok { color: #047857; }
/* Fila ancha: ícono, una palabra, flecha. Para pocas opciones con nombres largos. */
.ew-tiles.list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ew-tiles.list .ew-tile { flex-direction: row; justify-content: flex-start; gap: 16px; min-height: 76px; padding: 12px 16px; font-size: 17px; text-align: left; }
.ew-tiles.list .ew-tile .go { margin-left: auto; color: var(--pc-muted); }

/* Sellos: lo ya elegido, con botón para cambiar */
.ew-stamps { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; }
.ew-stamp { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 10px; background: #fff; border: 1px solid var(--pc-line); border-radius: 999px; color: var(--pc-ink); text-decoration: none; font-size: 14px; font-weight: 700; }
.ew-stamp.fixed { padding-right: 14px; }
.ew-stamp:hover { color: var(--pc-ink); border-color: var(--pc-cyan); }
.ew-stamp-ic { display: grid; place-items: center; min-width: 24px; font-size: 16px; line-height: 1; }
.ew-edit { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 51, 102, 0.07); font-size: 12px; }

/* Boletos */
.ew-tickets { display: flex; flex-direction: column; gap: 16px; }
.ew-ticket { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--pc-line); border-radius: 18px; }
.ew-ticket.full { opacity: 0.7; }
.ew-ticket-main { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 14px; }
.ew-when { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.ew-course { margin: 0; font-size: 14px; font-weight: 600; color: var(--pc-muted); }
.ew-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ew-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 51, 102, 0.06); font-size: 12px; font-weight: 700; }
.ew-tear { position: relative; border-top: 2px dashed var(--pc-line); }
.ew-tear::before, .ew-tear::after { content: ''; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--pc-cream); border: 1px solid var(--pc-line); }
.ew-tear::before { left: -11px; }
.ew-tear::after { right: -11px; }
.ew-ticket-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px 16px; }
.ew-seats { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.ew-seats.low { color: #92400e; }
.ew-seats.full { color: #9f1239; }
.ew-empty { padding: 20px; background: #fff; border: 1px dashed var(--pc-line); border-radius: 16px; color: var(--pc-muted); font-weight: 600; }

/* Botones */
.ew-link-btn { display: flex; align-items: center; justify-content: center; min-height: 48px; color: var(--pc-muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.ew-link-btn:hover { color: var(--pc-ink); }

/* Reservar: hoja inferior en el móvil */
.ew-dim { position: fixed; inset: 0; z-index: 1050; background: rgba(0, 30, 60, 0.58); }
.ew-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1060; max-height: 92vh; overflow-y: auto; padding: 12px 20px 24px; background: #fff; border-radius: 24px 24px 0 0; }
.ew-grab { width: 44px; height: 5px; margin: 0 auto 4px; border-radius: 3px; background: var(--pc-line); }
.ew-sheet .ew-step-head { padding-top: 12px; }
.ew-check-row { display: flex; align-items: center; gap: 14px; min-height: 60px; margin: 0 0 6px; padding: 0 14px; border: 1.5px solid var(--pc-cyan); border-radius: 14px; background: rgba(0, 188, 212, 0.06); font-size: 15px; font-weight: 700; cursor: pointer; }
.ew-check { flex: none; width: 28px; height: 28px; margin: 0; accent-color: #00838f; cursor: pointer; }
.ew-normative { margin: 0 0 10px; }
.ew-normative summary { display: flex; align-items: center; justify-content: center; min-height: 44px; color: var(--pc-muted); font-size: 13px; font-weight: 700; text-decoration: underline; cursor: pointer; list-style: none; }
.ew-normative summary::-webkit-details-marker { display: none; }
.ew-normative-text { max-height: 40vh; overflow-y: auto; padding: 12px 14px; background: var(--pc-cream); border-radius: 12px; font-size: 13px; line-height: 1.5; }

@media (min-width: 768px) {
  .ew { padding: 0; }
  .ew-amount { font-size: 34px; }
  .ew-compact .ew-amount { font-size: 26px; }
  .ew-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .ew-tiles.list { grid-template-columns: minmax(0, 1fr); }
  .ew-tile { min-height: 136px; }
  /* Reservar es un diálogo centrado, no una hoja inferior */
  .ew-sheet { left: 50%; top: 50%; right: auto; bottom: auto; width: 520px; max-width: calc(100vw - 32px); padding: 20px 24px 24px; transform: translate(-50%, -50%); border-radius: 24px; }
  .ew-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
  .ew-actions .pc-cta { order: 2; }
}

@media (min-width: 992px) {
  /* Aire debajo del último botón. Por debajo de 992px lo da la barra inferior
     del móvil; aquí no había nada y "Enviar mi pago" quedaba pegado al borde. */
  .ew { padding-bottom: 48px; }
  .ew-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .ew-main { margin: 0; max-width: none; }
  .ew-route { max-width: 560px; }
  .ew-tickets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* "Tu reserva": se va llenando a medida que se elige */
  .ew-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 20px; background: #fff; border: 1px solid var(--pc-line); border-radius: 20px; }
  .ew-aside-title { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--pc-ink); }
  .ew-slot { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; border: 1.5px dashed var(--pc-line); border-radius: 14px; color: var(--pc-muted); font-size: 14px; font-weight: 700; }
  .ew-slot.full { border-style: solid; border-color: transparent; background: var(--pc-cream); color: var(--pc-ink); }
  .ew-slot small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pc-muted); }
}

/* ============================================================
   Pagar: 1) datos para pagar, 2) comprobante
   En móvil se ve una parte a la vez (.step-pay / .step-report);
   en pantallas anchas van juntas, en dos columnas.
   ============================================================ */
.ew-pay { max-width: 640px; margin: 0 auto; }
.ew-substep { margin: 0 0 14px; text-align: center; font-size: 13px; font-weight: 600; color: var(--pc-muted); }
.ew-substep b { color: var(--pc-ink); font-weight: 800; }
.ew-pay.step-pay .ew-pay-report, .ew-pay.step-report .ew-pay-data { display: none; }
.ew-back { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 4px; color: var(--pc-muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.ew-back:hover { color: var(--pc-ink); }

.ew-card { margin: 0 0 14px; padding: 16px; background: #fff; border: 1px solid var(--pc-line); border-radius: 18px; }
.ew-card h3 { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pc-muted); }
.ew-card .pc-course-summary { margin: 0 0 14px; }
.ew-amount { margin: 2px 0 0; font-size: 28px; white-space: nowrap; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ew-compact .ew-amount { font-size: 24px; }
.ew-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ew-copy { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--pc-line); border-radius: 12px; background: #fff; color: var(--pc-ink); font: 700 13px 'Montserrat', system-ui, sans-serif; cursor: pointer; }
.ew-copy:hover { border-color: var(--pc-cyan); }
.ew-copy:focus-visible { outline: 3px solid rgba(0, 188, 212, 0.45); outline-offset: 2px; }

.ew-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ew-methods .ew-tile { min-height: 84px; }
.ew-tile.on { border-color: var(--pc-cyan); background: rgba(0, 188, 212, 0.07); box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.16); }

.ew-kv-list { margin: 0; }
.ew-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--pc-line-soft); }
.ew-kv:first-child { border-top: 0; }
.ew-kv dt { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pc-muted); }
.ew-kv dd { margin: 2px 0 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }

.ew-fold, .ew-more { margin: 0 0 14px; }
.ew-fold { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 14px; color: #78350f; }
.ew-fold summary, .ew-more summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; }
.ew-fold summary::-webkit-details-marker, .ew-more summary::-webkit-details-marker { display: none; }
.ew-fold-arrow { margin-left: auto; transition: transform 0.15s; }
details[open] > summary .ew-fold-arrow { transform: rotate(180deg); }
.ew-fold-title { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 16px 6px; font-size: 14px; font-weight: 700; }
.ew-fold-body { padding: 0 16px 14px; font-size: 14px; line-height: 1.5; }
.ew-more summary { min-height: 44px; padding: 0; color: var(--pc-muted); font-size: 13px; }

.ew-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 14px; padding: 24px 16px; border: 2px dashed rgba(0, 131, 143, 0.55); border-radius: 16px; background: rgba(0, 188, 212, 0.05); text-align: center; font-size: 15px; font-weight: 700; }
.ew-drop:focus-within { outline: 3px solid rgba(0, 188, 212, 0.45); outline-offset: 2px; }
.ew-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ew-drop .pc-badge-ic { background: #fff; color: #00838f; overflow: hidden; }
.ew-drop .pc-badge-ic img { width: 100%; height: 100%; object-fit: cover; }
.ew-drop .pc-badge-ic img:not([hidden]) + i { display: none; }
.ew-drop small { font-size: 12px; font-weight: 600; color: var(--pc-muted); overflow-wrap: anywhere; }

.ew-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.ew-field > label { font-size: 13px; font-weight: 700; }
.ew-input { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; background: #fff; border: 1.5px solid var(--pc-line); border-radius: 12px; }
.ew-input:focus-within { border-color: var(--pc-cyan); box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.16); }
.ew-input i { flex: none; color: var(--pc-muted); }
.ew-input input, .ew-input select { flex: 1; min-width: 0; height: 48px; padding: 0; border: 0; background: transparent; color: var(--pc-ink); font: 600 15px 'Montserrat', system-ui, sans-serif; outline: 0; }
.ew-input input::placeholder { color: var(--pc-muted); font-weight: 500; }
.ew-input textarea { flex: 1; min-width: 0; padding: 12px 0; border: 0; background: transparent; color: var(--pc-ink); font: 600 15px 'Montserrat', system-ui, sans-serif; outline: 0; resize: vertical; }
.ew-input select.ew-doc-type { flex: 0 0 76px; }
.ew-field > small { font-size: 12px; font-weight: 600; color: var(--pc-muted); }

.ew-sticky { position: sticky; bottom: 0; z-index: 2; padding: 14px 0 16px; background: linear-gradient(180deg, rgba(243, 244, 246, 0), var(--pc-cream) 30%); }
.ew-pay.step-report .ew-only-step-pay { display: none; }

@media (min-width: 992px) {
  .ew-pay { max-width: 1080px; }
  .ew-pay .ew-route { max-width: 560px; margin: 0; }
  .ew-substep, .ew-back, .ew-compact, .ew-only-step-pay { display: none; }
  .ew-pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; margin-top: 20px; }
  .ew-pay.step-pay .ew-pay-report, .ew-pay.step-report .ew-pay-data { display: block; }
  .ew-sticky { position: static; padding: 0; background: none; }
}

/* ============================================================
   En revisión / Listo (PaymentReports#show)
   ============================================================ */
.ew-status { max-width: 560px; margin: 0 auto; }
.ew-hero { display: grid; place-items: center; width: 104px; height: 104px; margin: 32px auto 18px; border-radius: 50%; font-size: 44px; }
.ew-hero.wait { background: #fef3c7; color: #92400e; box-shadow: 0 0 0 10px rgba(245, 158, 11, 0.14); }
.ew-hero.ok { background: #d1fae5; color: #047857; box-shadow: 0 0 0 10px rgba(5, 150, 105, 0.12); }
.ew-hero.bad { background: #ffe4e6; color: #9f1239; box-shadow: 0 0 0 10px rgba(225, 29, 72, 0.1); }
.ew-center { padding: 0 12px; text-align: center; }
.ew-center h1 { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--pc-ink); }
.ew-center p { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--pc-muted); }
.ew-actions-stack { margin-top: 24px; }
.ew-status .ew-card .pc-course-summary { margin: 0; }

/* Los cuadros de ícono de las fichas del wizard son un poco más grandes. */
.ew-tile .pc-badge-ic { --pc-badge-size: 52px; font-size: 26px; }
