@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --verde: #224534;
  --verde-claro: #2f5f49;
  --dorado: #9c8a63;
  --dorado-claro: #b8a681;
  --crema: #f6f7f8;
  --gris: #2f3438;
  --gris-claro: #e9ecef;
  --blanco: #ffffff;
  --sombra: 0 10px 30px rgba(16, 24, 40, 0.08);
  --radio: 12px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--crema);
  min-height: 100vh;
  color: var(--gris);
}

/* ─── PANTALLAS ─── */
.pantalla { display:none; min-height:100vh; }
.pantalla.activa { display:flex; flex-direction:column; }

/* ─── HEADER ─── */
.header {
  background: var(--verde);
  color: white;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-escudo {
  width: 48px; height: 48px;
  background: var(--dorado);
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  font-size: 22px; flex-shrink:0;
}
.header-texto h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  line-height: 1.2;
}
.header-texto p { font-size: 0.75rem; opacity:0.8; }

/* ─── PANTALLA INICIO ─── */
#inicio {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(circle at 20% 10%, #ffffff 0%, #f4f6f8 60%, #edf1f4 100%);
}

.hero {
  text-align: left;
  max-width: 760px;
  width: 100%;
  background: #fff;
  border: 1px solid #e8ebee;
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--sombra);
}
.hero-badge {
  display: inline-block;
  background: #f3f4f6;
  color: var(--verde);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  color: #15222f;
  line-height: 1.15;
  margin-bottom: 12px;
}
.hero h2 span { color: var(--verde); }
.hero p {
  color: #5f6b76;
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.acciones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
@media(max-width:480px){ .acciones{ grid-template-columns:1fr; } }

.card-accion {
  background: #ffffff;
  border: 1px solid #e3e8ed;
  border-radius: var(--radio);
  padding: 22px 18px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--gris);
}
.card-accion:hover {
  border-color: #cfd8df;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
  transform: translateY(-3px);
}
.card-accion .icono {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}
.card-accion h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.card-accion p { font-size: 0.82rem; opacity:0.78; line-height:1.5; }

.unirse-form {
  background: #f8fafb;
  border: 1px solid #e3e8ed;
  border-radius: var(--radio);
  padding: 18px;
}
.unirse-form h3 {
  color: var(--gris);
  font-family: 'Playfair Display', serif;
  margin-bottom: 14px;
  font-size: 1rem;
}
.input-row { display:flex; gap:10px; }
.input-row input {
  flex:1;
  background: #fff;
  border: 1px solid #d7dee6;
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--gris);
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.input-row input::placeholder { color:#9aa5b1; letter-spacing:1px; text-transform:none; }
.input-row input:focus { outline:none; border-color:var(--verde); }

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-dorado { background: var(--dorado); color: white; }
.btn-dorado:hover { background: var(--dorado-claro); transform:translateY(-1px); }
.btn-verde { background: var(--verde); color: white; }
.btn-verde:hover { background: var(--verde-claro); }
.btn-outline {
  background: #fff;
  border: 1px solid var(--verde);
  color: var(--verde);
}
.btn-outline:hover { background: var(--verde); color: white; }
.btn-rojo { background: #c0392b; color: white; }
.btn-rojo:hover { background: #e74c3c; }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 10px; }
.btn:disabled { opacity:0.5; cursor:not-allowed; transform:none !important; }

/* ─── PANTALLA REUNIÓN ─── */
#reunion {
  flex-direction: column;
}

.reunion-header {
  background: #ffffff;
  color: var(--gris);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid #e6eaee;
}
.reunion-header-izq { display:flex; align-items:center; gap:12px; }
.reunion-header-izq span { font-size:0.78rem; opacity:0.7; }

.codigo-badge {
  background: #f8fafb;
  border: 1px solid #dce3ea;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.codigo-badge .label { font-size:0.7rem; opacity:0.75; display:block; color:#5f6b76; }
.codigo-badge .codigo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 4px;
  font-family: monospace;
  color: var(--verde);
}
.btn-copiar {
  background: var(--dorado);
  border: none;
  color: white;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-copiar:hover { background: var(--dorado-claro); }

.reunion-body {
  flex: 1;
  padding: 24px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.estado-reunion {
  background: white;
  border-radius: var(--radio);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--sombra);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.estado-reunion .info { display:flex; align-items:center; gap:10px; }
.dot-verde {
  width: 10px; height: 10px;
  background: #27ae60;
  border-radius: 50%;
  animation: pulso 2s infinite;
}
@keyframes pulso {
  0%,100%{ box-shadow:0 0 0 0 rgba(39,174,96,0.5); }
  50%{ box-shadow:0 0 0 6px rgba(39,174,96,0); }
}

.asistentes-count {
  background: var(--verde);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ─── FORMULARIO ─── */
.formulario-card {
  background: white;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
  border: 1px solid #e7ebef;
}
.form-header {
  background: #fff;
  color: var(--gris);
  padding: 20px 24px;
  border-bottom: 1px solid #e8edf2;
}
.form-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  margin-bottom: 4px;
}
.form-header p { font-size: 0.82rem; opacity:0.85; }

.form-body { padding: 24px; }

.form-seccion {
  margin-bottom: 24px;
}
.form-seccion-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--verde);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gris-claro);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:560px){ .form-grid{ grid-template-columns:1fr; } }
.col-full { grid-column: 1/-1; }

.campo { display:flex; flex-direction:column; gap:5px; }
.campo label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gris);
}
.campo label .req { color: var(--dorado); margin-left:2px; }

