/* ============================================================
   ESTILOS ADICIONALES PARA AUTH / TICKETS / INSCRIPCION
   Se carga junto con styles.css en el AppAsset.
   ============================================================ */

/* ============== CONSULTA CEDULA (Hacienda) ============== */
.field-help {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: #64748B;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
}
.field-input-wrap {
  position: relative;
  width: 100%;
}
.field-input-wrap input {
  width: 100%;
  box-sizing: border-box;
}
.cedula-status {
  display: block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: #F1F5F9;
  color: #1B2A4E;
  border: 1px solid #CBD5E1;
  min-height: 18px;
  transition: background .2s, color .2s, border-color .2s;
}
.cedula-status:empty {
  display: none;
}
.cedula-status--loading {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FCD34D;
}
.cedula-status--ok {
  background: #D1FAE5;
  color: #065F46;
  border-color: #10B981;
}
.cedula-status--error {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #FCA5A5;
}

/* ============================================================
   MODAL DE AFILIACION
   El formulario inline #inscripcion se mueve dinamicamente aqui.
   ============================================================ */
.modal-afiliarme {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  animation: modalAfiliarmeFadeIn .3s ease;
}
.modal-afiliarme[hidden] { display: none !important; }
@keyframes modalAfiliarmeFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-afiliarme__backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0, 88, 181, 0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 152, 74, 0.4) 0%, transparent 55%),
    rgba(6, 16, 31, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}
