/* Contrato con firma electrónica (2/12/2026). Kit de marca: hueso, papel, dorado, tinta. Legible en celular. */
.ct-aviso { margin-bottom: var(--space-2); padding: 14px 20px; }
.ct-aviso p { margin: 0; }
.ct-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
.ct-campo { display: block; min-width: 0; }
.ct-campo input[type="text"], .ct-campo input[type="email"], .ct-campo input[type="tel"] {
  width: 100%; min-height: 46px; padding: 10px 14px; background: var(--paper); border: 1px solid rgba(42, 38, 32, .25); border-radius: var(--radius-sm); font-size: 16px;
}
.ct-campo input:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(217, 184, 119, .35); }
.ct-campo small { display: block; margin-top: 4px; }
.ct-campo:nth-child(3), .ct-campo:nth-child(5) { grid-column: 1 / -1; }

.ct-doc { padding: clamp(20px, 4vw, 48px); margin-bottom: var(--space-3); font-size: 16px; line-height: 26px; overflow-wrap: anywhere; }
.ct-doc p { margin: 0 0 12px; }
.ct-titulo { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; margin: 0 0 4px; }
.ct-sub { color: var(--ink-2); margin: 0 0 var(--space-3) !important; }
.ct-h2 { font-size: 20px; line-height: 28px; margin: var(--space-3) 0 8px; padding-top: var(--space-2); border-top: 1px solid var(--linea); }
.ct-lista { margin: 0 0 12px; padding-left: 24px; }
.ct-lista li { margin-bottom: 6px; }
.ct-lista ul { margin: 6px 0 0; padding-left: 20px; }
.ct-dato { background: rgba(217, 184, 119, .22); border-radius: var(--radius-xs); padding: 0 3px; font-weight: 600; }
.ct-dato.ct-falta { color: var(--ink-2); font-weight: 400; background: rgba(42, 38, 32, .06); }
.ct-tabla-wrap { overflow-x: auto; margin: 12px 0 16px; -webkit-overflow-scrolling: touch; }
.ct-tabla { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.ct-tabla th, .ct-tabla td { border: 1px solid var(--linea); padding: 8px 12px; text-align: left; vertical-align: top; }
.ct-tabla thead th { background: rgba(42, 38, 32, .05); }
.ct-firmas { table-layout: fixed; min-width: 520px; }
.ct-firmas tbody th { width: 96px; background: rgba(42, 38, 32, .04); }
.ct-firma-caja { height: 150px; position: relative; }
.ct-firma-caja canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--paper); border: 1px dashed rgba(42, 38, 32, .45); border-radius: var(--radius-sm); touch-action: none; cursor: crosshair; }
.ct-firma-hecha { height: 110px; display: flex; align-items: center; justify-content: center; }
.ct-firma-hecha img { max-width: 100%; max-height: 104px; object-fit: contain; }
.ct-firma-pendiente { border: 1px dashed rgba(42,38,32,.2); border-radius: var(--radius-sm); }
.ct-firma-pendiente span { font-size: 13px; color: var(--ink-2); }
.ct-firma-acciones { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ct-firma-acciones .nota { margin: 0; font-size: 13px; line-height: 18px; }
.ct-constancia { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--linea); font-size: 13px; line-height: 20px; color: var(--ink-2); }
.ct-constancia p { margin: 0; }
.ct-hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }

.ct-cierre { display: grid; gap: var(--space-2); justify-items: start; margin-bottom: var(--space-4); }
.ct-acepto { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; min-height: 44px; }
.ct-acepto input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.ct-cierre .nota { margin: 0; }
.ct-ok { margin-bottom: var(--space-3); border-color: var(--gold); }
.ct-ok p { margin: 0; }

/* Primeros pasos: tarjeta del contrato y pasos bloqueados */
.paso-contrato { border-color: var(--gold); }
.paso-contrato .paso-estado { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.paso-contrato.hecho .paso-estado { background: var(--ink); color: var(--bone); }
.paso.bloqueado { opacity: .6; }
.paso.bloqueado .check input { cursor: not-allowed; }

/* Admin > Contratos */
.ct-lista-admin { display: grid; gap: 12px; margin-top: var(--space-2); }
.ct-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 20px; }
.ct-fila-datos { flex: 1 1 220px; min-width: 0; }
.ct-fila h2 { font-size: 20px; line-height: 26px; }
.ct-fila .nota { margin: 2px 0 0; overflow-wrap: anywhere; }
.ct-chip { padding: 4px 12px; border-radius: var(--radius-pill); font-size: 13px; line-height: 20px; font-weight: 600; border: 1px solid var(--linea); background: var(--paper); }
.ct-chip.ok { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.ct-chip.falta { border-color: #8A3B2E; color: #8A3B2E; }
.ct-chip.aviso { border-color: var(--gold-dark); color: var(--ink); background: rgba(217, 184, 119, .25); }

@media (max-width: 640px) {
  .ct-datos { grid-template-columns: 1fr; }
  .ct-campo:nth-child(3), .ct-campo:nth-child(5) { grid-column: auto; }
  .ct-doc { padding: 18px 16px; }
  .ct-firma-acciones { flex-direction: column; align-items: flex-start; }
}

/* Descargar: el diálogo de impresión (Guardar como PDF) muestra solo el contrato. */
@media print {
  body * { visibility: hidden; }
  #ct-doc, #ct-doc * { visibility: visible; }
  #ct-doc { position: absolute; left: 0; top: 0; width: 100%; margin: 0; border: 0; box-shadow: none; background: #fff; padding: 0; font-size: 12px; line-height: 18px; }
  .no-print { display: none !important; }
  body { background: #fff; }
  .ct-h2 { break-after: avoid; }
  .ct-tabla-wrap { overflow: visible; }
  .ct-firmas { min-width: 0; break-inside: avoid; }
  .ct-dato { background: none; }
}
