/* Funnel en móvil: cada paso cabe en la primera pantalla hasta el botón. */
@media (max-width: 767px) {
  #app main .fc-request-flow.page { padding-top: 14px !important; }
  #app main .fc-request-flow .progress { margin-bottom: 14px !important; }
  #app main .fc-request-flow.page h1 { font-size: 27px !important; line-height: 1.15 !important; margin-bottom: 16px !important; }

  /* Paso de idioma */
  #app main .fc-lang-step .fc-lang-choice { margin-top: 16px !important; }

  /* Datos del solicitante: todo el formulario hasta el botón en la primera pantalla */
  #app main .fc-request-flow #applicant-form { display: flex; flex-direction: column; }
  #app main .fc-request-flow #applicant-form .fields { order: 1; row-gap: 12px !important; }
  #app main .fc-request-flow #applicant-form .form-end { order: 2; margin-top: 18px !important; }
  #app main .fc-request-flow #applicant-form .fc-applicant-aside { order: 3; margin-top: 24px !important; }
  #app main .fc-request-flow:has(#applicant-form) .lead { display: none !important; }
  #app main .fc-request-flow #applicant-form .field label { margin-bottom: 4px !important; font-size: 15px !important; }
  #app main .fc-request-flow #applicant-form .field input,
  #app main .fc-request-flow #applicant-form .field select { height: 46px !important; min-height: 46px !important; }
  #app main .fc-request-flow #applicant-form .field select { padding-top: 0 !important; padding-bottom: 0 !important; line-height: normal !important; }
}

/* Móviles bajos (alto de pantalla hasta 700 px): un poco más compacto */
@media (max-width: 767px) and (max-height: 700px) {
  #app main .fc-request-flow.page { padding-top: 10px !important; }
  #app main .fc-request-flow .progress { margin-bottom: 10px !important; }
  #app main .fc-request-flow.page h1 { font-size: 24px !important; margin-bottom: 10px !important; }
  #app main .fc-request-flow #applicant-form .fields { row-gap: 9px !important; }
  #app main .fc-request-flow #applicant-form .field label { font-size: 14px !important; margin-bottom: 3px !important; }
  #app main .fc-request-flow #applicant-form .field input,
  #app main .fc-request-flow #applicant-form .field select { height: 42px !important; min-height: 42px !important; }
  #app main .fc-request-flow #applicant-form .form-end { margin-top: 14px !important; }
  #app main .fc-request-flow #applicant-form .btn { min-height: 50px !important; }
}

/* Móviles muy bajos (iPhone SE de primera generación y similares) */
@media (max-width: 767px) and (max-height: 600px) {
  #app main .fc-request-flow.page { padding-top: 8px !important; }
  #app main .fc-request-flow .progress { margin-bottom: 8px !important; }
  #app main .fc-request-flow.page h1 { font-size: 22px !important; margin-bottom: 8px !important; }
  #app main .fc-request-flow #applicant-form .fields { row-gap: 6px !important; }
  #app main .fc-request-flow #applicant-form .field label { font-size: 13px !important; margin-bottom: 2px !important; }
  #app main .fc-request-flow #applicant-form .field input,
  #app main .fc-request-flow #applicant-form .field select { height: 38px !important; min-height: 38px !important; }
  #app main .fc-request-flow #applicant-form .form-end { margin-top: 10px !important; }
  #app main .fc-request-flow #applicant-form .btn { min-height: 46px !important; }
}

/* Pago: primero Apple Pay / Google Pay; la tarjeta plegada en su propia fila */
#secure-payment .pdh-wallet:not(:empty) { margin-top: 12px; }
#secure-payment .pdh-card-option { border: 1px solid var(--line, #e6e2df); border-radius: 10px; background: #fff; overflow: hidden; }
#secure-payment .pdh-card-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 12px 16px; border: 0; background: transparent; color: var(--ink, #2a2420); font: inherit; font-size: 16px; font-weight: 600; text-align: left; cursor: pointer; }
#secure-payment .pdh-card-toggle:focus-visible { outline: 3px solid #9a482740; outline-offset: -3px; }
#secure-payment .pdh-card-toggle-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 1 1 auto; min-width: 0; }
#secure-payment .pdh-card-toggle-brands { height: 16px; width: auto; }
#secure-payment .pdh-card-toggle-icon { flex: 0 0 auto; width: 9px; height: 9px; margin: 0 2px 4px 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
#secure-payment.pdh-card-open .pdh-card-toggle-icon { transform: rotate(-135deg); margin-bottom: -4px; }
#secure-payment.pdh-card-open .pdh-card-option { border-color: var(--blue, #9a4827); }
#secure-payment .pdh-card-panel { padding: 4px 16px 16px; border-top: 1px solid var(--line, #e6e2df); }
#secure-payment .pdh-card-panel #stripe-card { margin: 12px 0 16px; }
#secure-payment #stripe-error:empty { display: none; }

@media (max-width: 767px) {
  #app main .page:has(#secure-payment) { padding-top: 14px !important; }
  #app main .page:has(#secure-payment) h1 { font-size: 24px !important; line-height: 1.2 !important; margin-bottom: 12px !important; }
  #app main .panel:has(#secure-payment) { padding: 16px !important; }
  #app main .panel:has(#secure-payment) > h2 { display: none !important; }
  #app main .panel:has(#secure-payment) .pdh-order-property { margin-bottom: 10px !important; padding: 10px 12px !important; }
  #secure-payment .pdh-pay-title { margin: 14px 0 10px !important; }
}
