/* formularios-pro.css — status_check.php y sagrilaft.php.
   Desktop: tarjeta limpia sobre var(--sv-fondo). Móvil (<760px): paneles liquid glass,
   misma técnica que mobile-pro.css (blur + saturate + borde translúcido verde). */

:root {
  --sv-nav-clear: calc(104px + env(safe-area-inset-top, 0px));
}

/* ---------- Estructura base ---------- */

.sv-form-shell {
  background: var(--sv-fondo, #f6f8f5);
  min-height: 100vh;
  padding: var(--sv-nav-clear) 16px 64px;
}

.sv-form-hero {
  max-width: 720px;
  margin: 0 auto clamp(20px, 4vw, 32px);
  text-align: center;
}

.sv-form-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 149, 70, 0.1);
  color: var(--sv-esmeralda, #00713a);
  font-size: 22px;
  margin-bottom: 14px;
}

.sv-form-hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--sv-tinta, #11221a);
  margin: 0 0 8px;
}

.sv-form-hero p {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  color: var(--sv-gris, #5f6f66);
  max-width: 52ch;
  margin: 0 auto;
  line-height: 1.55;
}

.sv-form-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--sv-panel, #fff);
  border-radius: 22px;
  box-shadow: var(--sv-elev-2, 0 4px 16px rgba(10, 61, 35, 0.12));
  padding: clamp(20px, 4vw, 40px);
}

.sv-form-card--wide {
  max-width: 780px;
}

/* ---------- Campos ---------- */

.sv-field {
  margin-bottom: 18px;
}

.sv-field label,
.sv-field > .sv-field__label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sv-tinta, #11221a);
  margin-bottom: 6px;
}

