:root {
  color-scheme: light;
  --acento: #a71930;
  --acento-hover: #861426;
  --acento-suave: #f3d9dd;
  --texto: #202124;
  --texto-secundario: #52565c;
  --borde: #c9cdd2;
  --fondo: #f6f1f2;
  --error: #a50e0e;
  --error-fondo: #fce8e6;
  --aviso-fondo: #e8f0fe;
  --foco: #155eef;
  --radio: 12px;
  --sombra: 0 2px 8px rgb(32 33 36 / 8%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--fondo); }
[hidden] { display: none !important; }

body {
  min-width: 280px;
  margin: 0;
  overflow-wrap: break-word;
  background: var(--fondo);
  color: var(--texto);
  font: 1rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.card {
  margin: 0 0 16px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: #fff;
  box-shadow: var(--sombra);
}

.cab { border-top: 10px solid var(--acento); }
.cab h1 { margin: 0 0 8px; font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 650; line-height: 1.2; text-wrap: balance; }
.cab p { margin: 0; color: var(--texto-secundario); }

h2 {
  margin: calc(clamp(18px, 4vw, 28px) * -1) calc(clamp(18px, 4vw, 28px) * -1) 22px;
  padding: 12px clamp(18px, 4vw, 28px);
  border-radius: var(--radio) var(--radio) 0 0;
  background: var(--acento-suave);
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 650;
  line-height: 1.3;
}

p { margin: 0 0 18px; }
.campo { min-width: 0; margin: 0 0 22px; padding: 0; border: 0; }
label, legend { display: block; margin-bottom: 7px; padding: 0; font-size: .98rem; font-weight: 600; }
.req { color: var(--error); }

input:not([type="radio"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #fff;
  color: var(--texto);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: 0 1px 2px rgb(32 33 36 / 5%) inset;
  -webkit-appearance: none;
  appearance: none;
}

select {
  padding-right: 42px;
  background-image: linear-gradient(45deg, transparent 50%, #555 50%), linear-gradient(135deg, #555 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

textarea { min-height: 128px; resize: vertical; }

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 2px;
}

input:disabled, input:read-only {
  background: #f1f3f4;
  color: #4d5156;
  opacity: 1;
  -webkit-text-fill-color: #4d5156;
}

label.radio {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 400;
  touch-action: manipulation;
}

label.radio:has(input:checked) { border-color: var(--acento); background: #fff7f8; }
input[type="radio"] { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--acento); }
.conerror input, .conerror select, .conerror textarea, .conerror label.radio { border-color: var(--error); }
.msg { display: block; margin-top: 6px; color: var(--error); font-size: .9rem; font-weight: 600; }
.error, .aviso { margin-bottom: 20px; padding: 12px 14px; border-radius: 8px; }
.error { background: var(--error-fondo); color: var(--error); }
.aviso { background: var(--aviso-fondo); }

button {
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--acento);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:hover { background: var(--acento-hover); }
button:active { transform: translateY(1px); }
a { color: #8b1528; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.legal { margin: 20px 4px 0; color: var(--texto-secundario); font-size: .82rem; }

@media (max-width: 480px) {
  .wrap { padding-top: max(10px, env(safe-area-inset-top)); }
  .card { margin-bottom: 12px; border-radius: 10px; }
  button { width: 100%; }
}

@media (min-width: 700px) {
  .wrap { padding-top: 28px; padding-bottom: 40px; }
  .card { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (forced-colors: active) {
  .card, label.radio { border: 1px solid CanvasText; }
  button { border: 1px solid ButtonText; }
}
