/* ── Reset & variables ──────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

   :root {
  --ink:       #1f2937;
  --paper:     #ffffff;
  --bg:        #f4f6f8;

  --primary:   #374151;
  --primary-2: #4b5563;

  --accent:    #2563eb;

  --border:    #dbe1e8;
  --muted:     #6b7280;

  --success:   #16a34a;
  --danger:    #dc2626;
  --red:       #dc2626;
  --red-light: #b91c1c;

  --shadow:    rgba(15, 23, 42, 0.06);
}

    html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

    /* ── Header ─────────────────────────────────────────────── */
   .header {
  background: linear-gradient(
    135deg,
    #1f2937 0%,
    #111827 100%
  );

  padding: 0;
  position: relative;
  overflow: hidden;
}

    .header::before {
      content: '';
      position: absolute;
      inset: 0;
      background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,.02) 10px,
        rgba(255,255,255,.02) 11px
      );
    }

    .header-inner {
      position: relative;
      max-width: 760px;
      margin: auto;
      padding: 40px 24px 36px;
      text-align: center;
    }

    .escudo {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      background: rgba(255,255,255,.08);
border: 1px solid rgba(255,255,255,.12);
backdrop-filter: blur(4px);
      color: #fff;
      font-size: .72rem;
      font-weight: 500;
      letter-spacing: .12em;
      text-transform: uppercase;
      padding: 5px 14px;
      border-radius: 2px;
      margin-bottom: 20px;
    }

    .escudo svg { width: 14px; height: 14px; fill: currentColor; }

    .header h1 {
      font-family: 'Playfair Display', serif;
      font-size: clamp(2rem, 5vw, 3rem);
      color: var(--paper);
      line-height: 1.15;
      letter-spacing: -.01em;
    }

    .header h1 em {
      font-style: italic;
      color: var(--accent);
    }

    .header p {
      margin-top: 12px;
      color: rgba(255,255,255,.55);
      font-size: .9rem;
      max-width: 480px;
      margin-left: auto;
      margin-right: auto;
    }

    /* ── Wrapper del libro ──────────────────────────────────── */
    .libro-wrap {
      max-width: 760px;
      margin: 0 auto;
      padding: 0 16px 60px;
    }

    /* ── Aviso legal ────────────────────────────────────────── */
    .aviso {
      background: #fff9ee;
      border: 1px solid var(--border);
      border-top: 4px solid var(--primary);
      padding: 18px 20px;
      margin-top: 32px;
      border-radius: 2px;
    }

    .aviso h3 {
      font-family: 'Playfair Display', serif;
      font-size: 1rem;
      color: var(--primary);
      margin-bottom: 6px;
    }

    .aviso p {
      font-size: .82rem;
      color: var(--muted);
      line-height: 1.6;
    }

    /* ── Selector tipo ──────────────────────────────────────── */
    .tipo-selector {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin: 28px 0 0;
    }

   .tipo-btn {
  border: 1px solid var(--border);
  background: #fff;

  padding: 20px 18px;

  border-radius: 12px;

  cursor: pointer;

  text-align: left;

  transition:
    border-color .2s,
    transform .2s,
    box-shadow .2s;
}

.tipo-btn:hover {
  border-color: #9ca3af;

  transform: translateY(-2px);

  box-shadow:
    0 8px 20px rgba(15,23,42,.06);
}

