:root {
  --color-fondo-secundario: #f9f9f9;
  --color-borde: #ddd;
  --color-acento: #e0f3ff;
  --color-placeholder: #aaa;
  --radio: 12px;
}

/* Contenedor principal */
.contacto {
  max-width: 700px;
  margin: 3rem auto 1.5rem;
  padding: 0;
  margin-bottom: 1.5rem;
  background-color: var(--color-fondo);
  border-radius: var(--radio);
  box-shadow: var(--sombra-suave);
  font-family: var(--fuente-base);
  color: var(--color-texto);
}

/* Tabs como pestañas */
.contacto .tabs {
  display: flex;
  border-bottom: 2px solid var(--color-borde);
}

.contacto .tab {
  flex: 1;
  background: none;
  border: none;
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  color: var(--color-texto);
  transition: background 0.3s ease, border-bottom 0.3s ease;
}

.contacto .tab.active {
  background: var(--color-acento);
  border-bottom: 3px solid var(--color-primario);
  color: var(--color-primario);
}

/* Formulario y tarjeta */
.contacto form {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.card {
  background: var(--color-fondo-secundario);
  border-radius: var(--radio);
  padding: 2.5rem;
  box-shadow: var(--sombra-suave);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.card h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.card p {
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  color: #555;
}

/* Etiquetas y campos */
.contacto label {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
  display: block;
}

.contacto label.required::after {
  content: " *";
  color: red;
}

.contacto input,
.contacto textarea {
  font-size: 1.1rem;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: inherit;
  width: 100%;
  color: var(--color-texto);
  transition: border 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
}

.contacto input:focus,
.contacto textarea:focus {
  border-color: var(--color-primario);
  box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.2);
  outline: none;
}

.contacto textarea {
  resize: vertical;
  min-height: 150px;
}

/* Agrupar opciones en línea */
.opciones {
  margin-bottom: 1rem;
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
}

.opciones .grupo-opciones {
  display: flex;
  flex-direction: row;
  gap: 3rem;
  max-width: 100%;
}

.opciones .grupo-opciones label {
  display: flex;
  align-items: center; 
  gap: 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  color: var(--color-texto);
  vertical-align: middle;
}

.opciones .grupo-opciones input[type="radio"],
.opciones .grupo-opciones input[type="checkbox"] {
  /* En lugar de escalar con transform, ajusta width/height */
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--color-primario);
  /* Quita transform: scale para evitar desalineación */
  transform: none;
  /* Opcional: para centrar mejor */
  flex-shrink: 0;
}

/* Centrar botón */
.boton-contenedor {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

/* Botón de envío */
.contacto button[type="submit"] {
  padding: 1rem;
  background-color: var(--color-primario);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.contacto button[type="submit"]:hover {
  background-color: var(--color-primario-hover);
}

/* Fieldset */
fieldset {
  margin-bottom: 2.5rem;
  border: none;
}

fieldset legend {
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: #444;
}

fieldset label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #555;
}

/* Animación entre formularios */
.form-section {
  display: none;
  animation: fade 0.3s ease-in-out;
}

.form-section.active {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.contador-caracteres {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
  margin-bottom: 12px;
}

.oculto {
  display: none;
}

#notificacion-flotante {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffe0e0;
  color: #a00000;
  padding: 12px 20px;
  border: 1px solid #ffaaaa;
  border-radius: 8px;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  max-width: 90%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#notificacion-flotante.exito {
  background-color: #e0ffe0;
  color: #006600;
  border-color: #aaffaa;
}

#notificacion-flotante.visible {
  opacity: 1;
  pointer-events: auto;
}

.overlay-confirmacion {
  position: fixed;
  z-index: 9999;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
}

.overlay-contenido {
  background: white;
  padding: 2em;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

.correo-grande {
  font-size: 1.4em;
  font-weight: bold;
  color: #333;
  margin: 0.8em 0;
}

.alerta {
  color: #a00;
  margin-bottom: 1em;
}

.botones button {
  margin: 0 0.5em;
  padding: 0.5em 1em;
  border: none;
  cursor: pointer;
  font-size: 1em;
}

@keyframes fade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
  .contacto {
    margin: 2rem 1rem;
    padding: 1.5rem;
  }

  .contacto form {
    padding: 1.5rem 0.5rem;
    gap: 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  .card h3 {
    font-size: 1.4rem;
  }

  .card p {
    font-size: 1rem;
  }

  .contacto input,
  .contacto textarea {
    font-size: 1rem;
    padding: 0.75rem;
  }

  .opciones .grupo-opciones {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .opciones .grupo-opciones label {
    gap: 1rem;
  }

  .opciones .grupo-opciones input[type="radio"],
  .opciones .grupo-opciones input[type="checkbox"] {
    width: 28px;
    height: 28px;
  }

  .contacto button[type="submit"] {
    width: 100%;
    font-size: 1.05rem;
  }
}