.modal-afiliarme__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97) 0%, rgba(244, 247, 251, 0.95) 100%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45), 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 28px 32px 36px;
  margin: auto;
  animation: modalAfiliarmePop .35s cubic-bezier(.22,1,.36,1);
}
@keyframes modalAfiliarmePop {
  from { opacity: 0; transform: translateY(-12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.modal-afiliarme__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  color: var(--c-ink, #06101F);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  z-index: 2;
}
.modal-afiliarme__close:hover {
  background: rgba(240, 68, 56, 0.15);
  color: #B91C1C;
  transform: rotate(90deg);
}
.modal-afiliarme__close svg { width: 20px; height: 20px; }
.modal-afiliarme__header {
  text-align: center;
  margin-bottom: 22px;
  padding-right: 36px;
}
.modal-afiliarme__header h2 {
  margin: 8px 0 6px;
  font-size: 30px;
  color: var(--c-ink, #06101F);
}
.modal-afiliarme__header p {
  color: rgba(6, 16, 31, 0.65);
  font-size: 15px;
  margin: 0;
}
.modal-afiliarme__body {
  /* El formulario tiene su propio contenedor con padding */
}
/* Cuando el formulario esta dentro del modal, ajustamos visual */
.modal-afiliarme .formulario-wrap {
  max-width: 100%;
  margin: 0;
}
.modal-afiliarme .formulario-3d {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 0;
}
.modal-afiliarme .formulario-3d::before,
.modal-afiliarme .formulario-3d::after,
.modal-afiliarme .formulario-3d-halo {
  display: none !important;
}

/* Cuando el modal esta abierto, ocultamos el formulario inline original */
body.modal-afiliarme-open { overflow: hidden; }

@media (max-width: 720px) {
  .modal-afiliarme { padding: 20px 8px; }
  .modal-afiliarme__panel { padding: 20px 16px 24px; }
  .modal-afiliarme__header h2 { font-size: 22px; }
}

/* ============================================================
   MODAL DE GRACIAS (post-envio)
   ============================================================ */
.modal-gracias { z-index: 10000; }
.modal-gracias__panel {
  max-width: 560px;
  text-align: center;
  padding: 40px 36px 32px;
}
.modal-gracias__icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
  animation: graciasIconPop .55s cubic-bezier(.22,1,.36,1);
}
.modal-gracias__icon svg { width: 100%; height: 100%; }
@keyframes graciasIconPop {
  0%   { opacity: 0; transform: scale(.4) rotate(-20deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(8deg); }
  100% { opacity: 1; transform: scale(1)    rotate(0);    }
}
.modal-gracias__title {
  font-size: 38px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--c-ink, #06101F);
  letter-spacing: -0.5px;
}
.modal-gracias__lead {
  font-size: 19px;
  font-weight: 600;
  color: #047857;
  margin: 0 0 14px;
}
.modal-gracias__sub {
  font-size: 14px;
  color: rgba(6, 16, 31, 0.65);
  margin: 0 auto 24px;
  max-width: 420px;
  line-height: 1.55;
}
.modal-gracias__btn {
  min-width: 180px;
}
@media (max-width: 720px) {
  .modal-gracias__panel { padding: 32px 20px 24px; }
  .modal-gracias__title { font-size: 28px; }
  .modal-gracias__lead { font-size: 16px; }
}

/* ============== CHECKBOX "Tengo empresa" ============== */
.check-empresa {
  margin-top: 14px;
  background: rgba(0, 88, 181, 0.04);
  border: 1px dashed rgba(0, 88, 181, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  transition: background .25s, border-color .25s;
  color: var(--c-ink, #06101F);
}
.check-empresa input[type="checkbox"] { margin-right: 10px; }
.check-empresa span { font-weight: 600; color: var(--c-ink, #06101F); }
.check-empresa small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: rgba(6, 16, 31, 0.6);
  margin-top: 2px;
}
.check-empresa--auto {
  background: #ECFDF3;
  border: 1px solid #12B76A;
}
.check-empresa--auto span { color: #047857; }

/* ============== Paso 2 (datos empresa) animado ============== */
.form-step-empresa[hidden] {
  display: none !important;
}
.form-step-empresa.is-visible {
  animation: stepFadeIn .35s ease;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ============== Campos auto-completados (Hacienda) ============== */
input.is-autofilled {
  background: rgba(18, 183, 106, 0.08);
  border-color: rgba(18, 183, 106, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(18, 183, 106, 0.25) inset;
  transition: background .25s, border-color .25s, box-shadow .25s;
}
input.is-edited-manual {
  background: rgba(255, 217, 102, 0.08);
  border-color: rgba(255, 217, 102, 0.6) !important;
}
.field-hint-after {
  display: none;
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #047857;
  background: #ECFDF3;
  border-left: 3px solid #12B76A;
  border-radius: 4px;
}
.field-hint-after.is-visible {
  display: inline-block;
  animation: hintFadeIn .25s ease;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ============== Chips de actividades sugeridas ============== */
.actividades-sugeridas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}
.actividades-sugeridas__title {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chip-actividad {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #1E293B;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s, color .2s;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}
.chip-actividad:hover {
  background: #ECFDF3;
  border-color: #10B981;
  color: #047857;
  transform: translateY(-1px);
}

/* ============================================================
   SELECTORES DE DIRECCION (Provincia / Canton / Distrito)
   ============================================================ */
.direccion-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.direccion-grid__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--c-ink, #06101F);
  margin-bottom: 4px;
}
.direccion-selects {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px) {
  .direccion-selects { grid-template-columns: 1fr; }
}
/* Hereda el mismo look que .field input: fondo blanco, texto oscuro */
.direccion-select {
  width: 100%;
  font-family: inherit;
  font-size: 17px;
  padding: 16px 40px 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 61, 111, 0.14);
  background-color: #fff;
  color: var(--c-ink, #06101F);
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease;
  background-image: linear-gradient(45deg, transparent 50%, #06101F 50%),
                    linear-gradient(135deg, #06101F 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.direccion-select:focus,
.direccion-select:hover {
  border-color: #12B76A;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.18);
}
.direccion-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #F1F5F9;
}
.direccion-select option {
  color: #06101F;
  background: #fff;
  padding: 8px;
}
/* Cuando el select tiene un valor seleccionado: solo borde verde, fondo y texto sin cambios */
.direccion-select.has-value {
  border-color: #12B76A;
}
.direccion-extra {
  width: 100%;
  margin-top: 4px;
}

/* ============================================================
   FLUJO GUIADO PASO A PASO (formulario inscripcion)
   - is-next      = solo borde verde sutil indicando el campo actual
   - is-completed = sin estilo especial (vuelve a la apariencia normal)
   - is-locked    = sin estilo especial visualmente
     => El texto y los colores NO cambian, solo el borde del campo activo.
   ============================================================ */

/* Solo borde verde en el campo actual (input, textarea o select) */
.field.is-next > input,
.field.is-next > .field-input-wrap > input,
.field.is-next > select,
.field.is-next > textarea {
  border-color: #12B76A !important;
  box-shadow: 0 0 0 2px rgba(18, 183, 106, 0.22);
  transition: border-color .2s, box-shadow .2s;
}
.check.is-next {
  border-color: rgba(18, 183, 106, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(18, 183, 106, 0.22);
}

/* Bloque de direccion (3 selects) en estado "next" */
.direccion-grid.is-next .direccion-select {
  border-color: #12B76A !important;
  box-shadow: 0 0 0 2px rgba(18, 183, 106, 0.18);
}

/* ============== ERROR DE ENVIO INSCRIPCION ============== */
.form-enviar-error {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  font-size: 14px;
}
.form-enviar-error ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.form-enviar-error strong {
  display: block;
  margin-bottom: 4px;
}

/* ============== FLASH MESSAGES ============== */
.flash-banner {
  max-width: 1200px;
  margin: 90px auto 0;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.flash-success, .flash-flash-success { background: #D1FADF; color: #054F31; border-left: 4px solid #12B76A; }
.flash-error,   .flash-flash-error   { background: #FEE4E2; color: #7A271A; border-left: 4px solid #F04438; }
.flash-warning, .flash-flash-warning { background: #FEF0C7; color: #93370D; border-left: 4px solid #F79009; }
.flash-info,    .flash-flash-info    { background: #DBEAFE; color: #1E40AF; border-left: 4px solid #2563EB; }

/* ============== AUTH (login/registro) ============== */
body.auth-body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: #001a35;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
}
.auth-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(2px) saturate(110%);
}
.auth-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0, 26, 53, 0.92), rgba(0, 61, 111, 0.85));
}
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.auth-logo { margin-bottom: 22px; }
.auth-logo img { height: 75px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }

.auth-card {
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 18px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
  padding: 40px;
  backdrop-filter: blur(20px);
}
.auth-header { text-align: center; margin-bottom: 26px; }
.auth-header h1 {
  margin: 0 0 8px;
  font-size: 26px;
  color: #003D6F;
  font-weight: 800;
}
.auth-header p { color: #475569; font-size: 15px; margin: 0; }

.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; font-weight: 600; font-size: 14px; color: #1B2A4E; margin-bottom: 6px; }
.auth-form .form-control,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 15px;
  background: #F9FAFB;
  box-sizing: border-box;
  font-family: inherit;
  transition: border .15s, box-shadow .15s;
}
.auth-form input:focus {
  outline: none;
  border-color: #0066A6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 102, 166, 0.15);
}
.auth-form .help-block,
.auth-form .invalid-feedback {
  color: #DC2626;
  font-size: 13px;
  margin-top: 5px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.auth-grid .form-group { margin-bottom: 0; }

.auth-actions { margin-top: 22px; }
.btn-block { width: 100%; justify-content: center; }
.auth-check { font-size: 14px; }
.auth-footer { text-align: center; font-size: 14px; color: #475569; margin-top: 18px; }
.auth-footer a { color: #003D6F; font-weight: 700; text-decoration: none; }

.auth-back {
  margin-top: 20px;
  text-align: center;
}
.auth-back a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
}

@media (max-width: 560px) {
  .auth-card { padding: 28px 22px; border-radius: 14px; }
  .auth-grid { grid-template-columns: 1fr; }
}

/* ============== PAGES (tickets, inscripcion) ============== */
.section-page {
  padding-top: 120px !important;
  padding-bottom: 80px !important;
  min-height: 70vh;
  background: linear-gradient(180deg, #f8fafc 0%, #eef4fa 100%);
}
.container-narrow { max-width: 980px; margin: 0 auto; padding: 0 22px; }
.text-center { text-align: center; }
.back-link {
  display: inline-block;
  color: #003D6F;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 18px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.form-card {
  background: #fff;
  border-radius: 18px;
  padding: 36px;
  box-shadow: 0 8px 40px rgba(0, 30, 70, 0.08);
}
.form-card h3 {
  margin: 28px 0 16px;
  font-size: 18px;
  color: #003D6F;
  border-bottom: 2px solid #E5E7EB;
  padding-bottom: 8px;
}
.form-card h3:first-child { margin-top: 0; }
.form-card .form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-card .form-group { margin-bottom: 16px; }
.form-card input, .form-card textarea, .form-card select {
  width: 100%; padding: 11px 14px;
  border: 1px solid #CBD5E1;
  border-radius: 9px;
  font-size: 15px;
  font-family: inherit;
  background: #F9FAFB;
  box-sizing: border-box;
}
.form-card label { font-weight: 600; font-size: 14px; color: #1B2A4E; margin-bottom: 5px; display: block; }

@media (max-width: 760px) {
  .form-card { padding: 24px 18px; }
  .form-card .form-grid { grid-template-columns: 1fr; }
}

/* ============== TICKETS (frontend) ============== */
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}
.ticket-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 20px;
  padding: 18px 22px;
  background: #fff;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #E5E7EB;
  transition: all .15s ease;
}
.ticket-row:hover {
  border-color: #0066A6;
  box-shadow: 0 8px 22px rgba(0, 102, 166, 0.12);
  transform: translateY(-1px);
}
.ticket-row-code strong { display: block; color: #003D6F; font-size: 15px; }
.ticket-row-code span   { display: block; color: #6B7280; font-size: 12px; margin-top: 4px; }
.ticket-row-main h3 { margin: 0 0 4px; font-size: 16px; color: #111827; }
.ticket-row-main p  { margin: 0; color: #6B7280; font-size: 14px; line-height: 1.4; }
.ticket-row-meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge-success   { background: #D1FADF; color: #054F31; }
.badge-info      { background: #DBEAFE; color: #1E40AF; }
.badge-warning   { background: #FEF0C7; color: #93370D; }
.badge-primary   { background: #DBEAFE; color: #1E40AF; }
.badge-danger    { background: #FEE4E2; color: #7A271A; }
.badge-secondary { background: #F3F4F6; color: #374151; }

.ticket-detail { padding: 32px; border-radius: 18px; background: #fff; }
.ticket-detail-head {
  display: flex; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; padding-bottom: 18px;
  border-bottom: 1px solid #E5E7EB; margin-bottom: 24px;
}
.ticket-code {
  display: inline-block;
  background: #003D6F;
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ticket-detail-head h1 { margin: 0; font-size: 24px; color: #111827; }
.ticket-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

.ticket-thread { display: flex; flex-direction: column; gap: 16px; margin-bottom: 30px; }
.ticket-msg {
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid #E5E7EB;
}
.ticket-msg-user { background: #F9FAFB; }
.ticket-msg-admin {
  background: #E3F2FD;
  border-color: #BBDEFB;
}
.ticket-msg header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
  color: #475569;
}
.ticket-msg-body {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.6;
  color: #1F2937;
}

.ticket-reply { padding-top: 24px; border-top: 1px solid #E5E7EB; }
.ticket-reply h3 { margin: 0 0 14px; font-size: 18px; color: #003D6F; }
.ticket-closed-note {
  padding: 16px;
  background: #F3F4F6;
  border-radius: 10px;
  text-align: center;
  color: #6B7280;
}
.ticket-closed-note a { color: #003D6F; font-weight: 600; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 30px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.empty-state h3 { color: #003D6F; margin-bottom: 10px; }
.empty-state p  { color: #6B7280; margin-bottom: 22px; }

@media (max-width: 760px) {
  .ticket-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ticket-row-meta { flex-direction: row; align-items: center; }
  .ticket-detail { padding: 20px; }
}

/* ============== NAV USER ============== */
.nav-user {
  display: none;
}
@media (min-width: 980px) {
  .nav-user { display: inline-block; }
}
