@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Lora-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Lora-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Lora-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "UnifrakturCook";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/UnifrakturCook-Bold.woff2") format("woff2");
}

:root {
  --coyote-azul: #05559c;
  --coyote-rojo: #e91f1b;
  --coyote-crema: #d1c9b6;
  --coyote-texto: #1c1c1c;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--coyote-crema) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--coyote-crema);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--coyote-azul);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

input,
select,
textarea,
button {
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Lora", Georgia, "Times New Roman", serif;
  background: #faf8f3;
  color: var(--coyote-texto);
}

.form-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--coyote-crema);
  background: #fffdfb;
  color: var(--coyote-azul);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.flag {
  display: inline-block;
  width: 1.15rem;
  height: 0.8rem;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  overflow: hidden;
  flex-shrink: 0;
}

.flag-es {
  background: linear-gradient(to bottom, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75% 100%);
}

.flag-en {
  position: relative;
  background: repeating-linear-gradient(to bottom, #b22234 0 12.5%, #fff 12.5% 25%);
}

.flag-en::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 55%;
  background: #3c3b6e;
}

.lang-btn[aria-pressed="true"] {
  background: var(--coyote-azul);
  color: #fff;
  border-color: var(--coyote-azul);
}

.form-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
  margin-bottom: 0.5rem;
  mix-blend-mode: multiply;
}

.form-header h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--coyote-azul);
  margin: 0 0 0.35rem;
}

.subtitle {
  margin: 0;
  color: var(--coyote-rojo);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.pantalla-gracias {
  text-align: center;
  padding: 2.5rem 1rem;
}

.gracias-titulo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--coyote-azul);
  margin: 0 0 0.6rem;
}

.gracias-mensaje {
  margin: 0;
  color: var(--coyote-texto);
}

.form-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--coyote-crema);
  text-align: center;
  font-size: 0.8rem;
  color: #5a5a5a;
}

.form-footer p {
  margin: 0.25rem 0;
}

.form-footer a {
  color: var(--coyote-azul);
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

.accordion-section {
  background: #fff;
  border: 1px solid var(--coyote-crema);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.accordion-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--coyote-azul);
  cursor: pointer;
}

.accordion-toggle-fijo {
  cursor: default;
}

.chevron {
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--coyote-azul);
  border-bottom: 2px solid var(--coyote-azul);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.accordion-toggle[aria-expanded="false"] .chevron {
  transform: rotate(-45deg);
}

.accordion-panel {
  padding: 0 1rem 1rem;
  display: grid;
  gap: 0.9rem;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.2s ease, opacity 0.2s ease;
}

.accordion-panel.is-collapsed {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.field.is-collapsed {
  display: none;
}

label {
  font-size: 0.9rem;
  font-weight: 500;
}

.required {
  color: var(--coyote-rojo);
}

.hint {
  font-size: 0.8rem;
  color: #6b5b52;
}

.autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 0.3rem 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--coyote-crema);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(28, 28, 28, 0.12);
}

.autocomplete-list[hidden] {
  display: none;
}

.autocomplete-list li {
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  color: var(--coyote-texto);
  cursor: pointer;
}

.autocomplete-list li:hover,
.autocomplete-list li.is-active {
  background: #f2ede3;
}

.autocomplete-list li.autocomplete-hint {
  font-size: 0.8rem;
  color: #6b5b52;
  font-style: italic;
  cursor: default;
}

.autocomplete-list li.autocomplete-hint:hover {
  background: none;
}

input:not([type="checkbox"]),
select {
  font-size: 1rem;
  padding: 0.75rem 0.7rem;
  border: 1px solid var(--coyote-crema);
  border-radius: 8px;
  background: #fffdfb;
  color: var(--coyote-texto);
  min-height: 3rem;
}

input:not([type="checkbox"]):focus,
select:focus {
  outline: 2px solid var(--coyote-azul);
  outline-offset: 1px;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--coyote-azul);
  outline-offset: 2px;
}

input.invalid,
select.invalid {
  border-color: var(--coyote-rojo);
}

.iti {
  display: block;
  width: 100%;
  min-width: 0;
}

.iti input {
  width: 100%;
}

.iti .iti__selected-country {
  border-right: 1px solid var(--coyote-crema);
}

.iti .iti__selected-dial-code {
  margin-left: 2px;
  margin-right: 10px;
}

.error-message {
  font-size: 0.8rem;
  color: var(--coyote-rojo);
  min-height: 1em;
}

.legal {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.checkbox-field input {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  accent-color: var(--coyote-azul);
}

.checkbox-field label {
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
}

.form-status {
  font-size: 0.9rem;
  text-align: center;
  min-height: 1.2em;
}

.form-status.success {
  color: #1e7e34;
}

.form-status.error {
  color: var(--coyote-rojo);
}

.submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--coyote-rojo);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.submit-btn:active {
  background: #b5100d;
}

.link-modal {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--coyote-azul);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

dialog.modal-legal:not([open]) {
  display: none;
}

body.modal-abierto {
  overflow: hidden;
}

dialog.modal-legal {

  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: 1px solid var(--coyote-crema);
  border-radius: 12px;
  padding: 1.5rem;
  width: min(640px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  color: var(--coyote-texto);
  font-family: "Lora", Georgia, "Times New Roman", serif;
  box-shadow: 0 20px 45px rgba(28, 28, 28, 0.22);
}

dialog.modal-legal::backdrop {
  background: rgba(28, 28, 28, 0.45);
}

dialog.modal-legal h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--coyote-azul);
  margin: 0 0 1rem;
  padding-right: 2rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--coyote-crema);
}

.modal-legal-cuerpo h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--coyote-azul);
  margin: 1.5rem 0 0.4rem;
}

.modal-legal-cuerpo h3:first-child {
  margin-top: 0;
}

.modal-legal-cuerpo p {
  line-height: 1.6;
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.modal-legal-cuerpo .nota-legal {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--coyote-crema);
  font-size: 0.75rem;
  font-style: italic;
  color: #6b5b52;
}

.modal-legal-cuerpo .politica-fecha {
  color: var(--coyote-rojo);
  font-weight: 600;
  font-size: 0.82rem;
  margin: -0.5rem 0 1rem;
}

.modal-legal-cerrar-x {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  width: auto;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #6b5b52;
  cursor: pointer;
  line-height: 1;
}

.modal-legal-cerrar-x:hover {
  color: var(--coyote-rojo);
}

.modal-legal-cerrar {
  display: block;
  margin: 1.25rem auto 0;
  width: auto;
  padding: 0.7rem 2rem;
  background: var(--coyote-rojo);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.modal-legal-cerrar:active {
  background: #b5100d;
}

@media (max-width: 600px) {
  dialog.modal-legal {
    padding: 1.25rem;
  }
}

@media (min-width: 600px) {
  .form-container {
    padding-top: 2.5rem;
  }

  .form-header h1 {
    font-size: 1.25rem;
  }
}

.campo-trampa {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