.campo input, .campo select, .campo textarea {
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 10px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--gris);
  transition: border-color 0.2s;
  background: var(--crema);
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--verde);
  background: white;
}
.campo textarea { resize:vertical; min-height:72px; }

.firma-area {
  border: 1.5px dashed #ccc;
  border-radius: 8px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--crema);
  cursor: pointer;
  font-size: 0.82rem;
  color: #999;
  transition: border-color 0.2s;
}
.firma-area:hover { border-color: var(--verde); }

.firma-wrap {
  background: #fff;
  border: 1px dashed #c6d1dc;
  border-radius: 10px;
  padding: 8px;
}

#firma-canvas {
  width: 100%;
  height: 140px;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: crosshair;
  touch-action: none;
}

.firma-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.firma-estado {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 600;
}

.firma-estado.ok {
  color: #1f7a46;
}

.form-footer {
  padding: 20px 24px;
  background: #fafbfc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.estado-envio {
  font-size: 0.82rem;
  color: var(--verde);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── LISTA ASISTENTES ─── */
.asistentes-panel {
  background: white;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid #e7ebef;
}
.panel-header {
  padding: 16px 20px;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--verde);
}
.lista-asistentes { padding: 0; }
.asistente-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #eef1f4;
  font-size: 0.88rem;
}
.asistente-item:last-child { border-bottom:none; }
.avatar {
  width: 34px; height:34px;
  border-radius: 50%;
  background: var(--verde);
  color: white;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:0.85rem; flex-shrink:0;
}
.asistente-info { flex:1; }
.asistente-nombre { font-weight:600; }
.asistente-cargo { font-size:0.78rem; color:#888; }
.badge-enviado {
  background: #e8f8ed;
  color: #27ae60;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight:700;
}
.badge-pendiente {
  background: #fff3e0;
  color: #e67e22;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight:700;
}

/* ─── PANTALLA FINALIZAR ─── */
#finalizar {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.finalizar-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--sombra);
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  text-align: center;
  border: 1px solid #e7ebef;
}
.finalizar-top {
  background: #fff;
  padding: 40px 32px 32px;
  color: var(--gris);
  border-bottom: 1px solid #edf1f4;
}
.check-grande {
  width: 72px; height:72px;
  background: #eef3ef;
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  font-size: 2.2rem;
  margin: 0 auto 16px;
  border: 1px solid #d6e2d8;
}
.finalizar-top h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.finalizar-top p { opacity:0.75; font-size:0.9rem; }
.finalizar-body { padding: 32px; }
.stats-fila {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.stat-box {
  background: var(--gris-claro);
  border-radius: 10px;
  padding: 16px;
}
.stat-box .num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--verde);
  font-family: 'Playfair Display', serif;
}
.stat-box .etiq { font-size: 0.78rem; color: #888; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--verde);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.visible { transform:translateY(0); opacity:1; }

/* ─── MARCA DE AGUA ─── */
.watermark {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 0.7rem;
  color: #999;
  opacity: 0.5;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  letter-spacing: 0.5px;
  z-index: 10;
}

/* SEPARADOR */
.sep { height:1px; background: var(--gris-claro); margin: 20px 0; }

/* ═══════════════════════════════════
   ESTILOS MEJORADOS PARA MODALES
═══════════════════════════════════ */

/* BÚSQUEDA POR CÉDULA - MEJORADA */
#seccion-busqueda {
  background: linear-gradient(135deg, #f8fbf9 0%, #f0f4f8 100%);
  border: 2px solid var(--verde);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(34, 69, 52, 0.08);
}

#seccion-busqueda .form-seccion-titulo {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--verde);
  margin-bottom: 18px;
  letter-spacing: 1px;
}

.busqueda-input {
  width: 100%;
  padding: 16px;
  border: 2px solid #dfe6ed;
  border-radius: 10px;
  font-size: 1.05rem;
  color: var(--gris);
  background: white;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 14px;
  transition: all 0.2s;
}

.busqueda-input:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 4px rgba(34, 69, 52, 0.1);
  background: white;
}

