/* ==========================================================================
   AREA UNITED · Parte 2 · 4.5 Primera clase gratis (bloque amarillo)
   Texto negro sobre amarillo; formulario sobre tarjeta negra.
   ========================================================================== */

.p2-trial {
  --line: 1px solid rgba(0,0,0,.18);
  --focus-ring: 0 0 0 2px var(--yellow), 0 0 0 4px var(--black-pure);
  background: var(--yellow);
  color: var(--black-pure);
  border-top: 0 !important;
  position: relative;
  overflow: hidden;
}
.p2-trial .lead { color: rgba(0,0,0,.72); }
.p2-trial .section-head .label { color: var(--black-pure); display: inline-flex; align-items: center; gap: 10px; }
.p2-trial .section-head .label::before { content: ""; width: 10px; height: 10px; background: var(--black-pure); }
.p2-trial .section-head { margin-bottom: 40px; }

.p2-trial-grid { display: grid; gap: 48px; }

/* --- Tres pasos: en móvil apilados con una línea vertical que los une --- */
.p2-steps {
  display: grid;
  gap: 0;
  position: relative;
}
.p2-step {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-areas: "num title" "num text";
  column-gap: 16px;
  padding-block: 20px;
}
.p2-step::before {           /* línea vertical entre pasos */
  content: "";
  position: absolute;
  left: 15px;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(0,0,0,.25);
}
.p2-step:first-child::before { top: 20px; }
.p2-step:last-child::before { bottom: auto; height: 20px; }
.p2-step-num {
  grid-area: num;
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  background: var(--black-pure);
  color: var(--yellow);
  font-size: 15px;
  letter-spacing: .02em;
  position: relative;
  z-index: 1;
  margin-top: -2px;
}
.p2-step-title { grid-area: title; font-size: clamp(24px, 3vw, 32px); line-height: 1; }
.p2-step p { grid-area: text; margin-top: 8px; color: rgba(0,0,0,.72); font-size: 15px; max-width: 36ch; }

/* --- Tarjeta negra --- */
.p2-trial-card {
  position: relative;
  background: var(--black-pure);
  color: var(--white);
  padding: 28px 20px 24px;
  border-radius: var(--radius-card);
  overflow: hidden;
  isolation: isolate;
}
.p2-trial-card::after {        /* esquina cortada, como la placa de los botones */
  content: "";
  position: absolute;
  right: 0; top: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 28px 28px 0;
  border-color: transparent var(--yellow) transparent transparent;
  z-index: 1;
}
.p2-form, .p2-form-success { position: relative; z-index: 1; }
.p2-form { display: grid; gap: 22px; }
.p2-form-head {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--surface-2);
}
.p2-form-head .p2-tag { color: var(--yellow); }
.p2-form-head-sub { font-size: 14px; color: var(--gray-text); }

/* Campos: fondo transparente, borde inferior 2 px, etiqueta flotante */
.p2-field { position: relative; display: grid; gap: 6px; }
.p2-input {
  width: 100%;
  height: 52px;
  padding: 18px 0 0;
  background: transparent;
  border: 0;
  border-bottom: 2px solid #3A3A3A;
  border-radius: 0;
  color: var(--white);
  font: inherit;
  font-size: 16px;
  transition: border-color var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}
.p2-input:focus { outline: none; box-shadow: none; border-bottom-color: var(--yellow); }
.p2-label {
  position: absolute;
  left: 0; top: 16px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--gray-text);
  pointer-events: none;
  transform-origin: left top;
  transition: transform var(--t-fast) var(--ease-out), color var(--t-fast);
}
.p2-input:focus ~ .p2-label,
.p2-input:not(:placeholder-shown) ~ .p2-label,
.p2-label.is-up { transform: translateY(-16px) scale(.8); }
.p2-input:focus ~ .p2-label { color: var(--yellow); }
.p2-select { padding-right: 32px; cursor: pointer; }
.p2-select option { color: var(--black-pure); background: var(--white); }
.p2-select-chev { position: absolute; right: 0; top: 26px; width: 18px; height: 18px; pointer-events: none; color: var(--gray-text); }

/* Error: borde y mensaje en rojo (único sitio con rojo) */
.p2-field-error { display: none; font-size: 13px; color: var(--error); }
.p2-field.has-error .p2-input { border-bottom-color: var(--error); }
.p2-field.has-error .p2-label { color: var(--error); }
.p2-field.has-error .p2-field-error { display: flex; align-items: center; gap: 6px; }
.p2-field.has-error .p2-field-error::before {
  content: "!";
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border: 1.5px solid var(--error);
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 1;
  flex: none;
}

/* Casilla de privacidad */
.p2-check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; cursor: pointer; }
.p2-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.p2-check-box {
  width: 22px; height: 22px;
  border: 2px solid #3A3A3A;
  display: grid; place-items: center;
  color: var(--black-pure);
  transition: background-color var(--t-fast), border-color var(--t-fast);
  margin-top: 1px;
}
.p2-check-box svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; opacity: 0; }
.p2-check input:checked ~ .p2-check-box { background: var(--yellow); border-color: var(--yellow); }
.p2-check input:checked ~ .p2-check-box svg { opacity: 1; }
.p2-check input:focus-visible ~ .p2-check-box { box-shadow: 0 0 0 2px var(--black-pure), 0 0 0 4px var(--yellow); }
.p2-check-text { font-size: 13.5px; line-height: 1.5; color: var(--gray-text); }
.p2-check-text a { color: var(--white); border-bottom: 1px solid var(--yellow); }
.p2-field--check.has-error .p2-check-box { border-color: var(--error); }

.p2-form-submit { justify-self: start; margin-top: 4px; }
.p2-form-alt { justify-self: start; font-size: 14px; }

/* Éxito */
.p2-form-success { display: grid; gap: 10px; justify-items: start; padding: 24px 0 8px; outline: none; }
.p2-form-success-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--yellow);
  color: var(--black-pure);
  margin-bottom: 8px;
}
.p2-form-success-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; }
.p2-form-success-title { font-size: clamp(44px, 6vw, 64px); line-height: .9; color: var(--yellow); }
.p2-form-success-text { font-size: 17px; max-width: 30ch; }
.p2-form-success-meta { color: var(--gray-text); }
.p2-form-reset { margin-top: 12px; font-size: 14px; }

/* --- Tablet --- */
@media (min-width: 768px) {
  .p2-trial-card { padding: 36px 32px 32px; }
  .p2-steps { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .p2-step { grid-template-columns: 1fr; grid-template-areas: "num" "title" "text"; padding: 24px 0 0; border-top: 2px solid rgba(0,0,0,.25); }
  .p2-step::before { display: none; }
  .p2-step-num { margin-bottom: 20px; margin-top: 0; }
  .p2-step p { margin-top: 10px; }
}

/* --- Escritorio: texto + pasos a la izquierda, tarjeta a la derecha --- */
@media (min-width: 1024px) {
  .p2-trial-grid { grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr); gap: 64px; align-items: start; }
  .p2-trial-card { padding: 40px 36px 36px; }
}
@media (min-width: 1280px) {
  .p2-trial-grid { gap: 96px; }
}

/* El display de .p2-form y .p2-form-success pisaba [hidden]: el «¡Hecho!» salía desde el principio */
.p2-form[hidden], .p2-form-success[hidden] { display: none; }
