:root {
  --verde: #1fae5f;
  --verde-oscuro: #16955a;
  --oscuro: #101828;
  --gris-card: #eef1f5;
  --gris-borde: #e2e6ea;
  --texto: #101828;
  --texto-suave: #667085;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #ffffff; color: var(--texto); }

.page { max-width: 480px; margin: 0 auto; padding: 20px 16px 140px; }

h1#rifa-nombre { font-size: 28px; font-weight: 800; margin-bottom: 16px; }

.poster-card { background: var(--gris-card); border-radius: 14px; padding: 8px; margin-bottom: 16px; }
.poster {
  width: 100%; aspect-ratio: 3/4; border-radius: 10px;
  background: repeating-linear-gradient(45deg, #e5e9ee, #e5e9ee 10px, #eef1f5 10px, #eef1f5 20px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  background-size: cover; background-position: center;
}
.poster-hint { color: var(--texto-suave); font-size: 13px; padding: 12px; }

.precio-banner {
  background: var(--verde); color: white; border-radius: 12px;
  padding: 16px; text-align: center; margin-bottom: 16px;
}
.precio-banner span { display: block; font-size: 14px; opacity: 0.9; margin-bottom: 4px; }
.precio-banner strong { font-size: 34px; font-weight: 800; }

.info-card {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: 12px;
  padding: 16px; margin-bottom: 12px; text-align: center;
}
.info-label { font-size: 12px; color: var(--texto-suave); font-weight: 700; letter-spacing: 0.5px; }
.info-value { font-size: 20px; font-weight: 700; margin: 4px 0 12px; }
.btn-soporte {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: #e9f9f0; color: var(--verde-oscuro); font-weight: 600;
  padding: 8px 16px; border-radius: 20px; font-size: 14px;
}

.pago-card { display: flex; align-items: center; justify-content: space-between; text-align: left; gap: 8px; }
.pago-label { color: var(--verde-oscuro); }
.pago-valor { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-copiar {
  background: var(--verde); color: white; border: none; border-radius: 8px;
  width: 36px; height: 36px; font-size: 16px; cursor: pointer;
}

.buscador { margin-bottom: 16px; }
.buscador input {
  width: 100%; padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--gris-borde); background: var(--gris-card); font-size: 15px;
}

.grid-tiquets {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.tiquet {
  aspect-ratio: 1; border: none; border-radius: 12px;
  background: var(--gris-card); color: var(--texto);
  font-size: 20px; font-weight: 700; cursor: pointer;
}
.tiquet:disabled { cursor: not-allowed; opacity: 0.6; }
.tiquet.reservado { background: #fde68a; color: #92400e; }
.tiquet.pagado { background: #fecaca; color: #991b1b; }
.tiquet.seleccionado { background: var(--verde); color: white; box-shadow: 0 0 0 3px rgba(31,174,95,0.35); }

.resumen {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--oscuro); color: white;
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
  max-width: 480px; margin: 0 auto; border-radius: 16px 16px 0 0;
}
.resumen-label { display: block; font-size: 11px; color: #94a3b8; font-weight: 700; letter-spacing: 0.5px; }
.resumen strong, .modal-total strong { font-size: 22px; color: var(--verde); }
.btn-reservar {
  background: var(--verde); color: white; border: none; font-weight: 800;
  padding: 14px 28px; border-radius: 12px; font-size: 15px; cursor: pointer;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,0.6);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal { background: white; border-radius: 20px 20px 0 0; padding: 24px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal h2 { font-size: 24px; font-weight: 800; margin-bottom: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  background: #e9f9f0; color: var(--verde-oscuro); border-radius: 20px;
  padding: 6px 10px; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px;
}
.chip button { background: #fee2e2; color: #b91c1c; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; cursor: pointer; }

.modal-total {
  background: var(--oscuro); border-radius: 14px; padding: 16px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.modal-total-icon {
  background: rgba(255,255,255,0.08); width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}

.field-label { display: block; font-size: 12px; font-weight: 700; color: var(--texto-suave); margin-bottom: 6px; }
#f-nombre {
  width: 100%; padding: 14px; border-radius: 10px; border: 1px solid var(--gris-borde);
  background: var(--gris-card); margin-bottom: 16px; font-size: 15px;
}
.tel-row {
  display: flex; align-items: center; border: 1px solid var(--gris-borde);
  background: var(--gris-card); border-radius: 10px; margin-bottom: 20px; overflow: hidden;
}
.tel-flag { padding: 14px; font-weight: 600; border-right: 1px solid var(--gris-borde); }
.tel-row input { flex: 1; border: none; background: transparent; padding: 14px; font-size: 15px; }
.tel-row input:focus { outline: none; }

.btn-confirmar {
  width: 100%; background: var(--verde); color: white; border: none;
  padding: 16px; border-radius: 12px; font-weight: 800; font-size: 16px; cursor: pointer; margin-bottom: 10px;
}
.btn-cancelar {
  width: 100%; background: transparent; color: var(--texto-suave); border: none;
  padding: 12px; font-size: 15px; cursor: pointer;
}

.hidden { display: none !important; }
.msg { text-align: center; padding: 10px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.msg.error { background: #fee2e2; color: #991b1b; }
.msg.exito { background: #dcfce7; color: #166534; }