.busqueda-input::placeholder {
  color: #a0aab3;
  font-size: 1rem;
}

.busqueda-botones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.btn-buscar,
.btn-registrar {
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-buscar {
  background: var(--dorado);
  color: white;
  border: none;
}

.btn-buscar:hover {
  background: var(--dorado-claro);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(156, 138, 99, 0.3);
}

.btn-registrar {
  background: white;
  color: var(--verde);
  border: 2px solid var(--verde);
}

.btn-registrar:hover {
  background: var(--verde);
  color: white;
  transform: translateY(-2px);
}

.busqueda-ayuda {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.6;
  margin: 0;
  font-weight: 500;
}

/* Responsive mobile */
@media (max-width: 600px) {
  #seccion-busqueda {
    padding: 20px;
    margin-bottom: 20px;
  }

  .busqueda-input {
    padding: 14px;
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .busqueda-botones {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .btn-buscar,
  .btn-registrar {
    padding: 16px;
    font-size: 0.95rem;
  }

  .busqueda-ayuda {
    font-size: 0.85rem;
  }
}

/* ═══════════════════════════════════ */

/* MODAL ACTA DE REUNIÓN — rediseño */
.acta-modal {
  max-width: 680px;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.acta-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--verde);
  color: white;
  padding: 22px 28px;
}

.acta-modal-icon {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.acta-modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 3px;
  color: white;
  border: none;
  padding: 0;
}

.acta-modal-header p {
  font-size: 0.8rem;
  opacity: 0.8;
  margin: 0;
  color: white;
}

.acta-modal-body {
  padding: 24px 28px;
  display: grid;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

.acta-campo {
  background: #f8fbf9;
  border: 1px solid #e2eae3;
  border-radius: 12px;
  padding: 14px 16px;
}

.acta-campo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.acta-num {
  width: 24px; height: 24px;
  background: var(--verde);
  color: white;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.acta-num.req-num {
  background: var(--dorado);
}

.acta-campo-header label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gris);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.acta-responsable-box {
  background: white;
  border: 1.5px solid #dce6dd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--verde);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.acta-campo textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #dce6dd;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--gris);
  background: white;
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.55;
}

.acta-campo textarea:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(34,69,52,0.08);
}

.acta-campo textarea::placeholder {
  color: #a5b4aa;
  font-size: 0.85rem;
}

.acta-modal .modal-btns {
  padding: 16px 28px 24px;
  border-top: 1px solid #edf1f4;
  background: #fafcfa;
}

/* MODAL REGISTRO RÁPIDO */
#modal-registrar .modal {
  max-width: 650px;
}

#modal-registrar .modal h3 {
  font-size: 1.6rem;
  margin-bottom: 24px;
  color: var(--verde);
  display: flex;
  align-items: center;
  gap: 10px;
}

#modal-registrar .modal > div {
  background: #f8fbf9;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e8eef5;
}

#modal-registrar input,
#modal-registrar select {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #dfe6ed;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--gris);
  background: white;
  transition: all 0.2s;
  margin-bottom: 12px;
}

#modal-registrar input:focus,
#modal-registrar select:focus {
  outline: none;
  border-color: var(--verde);
  background: #fafbfc;
  box-shadow: 0 0 0 3px rgba(34, 69, 52, 0.08);
}

#modal-registrar input::placeholder {
  color: #a0aab3;
}

/* ═══════════════════════════════════ */

/* ─── MODAL ─── */
.modal-overlay {
  display:none;
  position:fixed; inset:0;
  background: rgba(0,0,0,0.55);
  z-index:1000;
  align-items:center; justify-content:center;
  padding: 20px;
}
.modal-overlay.activo { display:flex; }
.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 380px;
  width:100%;
  text-align:center;
  box-shadow: 0 16px 60px rgba(0,0,0,0.3);
}
.modal h3 {
  font-family:'Playfair Display',serif;
  font-size:1.3rem;
  color:var(--verde);
  margin-bottom:10px;
}
.modal p { font-size:0.9rem; color:#666; margin-bottom:24px; line-height:1.6; }
.modal-btns { display:flex; gap:10px; justify-content:center; }

@media (max-width: 768px) {
  .hero {
    padding: 22px;
    border-radius: 14px;
  }

  .reunion-header {
    padding: 12px 14px;
    gap: 10px;
  }

  .reunion-header-izq {
    width: 100%;
  }

  .codigo-badge {
    width: 100%;
    justify-content: space-between;
  }

  .reunion-body {
    padding: 14px;
  }

  .estado-reunion {
    padding: 12px 14px;
  }

  .form-header,
  .form-body,
  .form-footer,
  .panel-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .form-footer .btn,
  .panel-header .btn {
    width: 100%;
  }

  .input-row {
    flex-direction: column;
  }

  #firma-canvas {
    height: 130px;
  }

  .asistente-item {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
}