.sv-field input[type="text"],
.sv-field input[type="email"],
.sv-field input[type="date"],
.sv-field select,
.sv-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  color: var(--sv-tinta, #11221a);
  background: #fafcfa;
  border: 1.5px solid var(--sv-linea, #e4eae3);
  border-radius: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.sv-field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.sv-field input:focus,
.sv-field select:focus,
.sv-field textarea:focus {
  outline: none;
  border-color: var(--sv-verde, #009546);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 149, 70, 0.14);
}

.sv-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%235f6f66'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.1l3.71-3.87a.75.75 0 111.08 1.04l-4.25 4.43a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px;
}

.sv-field__hint {
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  color: var(--sv-gris, #5f6f66);
  margin-top: 6px;
}

/* ---------- Botones ---------- */

.sv-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sv-verde, #009546), var(--sv-esmeralda, #00713a));
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(0, 113, 58, 0.55);
  transition: box-shadow 150ms ease, background-color 150ms ease;
}

.sv-btn-primary:hover {
  box-shadow: 0 14px 28px -10px rgba(0, 113, 58, 0.65);
}

/* ---------- Alertas de resultado ---------- */

.sv-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 16px;
  padding: 16px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 16px;
}

.sv-alert i {
  flex: 0 0 auto;
  font-size: 1.1rem;
  margin-top: 2px;
}

.sv-alert--success {
  background: rgba(0, 149, 70, 0.08);
  color: #0a3d23;
  border: 1px solid rgba(0, 149, 70, 0.25);
}

.sv-alert--success i {
  color: var(--sv-esmeralda, #00713a);
}

.sv-alert--info {
  background: #f2f6f1;
  color: #33413a;
  border: 1px solid var(--sv-linea, #e4eae3);
}

.sv-alert--info i {
  color: var(--sv-gris, #5f6f66);
}

.sv-alert--error {
  background: rgba(214, 48, 49, 0.08);
  color: #7a1f1f;
  border: 1px solid rgba(214, 48, 49, 0.25);
}

.sv-alert--error i {
  color: #d63031;
}

.sv-alert strong {
  word-break: break-word;
}

/* =================================================================
   SAGRILAFT — formulario largo con secciones
   ================================================================= */

.sv-form-notice {
  display: flex;
  gap: 12px;
  background: #f2f6f1;
  border: 1px solid var(--sv-linea, #e4eae3);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: clamp(20px, 4vw, 32px);
}

.sv-form-notice i {
  flex: 0 0 auto;
  color: var(--sv-esmeralda, #00713a);
  font-size: 1.1rem;
  margin-top: 2px;
}

.sv-form-notice p {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #33413a;
  margin: 0;
  text-align: left;
}

.sv-form-notice a {
  color: var(--sv-esmeralda, #00713a);
  font-weight: 600;
}

.sv-section {
  padding: clamp(18px, 4vw, 26px) 0;
  border-top: 1px solid var(--sv-linea, #e4eae3);
}

.sv-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.sv-section__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sv-section__badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sv-profundo, #0a3d23);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
}

.sv-section__title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--sv-tinta, #11221a);
  margin: 0;
}

/* Grupo de radios como tarjetas seleccionables (privacidad, conoce a los participantes) */

.sv-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sv-radio-option {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--sv-linea, #e4eae3);
  border-radius: 12px;
  background: #fafcfa;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  color: var(--sv-tinta, #11221a);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.sv-radio-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--sv-verde, #009546);
  flex: 0 0 auto;
}

.sv-radio-option:has(input:checked) {
  border-color: var(--sv-verde, #009546);
  background: rgba(0, 149, 70, 0.07);
  box-shadow: 0 0 0 3px rgba(0, 149, 70, 0.1);
  font-weight: 600;
}

/* Datos personales condicionales: transición suave al mostrar/ocultar */
#datos_personales {
  overflow: hidden;
}

/* Definiciones legales como tarjetas apiladas, en vez de <dl> desnudo */

.sv-def-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
}

.sv-def-item {
  background: #fafcfa;
  border: 1px solid var(--sv-linea, #e4eae3);
  border-radius: 12px;
  padding: 12px 14px;
}

.sv-def-item dt {
  font-family: 'Poppins', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--sv-profundo, #0a3d23);
  margin-bottom: 4px;
}

.sv-def-item dd {
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--sv-gris, #5f6f66);
  margin: 0;
}

.sv-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #f2f6f1;
  border-radius: 12px;
  margin: 20px 0;
}

.sv-checkbox-row input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--sv-verde, #009546);
  flex: 0 0 auto;
}

.sv-checkbox-row label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  color: var(--sv-tinta, #11221a);
  line-height: 1.4;
}

.sv-submit-bar {
  margin-top: 22px;
}

/* ---------- Desktop ---------- */

@media (min-width: 760px) {
  .sv-form-shell {
    padding-top: calc(140px + env(safe-area-inset-top, 0px));
  }

  .sv-btn-primary {
    width: auto;
    min-width: 240px;
    margin: 0 auto;
  }

  .sv-submit-bar {
    display: flex;
    justify-content: center;
  }
}

/* =================================================================
   MÓVIL — liquid glass (misma técnica que mobile-pro.css)
   ================================================================= */

@media (max-width: 759.98px) {
  .sv-form-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Reserva de espacio para que la barra de envío fija no tape el último campo */
  .sv-form-shell--has-sticky-submit {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .sv-form-hero__icon {
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(10, 61, 35, 0.14);
    box-shadow: 0 6px 16px -8px rgba(10, 61, 35, 0.35);
  }

  /* El blur vive en ::before (no en la propia tarjeta): backdrop-filter en un ancestro
     convierte a sus descendientes `position:fixed` (la barra de envío) en fijos relativos
     a esa tarjeta en vez del viewport. Con el blur en un pseudo-elemento sin hijos, la
     tarjeta deja de ser containing block y la barra queda realmente pegada abajo. */
  .sv-form-card {
    position: relative;
    isolation: isolate;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 14px 36px -14px rgba(10, 61, 35, 0.35);
    border-radius: 24px;
  }

  .sv-form-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(255, 255, 255, 0.62);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: inherit;
  }

  .sv-field input[type="text"],
  .sv-field input[type="email"],
  .sv-field input[type="date"],
  .sv-field select,
  .sv-field textarea {
    background: rgba(255, 255, 255, 0.7);
  }

  .sv-field input:focus,
  .sv-field select:focus,
  .sv-field textarea:focus {
    background: rgba(255, 255, 255, 0.95);
  }

  .sv-radio-option,
  .sv-def-item {
    background: rgba(255, 255, 255, 0.55);
  }

  .sv-form-notice,
  .sv-checkbox-row {
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 1px solid rgba(10, 61, 35, 0.1);
  }

  /* Barra de envío fija tipo cápsula, igual que el carrito (mobile-pro.css) */
  .sv-submit-bar--sticky {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    margin: 0;
    padding: 10px;
    border-radius: 22px;
    background: rgba(10, 61, 35, 0.62);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 30px -8px rgba(10, 61, 35, 0.5);
  }

  .sv-submit-bar--sticky .sv-btn-primary {
    box-shadow: none;
  }

  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sv-form-card::before,
    .sv-form-hero__icon,
    .sv-form-notice,
    .sv-checkbox-row {
      background: rgba(255, 255, 255, 0.96);
    }

    .sv-submit-bar--sticky {
      background: #0a3d23;
    }
  }

  @media (prefers-reduced-transparency: reduce) {
    .sv-form-card::before,
    .sv-form-hero__icon,
    .sv-form-notice,
    .sv-checkbox-row {
      background: #ffffff;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }

    .sv-submit-bar--sticky {
      background: #0a3d23;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }
}
