* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  scroll-behavior: smooth;
  font-family: 'Poppins', sans-serif;
}

:root {
    --color-primario: #1f87c1;     
    --color-secundario: #373f82;   
    --color-acento: #0cbcf0;       
    --color-fondo: #fbfbfc;        
    --color-texto: #a5a5c5;
}

html {
  font-size: 16px;
  overflow-x: hidden;
}

body {
  background-color: var(--color-secundario);
  color: var(--color-fondo);
}

/* Estilos del header */
.header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem 4%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.logo img {
  max-width: 170px;
  width: calc(15vw + 8px);
  cursor: pointer;
}

.group-links {
  display: flex;
  gap: 3rem;
}

.navbar {
  display: flex;
  align-items: center;
}

.navbar a {
  font-size: 19px;
  line-height: 25px;
  color: var(--color-fondo);
  margin-left: 3rem;
  transition: .3s;
}

.navbar a:hover {
  color: var(--color-acento);
}

.link-with-dropdown {
  position: relative;
}

.link-with-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown {
  position: absolute;
  top: calc(100% + 15px);
  left: 18%;
  width: auto;
  min-width: 330px;
  max-width: 1000px;
  background: var(--color-fondo); 
  /* border: 1px solid #fff; */
  box-shadow: 0 6px 18px rgba(30,40,50,0.08);
  z-index: 2000;
}

.dropdown ul {
  list-style: none;
}

.dropdown ul li {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 14px;
  color: var(--color-primario);
}

#delegations-dropdown ul li {
  gap: 0.8rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  padding-left: 1.7rem;
}

.dropdown ul li:hover {
  background: var(--color-primario);
  color: var(--color-fondo);
}

.dropdown a {
  color: inherit;
  text-decoration: none;
  display: block;
  margin-left: 0;
}

.dropdown a:hover {
  color: #fbfbfc;
}

.btn {
  background-color: var(--color-primario);
  color: var(--color-fondo);
  font-family: "Nunito", Sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 25px;
  border-radius: 10px;
  padding: 5px 25px;
  cursor: pointer;
  transition: all .3s;
}

.btn:hover {
  background-color: #1b79ad;
}

#menu-icon {
  font-size: 3.6rem;
  color: var(--color-fondo);
  display: none;
}

.content {
  min-height: 100vh;
  padding: 50px 90px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 70px;
}

.hero {
  width: 80%;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 10px;
}

.hero p {
  font-family: "Nunito", Sans-serif;
  line-height: 1.7;
  font-size: 18px;
}

.register-form {
  width: 100%;
  background-color: var(--color-fondo);
  color: var(--color-secundario);
  border-radius: 10px;
  display: flex;
}

.left-side {
  width: 100%;
  padding: 40px;
}

.left-side .form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, auto);
  grid-template-areas: 
    "input1 input2"
    "input3 input4"
    "input5 input6"
    "arch-id arch-doc"
    "button button";
  gap: 20px;

}

input,
.form button,
select {
  width: 100%;
  height: 56px;
  border: 0;
  font-size: 16px;

  background: transparent;
  outline: none;
}

.textbox {
  position: relative;
  margin-bottom: 16px;
}

.textbox:first-of-type {
  grid-area: input1;
}

.textbox:nth-child(2) {
  grid-area: input2;
}

.textbox:nth-child(3) {
  grid-area: input3;
}

.textbox:nth-child(4) {
  grid-area: input4;
}

.textbox:nth-child(5) {
  grid-area: input5;
}

.textbox:last-of-type {
  grid-area: input6;
} 

