/*
 * Estilos comunes de los formularios de Aurens (contacto y "Solicitar asesoramiento").
 * Se cargan en la librería aurens-forms, que usan contact-page y floating-asesoramiento.
 * Los formularios llevan la clase .aurens-form en el <form>.
 */

/* Campos: fondo y borde del diseño (Textfield 40 px, Selec 44 px). */
.aurens-form .form-label,
.aurens-form label.form-label,
.aurens-form .js-form-type-textfield > label,
.aurens-form .js-form-type-email > label,
.aurens-form .js-form-type-select > label,
.aurens-form .js-form-type-textarea > label {
  font-family: Inter, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: #3c3c3b;
  margin-bottom: 4px;
}

.aurens-form .form-control,
.aurens-form .form-select {
  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #3c3c3b;
  background-color: #f9fafb;
  border: 1px solid #e7e7e7;
  border-radius: 4px;
  padding: 8px;
  height: 40px;
}

.aurens-form .form-select {
  height: 44px;
  padding: 8px 16px 8px 8px;
}

.aurens-form textarea.form-control {
  height: 112px;
  min-height: 112px;
  resize: vertical;
}

/* Teléfono con selector de prefijo (intl-tel-input, separateDialCode).
   El desplegable mantiene el aspecto del campo: 40 px, fondo y borde del diseño. */
.aurens-form .iti {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

/* El mensaje de error de Teléfono va dentro de .iti: debajo del campo, no a la derecha. */
.aurens-form .iti .form-item--error-message {
  order: 3;
  flex: 0 0 100%;
  margin-top: 0.25rem;
}

.aurens-form .iti__tel-input {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  height: 40px;
  padding-left: 8px;
  border-radius: 0 4px 4px 0;
}

.aurens-form .iti__selected-flag {
  height: 40px;
  padding: 0 8px;
  background-color: #f9fafb;
  border: 1px solid #e7e7e7;
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.aurens-form .iti__selected-dial-code {
  color: #0075df;
  font-size: 16px;
  font-family: Inter, sans-serif;
}

.aurens-form .iti__country-list {
  z-index: 1060;
}

/* Sin banderas: solo el prefijo (+34) y la flecha, tanto en el campo como en la lista. */
.aurens-form .iti__flag {
  display: none !important;
}

.aurens-form .iti__selected-flag {
  padding: 0 12px 0 8px;
}

.aurens-form .iti__country {
  padding-left: 12px;
}

/* Checkboxes: cuadro de 40 x 40, radio 4 px, check azul (Figma).
   Alineados con los inputs (sin márgenes negativos), texto centrado en vertical
   y mensaje de error en una línea propia debajo del checkbox. */
/* Bootstrap añade padding-left a .form-check (1.5em) y .form-switch (2.5em) para
   dejar sitio al input con margen negativo. Aquí el input va en flujo normal, así
   que se quita ese padding y la separación la dan solo el row/col del grid. */
.aurens-form .form-check,
.aurens-form .form-switch {
  padding-left: 0;
}

.aurens-form .form-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 40px;
  margin-bottom: 0;
}

.aurens-form .form-switch .form-check-input {
  float: none;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 1px solid #e7e7e7;
  border-radius: 4px;
  background-color: #f9fafb;
  background-image: none;
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: none;
}

.aurens-form .form-switch .form-check-input:checked {
  background-color: #0075df;
  border-color: #0075df;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3e%3cpath fill='%23fff' d='M31.2199 12.1597C31.0649 12.0035 30.8806 11.8795 30.6775 11.7948C30.4744 11.7102 30.2566 11.6667 30.0365 11.6667C29.8165 11.6667 29.5987 11.7102 29.3956 11.7948C29.1925 11.8795 29.0081 12.0035 28.8532 12.1597L16.4365 24.593L11.2199 19.3597C11.059 19.2043 10.8691 19.0821 10.661 19.0001C10.4529 18.9181 10.2307 18.8778 10.0071 18.8817C9.78344 18.8856 9.56276 18.9335 9.35763 19.0226C9.1525 19.1118 8.96693 19.2405 8.81154 19.4013C8.65614 19.5622 8.53395 19.7521 8.45194 19.9602C8.36994 20.1683 8.32972 20.3905 8.33359 20.6141C8.33746 20.8378 8.38534 21.0584 8.47449 21.2636C8.56365 21.4687 8.69233 21.6543 8.8532 21.8097L15.2532 28.2097C15.4081 28.3659 15.5925 28.4899 15.7956 28.5745C15.9987 28.6591 16.2165 28.7027 16.4365 28.7027C16.6566 28.7027 16.8744 28.6591 17.0775 28.5745C17.2806 28.4899 17.4649 28.3659 17.6199 28.2097L31.2199 14.6097C31.389 14.4536 31.5241 14.2642 31.6164 14.0533C31.7087 13.8425 31.7564 13.6148 31.7564 13.3847C31.7564 13.1545 31.7087 12.9268 31.6164 12.716C31.5241 12.5052 31.389 12.3157 31.2199 12.1597Z'/%3e%3c/svg%3e");
}

.aurens-form .form-switch .form-check-label {
  flex: 1 1 0;
  min-width: 0;
  margin-left: 8px;
  font-size: 16px;
  line-height: 20px;
  color: #3c3c3b;
}

.aurens-form .form-switch .form-check-label a {
  color: #0075df;
  font-weight: 700;
}

/* "Leer más" / "Leer menos" de los textos de tratamiento de datos (Figma: azul, bold). */
.aurens-form .traslado-leer-mas .toggle-texto {
  color: #0075df;
  text-decoration: none;
}

.aurens-form .traslado-leer-mas .toggle-texto strong {
  color: #0075df;
  font-weight: 700;
}

.aurens-form .traslado-leer-mas p {
  margin: 0;
}

/* El texto completo va oculto hasta pulsar "Leer más" (el style inline del markup no se conserva). */
.aurens-form .traslado-leer-mas .texto-completo {
  display: none;
}

/* Error del checkbox: debajo, alineado con el borde de la columna como el resto de campos. */
.aurens-form .form-switch .form-item--error-message {
  order: 3;
  flex: 0 0 100%;
  margin-top: 0.25rem;
}

/* Botón de envío a todo el ancho, como en el diseño. */
.aurens-form .webform-button--submit {
  width: 100%;
  height: 40px;
  min-height: 40px;
  border: 1.4px solid #0075df;
  border-radius: 4px;
  background-color: #0075df;
  color: #fff;
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 16px;
}

/* "Leer más sobre los datos de carácter personal" (Figma: flecha azul 7.85 x 13.33,
   texto Inter 700 16/20 azul, fila de 45 px con 12 px de padding vertical). */
.aurens-form .webform-element-more {
  margin: 0;
}

.aurens-form .webform-element-more--link {
  display: flex !important;
  align-items: center;
  padding: 12px 8px 12px 0;
  margin: 0;
}

.aurens-form .webform-element-more--link:before {
  content: none !important;
}

.aurens-form .webform-element-more--link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0075df;
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 20px;
  text-decoration: none;
}