.tipo-btn.activo {
  border-color: var(--accent);

  background: #f8fbff;

  box-shadow:
    0 0 0 4px rgba(37,99,235,.08);
}

    .tipo-btn .tipo-icono {
      font-size: 1.6rem;
      margin-bottom: 8px;
      display: block;
    }

    .tipo-btn .tipo-titulo {
      font-family: 'Playfair Display', serif;
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--ink);
      display: block;
    }

    .tipo-btn .tipo-desc {
      font-size: .76rem;
      color: var(--muted);
      margin-top: 4px;
      display: block;
      line-height: 1.5;
    }

    /* ── Formulario ─────────────────────────────────────────── */
  .form-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 28px;
  overflow: hidden;

  box-shadow:
    0 10px 30px rgba(15,23,42,.05),
    0 2px 10px rgba(15,23,42,.03);
}
    .form-section {
      padding: 28px 28px 0;
    }

    .form-section:last-of-type {
      padding-bottom: 28px;
    }

    .section-title {
      font-family: 'Playfair Display', serif;
      font-size: .95rem;
      font-weight: 600;
      color: var(--accent);
      text-transform: uppercase;
      letter-spacing: .1em;
      border-bottom: 1px solid var(--border);
      padding-bottom: 10px;
      margin-bottom: 20px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .section-title::before {
      content: '';
      width: 3px;
      height: 16px;
      background: var(--primary);
      border-radius: 2px;
      flex-shrink: 0;
    }

    .form-row {
      display: grid;
      gap: 16px;
      margin-bottom: 16px;
    }

    .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
    .form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

    .form-group { display: flex; flex-direction: column; }

    label {
      font-size: .78rem;
      font-weight: 500;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .06em;
      margin-bottom: 6px;
    }

    label span.req { color: var(--primary); margin-left: 2px; }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    select,
    textarea {
      font-family: 'DM Sans', sans-serif;
      font-size: .92rem;
      color: var(--ink);
      background: #fff;
      border: 1px solid #d1d5db;
      border-radius: 10px;
      padding: 10px 13px;
      transition: border-color .2s, box-shadow .2s;
      outline: none;
      width: 100%;
    }

    input:focus, select:focus, textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(184,146,42,.12);
    }

    input.error, select.error, textarea.error {
      border-color: var(--red);
      box-shadow: 0 0 0 3px rgba(192,57,43,.1);
    }

    textarea { resize: vertical; min-height: 110px; line-height: 1.6; }

    .field-hint {
      font-size: .72rem;
      color: var(--muted);
      margin-top: 4px;
    }

    /* ── Separador ──────────────────────────────────────────── */
    .form-divider {
      height: 1px;
      background: var(--border);
      margin: 0 28px;
    }

    /* ── Botón enviar ───────────────────────────────────────── */
    .form-footer {
      padding: 24px 28px;
      display: flex;
      align-items: center;
      gap: 16px;
      background: #fff9ee;
      border-top: 1px solid var(--border);
    }

    .btn-enviar {
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  font-weight: 600;

  color: #fff;
  background: #111827;

  border: none;

  padding: 14px 28px;

  border-radius: 10px;

  cursor: pointer;

  transition:
    transform .18s ease,
    background .18s ease,
    box-shadow .18s ease;

  box-shadow:
    0 6px 18px rgba(17,24,39,.15);
}

.btn-enviar:hover:not(:disabled) {
  background: #1f2937;
  transform: translateY(-1px);
}

    .btn-enviar:hover:not(:disabled) {
      background: var(--red-light);
      transform: translateY(-1px);
    }

    .btn-enviar:disabled {
      opacity: .6;
      cursor: not-allowed;
    }

    .btn-enviar .spinner {
      display: none;
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255,255,255,.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin .7s linear infinite;
      vertical-align: middle;
      margin-right: 8px;
    }

    .btn-enviar.cargando .spinner { display: inline-block; }
    .btn-enviar.cargando .btn-texto { opacity: .7; }

    @keyframes spin { to { transform: rotate(360deg); } }

    .privacy-note {
      font-size: .74rem;
      color: var(--muted);
      line-height: 1.5;
      flex: 1;
    }

    /* ── Mensaje de estado ──────────────────────────────────── */
    #mensaje-estado {
      display: none;
      margin-top: 20px;
      padding: 16px 20px;
      border-radius: 4px;
      font-size: .9rem;
      line-height: 1.5;
      animation: fadeIn .3s ease;
    }

    #mensaje-estado.exito {
      background: #edfbf3;
      border: 1.5px solid #2ecc71;
      color: #1a5e36;
      display: flex;
      gap: 12px;
      align-items: flex-start;
    }

    #mensaje-estado.error {
      background: #fef0ee;
      border: 1.5px solid var(--red);
      color: var(--red);
      display: flex;
      gap: 12px;
      align-items: flex-start;
    }

    .msg-icon { font-size: 1.2rem; flex-shrink: 0; }

    @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

    /* ── Footer ─────────────────────────────────────────────── */
    .page-footer {
      text-align: center;
      padding: 20px;
      font-size: .76rem;
      color: var(--muted);
      border-top: 1px solid var(--border);
      margin-top: 8px;
    }

    /* ── Responsive ─────────────────────────────────────────── */
    @media (max-width: 580px) {
      .form-row.cols-2,
      .form-row.cols-3 { grid-template-columns: 1fr; }
      .tipo-selector { grid-template-columns: 1fr; }
      .form-section { padding: 20px 16px 0; }
      .form-divider { margin: 0 16px; }
      .form-footer { flex-direction: column; align-items: stretch; }
      .btn-enviar { text-align: center; }
    }