.textbox.split {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.select-container {
  width: 70px; /* Ancho fijo para el selector V/E o +58 */
  border-bottom: 2px solid rgb(31 135 193 / 5%);
  position: relative;
}

.custom-select {
  min-width: 70px;
  background: transparent;
  color: rgb(31 135 193 / 96%);
  font-family: inherit;
  cursor: pointer;
  position: relative;
  line-height: 1.2;
}

.custom-select .selected {
  padding: 25px 0 25px 10px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-select .arrow {
  transition: transform 0.3s ease;
  font-size: 20px;
}

.custom-select.open .arrow {
  transform: rotate(180deg);
}

.custom-select .options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fbfbfc;
  border: 1px solid rgb(31 135 193 / 25%);
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.custom-select.open .options {
  display: block;
  height: auto;
}

.custom-select .options li {
  padding: 10px 12px;
  cursor: pointer;
  text-align: start;
}

.custom-select .options li:hover {
  background: rgb(31 135 193 / 15%); /* hover color ligero */
  color: rgb(31 135 193 / 100%);
}

/* Ocultamos el <select> original si aparece */
.prefix-select {
  display: none;
}

.input-container {
  flex-grow: 1;
  position: relative;
}

.textbox > span,
.input-container > span {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  font-size: 22px;
  pointer-events: none;
  color: rgb(31 135 193 / 40%);
}

.textbox > span,
.input-container > span {
  left: 0;
}

.textbox input {
  padding: 0 24px 0 36px;
  border-bottom: 2px solid rgb(31 135 193 / 5%);
  color: rgb(31 135 193 / 96%);
  height: 72px;
  transition: 0.3s;
}

:is(input:focus, input:valid, .has-value) ~ label {
  translate: -40px -40px;
  scale: 0.875;
}

input:focus ~ label {
  color: rgb(31 135 193 / 40%);
}

input:focus {
  border-color: rgb(31 135 193 / 76%);
}

:is(input:focus, input:valid) ~ span {
  color: rgb(31 135 193 / 76%);
}

/* Si la cedula, telefono o correo no es válido y el usuario no está escribiendo en él, lo marcamos en rojo */
input[type="email"]:not(:focus):not(:placeholder-shown):invalid, 
input[type="number"]:not(:focus):not(:placeholder-shown):invalid,
input[type="tel"]:not(:focus):not(:placeholder-shown):invalid {
  border-bottom-color: #ff5360;
  color: #ff5360;
}

.textbox label {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  color: rgb(31 135 193 / 40%);
  pointer-events: none;
  transition: 0.4s;
}

.textbox label,
.input-container label {
  left: 36px;
}

/* =========================================
      ESTILOS DEL DROPZONE ADAPTADOS
========================================= */

.dropzone-area {
  position: relative;
  padding: 16px;
  margin-bottom: 16px;
  border: 2px dashed rgb(31 135 193 / 40%);
  border-radius: 12px;
  background: rgb(31 135 193 / 5%);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.dropzone-area:hover, 
.dropzone-area.dropzone--over {
  border-color: var(--color-primary);
  background: rgb(12 188 240 / 10%); /* Un fondo azul más notorio */
}

.dropzone-area:first-of-type {
  grid-area: arch-id;
}

.dropzone-area:last-of-type {
  grid-area: arch-doc;
}

/* UX: Feedback visual cuando se cargó correctamente el archivo */
.dropzone-area.has-file {
  border-color: #28a745; 
  background: rgba(40, 167, 69, 0.05);
}

.dropzone-area.has-file .icon {
  color: #28a745;
}

/* Ocultamos el input pero lo dejamos clickeable sobre toda el área */
.dropzone-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.dropzone-area .icon {
  font-size: 36px;
  color: rgb(31 135 193 / 60%);
  pointer-events: none; /* Evita que el ícono bloquee el click al input */
  transition: color 0.3s ease;
}

.dropzone-area .file-info {
  font-size: 15px;
  line-height: 1.4;
  color: rgb(31 135 193 / 80%);
  margin-top: -4px;
  pointer-events: none;
  margin: 0;
}

/* Estilos base actualizados para el botón */
.form > button {
  grid-area: button;
  position: relative; /* Necesario para el span absoluto */
  overflow: hidden;   /* Oculta el ícono antes de la animación */
  cursor: pointer;
  padding: 0 24px;
  background-color: var(--color-acento) !important;
  color: var(--color-fondo);
  border: 0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center; /* Centramos el contenido inicialmente */
  transition: 0.3s;
}

/* --- INTEGRACIÓN DE TUS ESTILOS --- */

.form > button .button-text,
.form > button .button-icon {
  transition: 0.3s;
  margin: 0; /* Evita desfases por márgenes por defecto */
}

.form > button .button-text {
  font-weight: 500;
}

.form > button .button-icon {
  position: absolute;
  top: 50%; /* Ajustado a 50% para centrado perfecto */
  left: 56%;
  translate: 10px -50%;
  opacity: 0;
  font-size: 22px;
}

.form > button:hover {
  background: #15a1cd; /* Un tono ligeramente distinto al original #0CBCF0 */
}

/* Al pasar el mouse, el texto se mueve a la izquierda */
.form > button:hover .button-text {
  translate: -15px 0;
}

/* Al pasar el mouse, el ícono aparece y se desliza a la derecha */
.form > button:hover .button-icon {
  opacity: 1;
  translate: 45px -50%; /* Ajustado para que no choque con el texto */
}

/* Mantenemos el estilo de deshabilitado que ya tenías */
.form > button:disabled {
  background: #d3d3e3 !important;
  color: #a5a5a5 !important;
  cursor: not-allowed;
}

.form > button:disabled .button-text, 
.form > button:disabled .button-icon {
  translate: 0 0 !important; /* Evita que la animación ocurra si está bloqueado */
}

.form > button:disabled .button-icon {
  opacity: 0;
}

.right-side {
  width: 33%;
  padding: 20px;
  background-color: var(--color-primario);
  color: var(--color-fondo);
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.right-side h3 {
  margin-bottom: 10px;
}

.right-side p {
  font-family: "Nunito", Sans-serif;
}

/* Media queries */
@media (max-width: 991px) {
  .header {
    padding: 18px 3%;
  }
}

@media (max-width: 768px) {
  #menu-icon {
    display: block;
    font-size: 32px;
  }

  .logo img {
    width: 140px
  }

  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-fondo);
    border-top: .1rem solid rgba(0, 0, 0, .2);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
    
    
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height .36s cubic-bezier(.2,.9,.2,1),
                opacity .24s ease,
                transform .28s ease;
    display: flex;
    flex-direction: column;
  }

  .navbar.active {
    height: auto;
    max-height: 598.31px;
    opacity: 1;
    transform: translateY(0);
    padding: 0;
  }

  .navbar.active a,
  .link-with-dropdown {
    width: 100%;
  }

  .navbar a {
    display: block;
    font-size: 18px;
    color: var(--color-primario);
    padding: 15px 20px;
    margin: 0;
  }

  .navbar a:hover {
    background-color: var(--color-primario);
    color: var(--color-fondo);
  }

  .navbar .link-with-dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  /* Hacer que el dropdown quede dentro del flujo (no absoluto) */
  .navbar .link-with-dropdown .dropdown {
    position: static;
    width: 100%;
    background: transparent;
    box-shadow: none;
    z-index: 1;
  }

  #delegations-dropdown ul li {
    padding: 0.1rem 1.7rem;
  }

  /* Asegurar que elementos con atributo hidden sigan ocultos */
  .navbar .link-with-dropdown .dropdown[hidden] {
    display: none !important;
  }
  
  .content {
    padding: 120px 30px 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 50px;
  }

  .hero {
    width: 100%;
    padding: 0;
    text-align: center;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p {
    font-size: 16px;
  }

  .register-form {
    flex-direction: column;
    align-items: center;
  }

  .left-side {
    padding: 35px;
  }

  .left-side .form {    
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .dropzone-area:last-of-type {
    margin-bottom: 20px;
  } 

  .right-side {
    width: 100%;
    border-radius: 0 0 10px 10px;
  }
}

/* Sobrescribir los estilos de autocompletado del navegador */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--color-fondo) inset !important;
    -webkit-text-fill-color: var(--color-primario) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
