@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --rosa: #ff0060;
  --rosa-oscuro: #b80043;
  --texto: #1a1c1c;
  --texto-secundario: #5d6369;
  --borde: #e3e5e7;
  --fondo: #f7f7f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 400 16px/1.55 "Hanken Grotesk", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #007e74; outline-offset: 3px; }

.contenedor {
  width: min(860px, calc(100% - 2.5rem));
  margin: clamp(1.5rem, 5vw, 4rem) auto;
}

.marca {
  display: grid;
  width: 138px;
  height: 46px;
  min-height: 46px;
  place-items: center;
  padding: .45rem .75rem;
  border-radius: 13px;
  background: var(--rosa);
  transition: transform .2s ease, box-shadow .2s ease;
}

.marca:hover { transform: translateY(-2px); box-shadow: 0 8px 20px #ff00602b; }
.marca img { display: block; width: 100%; height: 100%; object-fit: contain; }

.volver {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 1rem;
  color: var(--rosa-oscuro);
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 4px;
}

.volver:hover { text-decoration: underline; }

.panel {
  position: relative;
  overflow: hidden;
  margin-top: .8rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--borde);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 55px #18181b0d;
  animation: entrada .35s ease-out both;
}

.panel::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--rosa);
  content: "";
}

.rotulo {
  margin: 0 0 .6rem;
  color: var(--rosa-oscuro);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: .2rem 0 1rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -.045em;
  line-height: 1.12;
}

p { max-width: 65ch; }

.formulario {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.trampa {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.campos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.campo-mapa { position: relative; min-width: 0; }
.estado-mapa { display: block; min-height: 1.25rem; margin-top: .3rem; color: var(--texto-secundario); font-size: .78rem; font-weight: 500; }
.opciones-mapa { position: absolute; z-index: 5; top: calc(100% - 1.2rem); right: 0; left: 0; max-height: 240px; overflow-y: auto; margin: 0; padding: .3rem; border: 1px solid var(--borde); border-radius: 11px; background: #fff; box-shadow: 0 12px 32px #18181b24; list-style: none; }
.opciones-mapa[hidden] { display: none; }
.opciones-mapa li { margin: 0; }
.opciones-mapa button { display: block; width: 100%; min-height: 44px; padding: .65rem .75rem; border: 0; border-radius: 7px; background: #fff; color: var(--texto); font: inherit; font-size: .86rem; text-align: left; cursor: pointer; }
.opciones-mapa button:hover, .opciones-mapa button:focus-visible { background: #fff0f5; outline: 2px solid #d50052; outline-offset: -2px; }
.ayuda-mapa { margin: -1rem 0 0; font-size: .8rem; }

label {
  display: grid;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 700;
}

label:focus-within { color: var(--rosa-oscuro); }

input, select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: .7rem .85rem;
  border: 1px solid #cdd1d4;
  border-radius: 10px;
  background: #fff;
  color: var(--texto);
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus, select:focus { border-color: var(--rosa); box-shadow: 0 0 0 3px #ff00601c; outline: 0; }

.privacidad {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  font-weight: 500;
}

.privacidad input { width: 20px; min-height: 20px; flex: 0 0 20px; margin: .2rem 0 0; accent-color: var(--rosa); }
.privacidad span { max-width: 65ch; }
.privacidad a, .ayuda a, .panel > a:not(.boton) { color: var(--rosa-oscuro); font-weight: 700; text-underline-offset: 3px; }
.enlaces-cuenta { margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid var(--borde); }
.enlaces-cuenta p { margin: .55rem 0; }
.enlaces-cuenta a { color: var(--rosa-oscuro); font-weight: 700; text-underline-offset: 3px; }

.boton {
  display: inline-flex;
  width: fit-content;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.25rem;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: #fff;
  color: var(--texto);
  font: 700 15px/1.2 "Hanken Grotesk", sans-serif;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.boton:hover { transform: translateY(-2px); }
.boton-cta { border-color: var(--rosa-oscuro); background: var(--rosa-oscuro); color: #fff; }
.boton-cta:hover { background: var(--rosa-oscuro); box-shadow: 0 8px 20px #ff00602b; }
.boton:disabled { opacity: .45; cursor: not-allowed; }

.documentos { display: grid; gap: .8rem; margin-top: 1.6rem; }

.tipo-vehiculo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: #fbfbfb;
}

.documento {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: #fff;
}

.documento strong, .documento span { display: block; }
.documento span { margin-top: .2rem; font-size: .8rem; }

/* Subida automática (subida-automatica.js): sin botón Cargar y con estado bajo el campo */
@media (min-width: 681px) {
  .documento.subida-activa { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
}
.documento button[hidden] { display: none; }
.estado-compresion { display: flex; align-items: center; gap: .45rem; margin-top: .45rem; color: var(--texto-secundario); font-size: .85rem; font-weight: 600; }
.estado-compresion[data-estado]::before { content: ""; flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; }
.estado-compresion[data-estado="procesando"] { color: var(--rosa-oscuro); }
.estado-compresion[data-estado="procesando"]::before { border: 2px solid #ff006033; border-top-color: var(--rosa-oscuro); animation: girar .8s linear infinite; }
.estado-compresion[data-estado="listo"] { color: #087b62; }
.estado-compresion[data-estado="listo"]::before { content: "✓"; display: grid; place-items: center; background: #087b62; color: #fff; font-size: 11px; line-height: 1; }
.estado-compresion[data-estado="error"] { color: #9a1641; }
.estado-compresion[data-estado="error"]::before { content: "!"; display: grid; place-items: center; background: #9a1641; color: #fff; font-size: 11px; line-height: 1; }
@keyframes girar { to { transform: rotate(360deg); } }
.estado { color: #087b62; }
.pendiente { color: #9b5811; }
.archivo { font-weight: 500; }
.archivo input { padding: .55rem; font-size: .85rem; }
.enviar { margin-top: 1.5rem; }

.aviso { padding: .9rem 1rem; border-radius: 10px; background: #e5f8f3; color: #145b52; }
.aviso.error { background: #fff0f2; color: #9a1641; }
.ayuda, .pie { color: var(--texto-secundario); font-size: .85rem; }
.pie { margin-top: 1.3rem; text-align: center; }

@keyframes entrada {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .campos, .documento, .tipo-vehiculo { grid-template-columns: 1fr; }
  .documento { align-items: start; }
  .boton { width: 100%; }
  .panel { padding: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