.aurens-form .webform-element-more--link a::before {
  content: '';
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7.85' height='13.3333' viewBox='0 0 7.85 13.3333'%3E%3Cpath fill='%230075DF' d='M1.18333 13.3333L0 12.15L5.48333 6.66667L0 1.18333L1.18333 0L7.85 6.66667L1.18333 13.3333Z'/%3E%3C/svg%3E") no-repeat center / 7.85px 13.33px;
  transition: transform .2s ease;
}

.aurens-form .webform-element-more.is-open .webform-element-more--link a::before {
  transform: rotate(90deg);
}

/* Separación entre la fila "Leer más" y el botón Enviar: 16 px (Figma). */
.aurens-form #edit-actions {
  margin-top: 16px;
}

/* Errores de validación (copiados de Roques: formularios.css y formulario-contacto.css). */
.aurens-form input.is-invalid,
.aurens-form textarea.is-invalid,
.aurens-form select.is-invalid,
.aurens-form .form-control.is-invalid,
.aurens-form .form-select.is-invalid {
  border-color: #dc3545 !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Sin icono de error de Bootstrap dentro del campo (Roques no lo muestra);
   el select conserva su flecha. */
.aurens-form .form-control.is-invalid,
.aurens-form input.is-invalid,
.aurens-form textarea.is-invalid {
  background-image: none !important;
  padding-right: 8px !important;
}

.aurens-form .form-select.is-invalid {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  background-position: right 8px center !important;
  background-size: 16px 12px !important;
  padding-right: 32px !important;
}

.aurens-form input[type="checkbox"].is-invalid {
  border-color: #EC0F0F !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 0.2rem rgba(236, 15, 15, 0.25) !important;
}

.aurens-form .form-check input[type="checkbox"].is-invalid + label {
  color: #EC0F0F;
}

.aurens-form .form-item--error-message {
  color: #dc3545 !important;
  font-size: 0.875rem;
  font-weight: 700;
  margin-top: 0.25rem;
  margin-left: 0;
  padding: 0;
}


/* Inputs de texto (Figma): fondo #F9FAFB y borde #E7E7E7, también en estado válido
   o con foco del tema. Afecta al formulario de contacto y al modal de asesoramiento. */
.aurens-form input[type="text"],
.aurens-form input[type="email"],
.aurens-form input[type="tel"],
.aurens-form input.form-control,
.aurens-form textarea.form-control,
.aurens-form input[type="text"],
.aurens-form input[type="email"],
.aurens-form input[type="tel"],
.aurens-form input.form-control,
.aurens-form textarea.form-control {
  background-color: #F9FAFB !important;
  border-color: #E7E7E7 !important;
  background-image: none !important;
}

.aurens-form input[type="text"]:valid,
.aurens-form input[type="email"]:valid,
.aurens-form input[type="tel"]:valid,
.aurens-form input[type="text"]:valid,
.aurens-form input[type="email"]:valid,
.aurens-form input[type="tel"]:valid {
  border-color: #E7E7E7 !important;
}

/* Radios, checkboxes, labels, asteriscos y botón (formularios aurens-form: contacto, asesoramiento, presupuesto). */
/* Radios Sí / No: "No" seleccionado por defecto (Figma). */
/* Radios Sí / No: "No" seleccionado por defecto (Figma). */
.aurens-form .form-radios,
.aurens-form .js-webform-radios {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.aurens-form .js-webform-radios .form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.aurens-form .form-radios {
  gap: 32px;
}

.aurens-form legend {
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #3c3c3b;
  float: none;
  width: auto;
}

.aurens-form .form-check-input[type="radio"] {
  width: 40px;
  height: 40px;
  margin-top: 0;
  border: 1px solid #e7e7e7;
  border-radius: 50%;
  background-color: #f9fafb;
  box-shadow: none;
}

/* Radio seleccionado (Figma): aro azul fino, hueco blanco y punto azul de 24 px. */
/* Radio seleccionado (Figma): aro azul fino, hueco blanco y punto azul de 24 px. */
.aurens-form .form-check-input[type="radio"]:checked {
  background-color: #fff !important;
  background-image: radial-gradient(circle, #0075df 0 12px, transparent 12.5px) !important;
  border: 1px solid #0075df !important;
  box-shadow: none !important;
}

/* Checkboxes de 44 px, como en el diseño. */
/* Checkboxes de 44 px, como en el diseño. */
.aurens-form .form-switch .form-check-input {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}

.aurens-form .form-switch .form-check-label {
  padding-top: 12px;
}

/* Botón Enviar a todo el ancho del formulario. */
/* Botón Enviar a todo el ancho del formulario. */
.aurens-form .webform-button--submit {
  width: 100%;
}

/* Radios y checkboxes del modal con las medidas y colores de Figma, por encima de los estilos del tema. */
/* Radios y checkboxes del modal con las medidas y colores de Figma, por encima de los estilos del tema. */
.aurens-form input[type="radio"] {
  flex: 0 0 40px !important;
  width: 40px !important;
  height: 40px !important;
  border: 1px solid #E7E7E7 !important;
  background-color: #F9FAFB !important;
}

.aurens-form input[type="radio"]:checked {
  background-color: #fff !important;
  background-image: radial-gradient(circle, #0075df 0 12px, transparent 12.5px) !important;
  border-color: #0075df !important;
}

.aurens-form input[type="checkbox"] {
  width: 44px !important;
  height: 44px !important;
  border: 1px solid #E7E7E7 !important;
  background-color: #F9FAFB !important;
}

.aurens-form input[type="checkbox"]:checked {
  background-color: #0075df !important;
  border-color: #0075df !important;
}

.aurens-form .form-check-label {
  font-family: Inter, sans-serif;
  font-size: 16px;
  line-height: 20px;
  color: #3c3c3b;
}

/* Asteriscos de obligatorio en rojo (#DE0A0A), como en Figma. */
/* Asteriscos de obligatorio en rojo (#DE0A0A), como en Figma. */
.aurens-form .form-required::after,
.aurens-form .js-form-required::after {
  color: #DE0A0A !important;
}

/* Asterisco del checkbox de protección de datos: rojo y sin salto de línea,
   para que vaya seguido del texto (tarifas, contacto y presupuesto seguro). */
.aurens-form .asesoramiento-required {
  color: #DE0A0A;
  white-space: nowrap;
}

/* Asteriscos de obligatorio: imagen del campo en rojo #DE0A0A (en el modal). */
/* Asteriscos de obligatorio: imagen del campo en rojo #DE0A0A (en el modal). */
.aurens-form .form-required::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23DE0A0A' d='M0,7.562l1.114-3.438c2.565,0.906,4.43,1.688,5.59,2.35C6.398,3.553,6.237,1.544,6.22,0.447h3.511 c-0.05,1.597-0.234,3.6-0.558,6.003c1.664-0.838,3.566-1.613,5.714-2.325L16,7.562c-2.05,0.678-4.06,1.131-6.028,1.356 c0.984,0.856,2.372,2.381,4.166,4.575l-2.906,2.059c-0.935-1.274-2.041-3.009-3.316-5.206c-1.194,2.275-2.244,4.013-3.147,5.206 l-2.856-2.059c1.872-2.307,3.211-3.832,4.017-4.575C3.849,8.516,1.872,8.062,0,7.562'/%3E%3C/svg%3E") !important;
}

