* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --rojo-principal: #e53935;
  --rojo-oscuro: #c62828;
  --rojo-claro: #fff1f0;
  --texto-principal: #222222;
  --texto-secundario: #777777;
  --borde: #dcdfe5;
  --blanco: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Poppins",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;

  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;

  background:
    linear-gradient(rgba(7, 23, 73, 0.58), rgba(70, 120, 188, 0.68)),
    url("../images/Exámenes-de-matemáticas-flotantes-con-sobresalientes.webp");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.contenedor {
  display: flex;
  flex-direction: row-reverse;
  width: 100%;
  max-width: 1350px;
  min-width: 0;
  border-radius: 20px;
  overflow: hidden;
}

.seccion-imagen {
  width: 50%;
  min-width: 0;
  min-height: 100%;
  padding: 0;

  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background-color: rgba(0, 0, 0, 0);
  color: var(--blanco);
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.seccion-imagen > img {
  display: block;
  width: 80%;
  height: auto;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center;
  align-items: center;
  justify-content: center;
}

.text-img {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  width: 100%;
  padding: 28px 20px;
  color: var(--blanco);
  font-family: "Poppins", sans-serif;
  font-size: 14px;
}

.elemento {
  flex: 1;
  min-width: 0;
}

.text-1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.text-1 > i {
  font-size: 50px;
}

.as {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
}

#numb {
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
}

.text-2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 0 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  border-right: 1px solid rgba(255, 255, 255, 0.7);
}

.t-2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  font-size: 14px;
  text-align: center;
}

.t-2 i {
  font-size: 22px;
  flex-shrink: 0;
}

#pl {
  margin: 0;
  padding: 0;
}

.te-2 {
  width: 100%;
  padding: 7px 0;

  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);

  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.pie {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.text-3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.t-3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.5;
}

.t3 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
}

.t3 i {
  font-size: 44px;
}

.seccion-formulario {
  width: 58%;
  min-width: 0;
  padding: 38px 42px;
  background: var(--blanco);
}

.encabezado-formulario {
  margin-bottom: 28px;
}

h1 {
  color: var(--texto-principal);
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.descripcion {
  color: var(--texto-secundario);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.nota-obligatorios {
  color: var(--rojo-principal);
  font-size: 12px;
}

.grilla-formulario {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px;
}

.campo {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.campo label {
  color: var(--texto-principal);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
}

.campo input,
.campo select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;

  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: 9px;
  outline: none;

  color: #333333;
  font-family: inherit;
  font-size: 12px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.campo input::placeholder {
  color: #a0a4ad;
}

.campo select {
  cursor: pointer;
}

.campo input:focus,
.campo select:focus {
  border-color: var(--rojo-principal);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

.campo input:focus-visible,
.campo select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--rojo-principal);
  outline-offset: 2px;
}

.terminos {
  display: flex;
  flex-direction: column;
  gap: 16px;

  min-width: 0;
  margin-top: 26px;
  padding: 18px;

  border: 1px solid var(--borde);
  border-radius: 10px;
}

.terminos legend {
  padding: 0 8px;
  color: var(--texto-principal);
  font-size: 14px;
  font-weight: 700;
}

.termino1,
.termino2 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.termino1 input,
.termino2 input {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--rojo-principal);
  cursor: pointer;
}

.termino1 label,
.termino2 label {
  color: #555555;
  font-size: 12px;
  line-height: 1.7;
  cursor: pointer;
}

.palabra {
  color: var(--rojo-principal);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
}

.palabra:hover {
  color: var(--rojo-oscuro);
}

button {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  padding: 12px 18px;
  border: none;
  border-radius: 9px;
  background: var(--rojo-principal);
  color: var(--blanco);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

button:hover:not(:disabled) {
  background: var(--rojo-oscuro);
  box-shadow: 0 5px 14px rgba(198, 40, 40, 0.2);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  background: #cccccc;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.8;
}

.boton-secundario {
  background: #444444;
}

.boton-secundario:hover:not(:disabled) {
  background: #222222;
}

.mensaje-formulario {
  margin-top: 15px;
  font-size: 13px;
  line-height: 1.6;
}

.ficha-inscripcion {
  margin-top: 28px;
  padding: 24px;

  border: 1px solid var(--borde);
  border-top: 4px solid var(--rojo-principal);
  border-radius: 12px;
  background: #fffafa;
}

.ficha-inscripcion[hidden] {
  display: none;
}

.ficha-inscripcion h2 {
  margin-bottom: 10px;
  color: var(--rojo-principal);
  font-size: 23px;
}

.ficha-inscripcion > p {
  color: var(--texto-secundario);
  font-size: 13px;
  line-height: 1.6;
}

.ficha-codigo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 20px 0;

  padding: 16px;
  border-radius: 8px;
  background: var(--rojo-claro);
}

.ficha-codigo span {
  color: var(--texto-secundario);
  font-size: 12px;
}

.ficha-codigo strong {
  color: var(--rojo-oscuro);
  font-size: 24px;
  overflow-wrap: anywhere;
}

#codigoBarras {
  display: block;
  width: 100%;
  max-width: 350px;
  height: auto;
  margin: 15px auto;
}

.datos-ficha {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.datos-ficha dt {
  color: var(--texto-secundario);
  font-size: 11px;
}

.datos-ficha dd {
  color: var(--texto-principal);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;

  align-items: center;
  justify-content: center;
  padding: 20px;

  background: rgba(0, 0, 0, 0.65);
}

.modal:target {
  display: flex;
}

.modal-contenido {
  position: relative;
  width: 100%;
  max-width: 750px;
  max-height: 90vh;
  padding: 30px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--blanco);
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.modal-contenido h2 {
  padding-right: 25px;
  margin-bottom: 22px;
  color: var(--rojo-principal);
  font-size: 24px;
}

.texto-privacidad p {
  margin-bottom: 16px;
  color: #444444;
  font-size: 13px;
  line-height: 1.8;
}

.cerrar {
  position: absolute;
  top: 10px;
  right: 18px;

  color: var(--rojo-principal);
  font-size: 32px;
  line-height: 1;
  text-decoration: none;
}

.cerrar:hover {
  color: var(--rojo-oscuro);
}

 /* Tablets*/
@media (max-width: 1050px) {
  body {
    padding: 20px;
    background-attachment: scroll;
  }

  .contenedor {
    max-width: 850px;
  }

  .seccion-imagen {
    width: 38%;
  }

  .seccion-imagen > img {
    height: auto;
    width: 300px;
  }

  .text-img {
    flex-direction: column;
    gap: 20px;
    padding: 25px 18px;
  }

  .text-2 {
    padding: 18px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    border-left: none;
    border-right: none;
  }

  .seccion-formulario {
    width: 62%;
    padding: 30px 25px;
  }

  .grilla-formulario {
    gap: 18px 14px;
  }
}

 /* Celulares */
@media (max-width: 700px) {
  body {
    display: block;
    min-height: 100vh;
    padding: 14px;

    background-attachment: scroll;
    background-position: center;
  }

  .contenedor {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 15px;
  } 

  .seccion-imagen {
    order: 1;
    width: 100%;
    min-height: auto;
  }

  .seccion-imagen > img {
    width: 50%;
    height: 300px;
    max-height: 320px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
  }

  .text-img {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;

    padding: 22px 15px;
  }

  .elemento {
    flex: 1;
    min-width: 0;
  }

  .text-1 {
    gap: 8px;
  }

  .text-1 > i {
    font-size: 40px;
  }
  .elemento:nth-child(1),
  .elemento:nth-child(2),
  .elemento:nth-child(3) {
    flex: 1 1 0;
    min-width: 0;
  }
  .as {
    font-size: 12px;
  }

  #numb {
    font-size: 43px;
  }

  .text-2 {
    gap: 10px;
    padding: 0 12px;

    border-top: none;
    border-bottom: none;
    border-left: 1px solid rgba(255, 255, 255, 0.7);
    border-right: 1px solid rgba(255, 255, 255, 0.7);
  }

  .t-2 {
    flex-wrap: wrap;
    font-size: 12px;
  }

  .t-2 i {
    font-size: 18px;
  }

  .te-2 {
    font-size: 13px;
  }

  .pie {
    font-size: 10px;
  }

  .text-3 {
    flex: 1 1 100%;
    gap: 5px;
  }

  .t-3 {
    gap: 4px;
  }

  .t3 {
    font-size: 17px;
  }

  .t3 i {
    font-size: 20px;
  }

  .text-3 p {
    font-size: 12px;
  }

  /* Formulario debajo de la imagen */

  .seccion-formulario {
    order: 2;
    width: 100%;
    padding: 25px 20px;
  }

  .encabezado-formulario {
    margin-bottom: 24px;
  }

  h1 {
    font-size: 25px;
  }

  .descripcion {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .grilla-formulario {
    grid-template-columns: minmax(0, 1fr);
    gap: 17px;
  }

  .campo label {
    font-size: 13px;
  }

  .campo input,
  .campo select {
    height: 47px;
    font-size: 13px;
  }

  .terminos {
    margin-top: 23px;
    padding: 15px 12px;
    gap: 15px;
  }

  .terminos legend {
    font-size: 13px;
  }

  .termino1 label,
  .termino2 label {
    font-size: 12px;
  }

  button {
    margin-top: 22px;
    min-height: 48px;
  }

  .modal {
    padding: 12px;
  }

  .modal-contenido {
    max-height: 92vh;
    padding: 25px 20px;
  }

  .modal-contenido h2 {
    font-size: 21px;
  }

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


@media (max-width: 380px) {
  body {
    padding: 8px;
  }

  .seccion-formulario {
    padding: 22px 14px;
  }

  .text-img {
    padding: 18px 10px;
    gap: 15px 8px;
  }

  .elemento {
    flex-basis: 105px;
  }

  .text-1 > i {
    font-size: 23px;
  }

  #numb {
    font-size: 36px;
  }

  .text-2 {
    padding: 0 8px;
  }

  h1 {
    font-size: 22px;
  }

  .terminos {
    padding: 13px 10px;
  }
}

@media print {
  body {
    display: block;
    padding: 0;
    background: #ffffff;
  }

  .contenedor {
    display: block;
    max-width: 100%;
    box-shadow: none;
    background: #ffffff;
  }

  .seccion-imagen,
  .encabezado-formulario,
  #formularioInscripcion,
  .boton-secundario {
    display: none !important;
  }

  .seccion-formulario {
    width: 100%;
    padding: 0;
  }

  .ficha-inscripcion {
    display: block !important;
    border: 1px solid #cccccc;
    background: #ffffff;
  }
}

/* Botón de inscripción deshabilitado */
#botonEnviar:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
  transform: none;
}

/* Botón habilitado */
#botonEnviar:not(:disabled) {
  background-color: #e53935;
  color: #ffffff;
  cursor: pointer;
  opacity: 1;
}

#botonEnviar:not(:disabled):hover {
  background-color: #c62828;
  box-shadow: 0 5px 14px rgba(198, 40, 40, 0.2);
}

.recuperar-ficha {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-family: "Poppins", sans-serif;
}

.recuperar-ficha p {
  margin: 0 0 12px;
  color: #5b6472;
  font-size: 13px;
  line-height: 1.6;
}


.boton-recuperar-ficha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid #F3C2C2;
  border-radius: 9px;
  background-color: #FCE8E8;
  color: #A52828;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.boton-recuperar-ficha:hover {
  background-color: #c62828;
  border-color: #e94a4a;
  color: #ffffff;
}

.boton-recuperar-ficha:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .recuperar-ficha {
    margin-top: 18px;
    padding-top: 16px;
  }

  .recuperar-ficha p {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .boton-recuperar-ficha {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    font-size: 14px;
  }
}
