/* ═══════════════════════════════════════════════════════════════════════════
   CBU "La Gran Carpa" — Héroes de la Biblia
   Iglesia Evangélica de Granadilla · Tema: circo / carpa
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --red: #e2231a;
  --red-dark: #b81a12;
  --cyan: #17b6c9;
  --cyan-dark: #0e8fa0;
  --cream: #fff3d6;
  --cream-2: #ffe9b8;
  --gold: #f4b63e;
  --ink: #2a2320;
  --ink-soft: #5b524c;
  --white: #ffffff;
  --ok: #1a9d4b;
  --err: #d63030;
  --shadow: 0 10px 30px rgba(42, 35, 32, 0.15);
  --radius: 16px;
  --font: 'Fredoka', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--red); }

/* ── Franja de carpa (rayas) reutilizable ─────────────────────────────────── */
.tent-stripes {
  height: 14px;
  background: repeating-linear-gradient(135deg,
      var(--red) 0 26px, var(--cyan) 26px 52px);
}

/* ── Guirnalda de bombillas ───────────────────────────────────────────────── */
.bulbs {
  height: 10px;
  background: radial-gradient(circle at 10px 50%, var(--gold) 0 4px, transparent 5px);
  background-size: 26px 10px;
  opacity: 0.9;
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
#navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.4rem;
  background: var(--red);
  box-shadow: 0 3px 14px rgba(0,0,0,0.18);
}
.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--white); font-weight: 700; font-size: 1.25rem;
  text-decoration: none; letter-spacing: 0.5px;
}
.nav-logo .emoji { font-size: 1.5rem; }
.nav-links { list-style: none; display: flex; gap: 0.4rem; align-items: center; }
.nav-links a {
  color: var(--white); text-decoration: none; font-weight: 500;
  padding: 0.4rem 0.85rem; border-radius: 50px; transition: background 0.15s;
  font-size: 0.98rem;
}
.nav-links a:hover { background: rgba(255,255,255,0.16); }
.nav-links a.nav-cta {
  background: var(--gold); color: var(--ink); font-weight: 700;
}
.nav-links a.nav-cta:hover { background: #ffc857; }
.hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 0.4rem; }
.hamburger span { display: block; width: 24px; height: 3px; background: #fff; margin: 4px 0; border-radius: 2px; }

/* ── Botones ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block; cursor: pointer; border: 0;
  font-family: var(--font); font-weight: 700; font-size: 1rem;
  padding: 0.8rem 1.8rem; border-radius: 50px; text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-dark); }
.btn-primary:hover { background: #f0322a; }
.btn-primary:active { box-shadow: 0 3px 0 var(--red-dark); }
.btn-cyan { background: var(--cyan); color: #fff; box-shadow: 0 6px 0 var(--cyan-dark); }
.btn-cyan:hover { background: #1cc7dc; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 6px 0 #cf9528; }
.btn-outline { background: transparent; color: var(--red); border: 2px solid var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
/* Variante para fondos oscuros/rojos (hero, cabecera admin): borde y texto claros */
.btn-outline-light { background: rgba(255,255,255,0.08); color: #fff; border: 2px solid rgba(255,255,255,0.92); }
.btn-outline-light:hover { background: #fff; color: var(--red); }
.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.9rem; box-shadow: none; }
.btn-lg { padding: 1rem 2.4rem; font-size: 1.15rem; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  /* Foco de circo: rojo cálido en el centro que baja a rojo oscuro (buen contraste) */
  background: radial-gradient(ellipse 120% 95% at 50% 0%, #f5473f 0%, var(--red) 48%, var(--red-dark) 100%);
  text-align: center;
  padding: 3.4rem 1.2rem 4rem;
}
.hero::before {
  /* Guirnalda/valance de carpa en el borde superior */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 16px;
  background: repeating-linear-gradient(135deg, var(--cream) 0 22px, var(--cyan) 22px 44px);
}
.hero-logo {
  max-width: 480px; width: 82%; margin: 0 auto 1.4rem;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.22));
}
.hero-badge {
  display: inline-block; background: var(--ink); color: var(--cream);
  padding: 0.35rem 1.1rem; border-radius: 50px; font-weight: 600;
  letter-spacing: 2px; font-size: 0.8rem; margin-bottom: 1rem; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.5rem); line-height: 1.0; color: var(--white);
  text-transform: uppercase; letter-spacing: 1px;
  text-shadow: 0 3px 0 var(--red-dark), 0 6px 16px rgba(0,0,0,0.25);
  margin-bottom: 0.6rem;
}
.hero h1 .cyan { color: var(--cyan); text-shadow: 0 3px 0 var(--cyan-dark), 0 6px 16px rgba(0,0,0,0.25); }
.hero-sub {
  font-size: clamp(1.05rem, 2.5vw, 1.4rem); color: var(--ink);
  background: var(--cream); display: inline-block; padding: 0.5rem 1.3rem;
  border-radius: 50px; font-weight: 600; box-shadow: var(--shadow); margin-bottom: 1.8rem;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Secciones ────────────────────────────────────────────────────────────── */
.section { max-width: 1000px; margin: 0 auto; padding: 3.5rem 1.4rem; }
.section-title {
  text-align: center; font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--red); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.6rem;
}
.section-title .cyan { color: var(--cyan); }
.section-lead { text-align: center; color: var(--ink-soft); max-width: 640px; margin: 0 auto 2.4rem; font-size: 1.1rem; }

/* Tarjetas de información */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; }
.info-card {
  background: var(--white); border-radius: var(--radius); padding: 1.8rem 1.5rem;
  box-shadow: var(--shadow); text-align: center; border-top: 6px solid var(--cyan);
  transition: transform 0.15s;
}
.info-card:nth-child(odd) { border-top-color: var(--red); }
.info-card:hover { transform: translateY(-4px); }
.info-card .ico { font-size: 2.6rem; margin-bottom: 0.6rem; }
.info-card h3 { color: var(--ink); font-size: 1.15rem; margin-bottom: 0.3rem; }
.info-card p { color: var(--ink-soft); font-size: 1rem; }
.info-card strong { color: var(--red); }

/* Banda destacada */
.band {
  background: var(--cyan);
  background-image: radial-gradient(circle at 12% 20%, rgba(255,255,255,0.18) 0 12px, transparent 13px),
                    radial-gradient(circle at 85% 80%, rgba(255,255,255,0.14) 0 16px, transparent 17px);
  color: #fff; text-align: center;
}
.band .section-title, .band .section-title .cyan { color: #fff; }
.band-inner { max-width: 760px; margin: 0 auto; padding: 3rem 1.4rem; }
.band p { font-size: 1.15rem; margin-bottom: 1.6rem; }

/* ── Formulario ───────────────────────────────────────────────────────────── */
.form-page-header {
  text-align: center; padding: 2.5rem 1.4rem 1.5rem; background: var(--red);
}
.form-page-header h1 { color: #fff; font-size: clamp(1.8rem, 5vw, 2.8rem); text-transform: uppercase; }
.form-page-header h1 .cyan { color: var(--cyan); }
.form-page-header p { color: var(--cream); font-size: 1.05rem; margin-top: 0.4rem; }

.form-wrapper { max-width: 760px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }

.aviso-box {
  background: var(--cream-2); border: 2px dashed var(--red); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: 1.8rem; color: var(--ink); font-size: 0.98rem;
}
.aviso-box a { font-weight: 700; }

.form-section {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.8rem 1.6rem; margin-bottom: 1.8rem;
}
.form-section-title {
  color: var(--red); font-size: 1.35rem; margin-bottom: 1.2rem; padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--cream-2); display: flex; align-items: center; gap: 0.5rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-group { margin-bottom: 1.15rem; }
.form-group > label {
  display: block; font-weight: 600; margin-bottom: 0.4rem; color: var(--ink); font-size: 0.98rem;
}
.req { color: var(--red); }
.field-hint { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.3rem; }
.legal-text { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.5rem; line-height: 1.5; }

input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=number], input[type=password], textarea, select {
  width: 100%; font-family: var(--font); font-size: 1rem; color: var(--ink);
  background: #fbfaf7; border: 2px solid #e6ded0; border-radius: 10px;
  padding: 0.7rem 0.9rem; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(23,182,201,0.18);
}
textarea { min-height: 90px; resize: vertical; }
input.error, textarea.error { border-color: var(--err); background: #fff5f5; }
.field-error { color: var(--err); font-size: 0.82rem; margin-top: 0.25rem; min-height: 0; display: none; }
.field-error.show { display: block; }

/* Radios y checks */
.radio-group { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-group.inline { flex-direction: row; gap: 1.4rem; flex-wrap: wrap; }
.radio-label, .check-label {
  display: flex; align-items: flex-start; gap: 0.55rem; cursor: pointer;
  font-size: 0.97rem; color: var(--ink); line-height: 1.45;
}
.radio-label input, .check-label input { margin-top: 0.25rem; width: 18px; height: 18px; accent-color: var(--red); flex-shrink: 0; }
.check-group { background: #fbfaf7; border: 2px solid #e6ded0; border-radius: 10px; padding: 0.85rem 1rem; }

/* Firma */
.signature-container {
  border: 3px solid var(--cyan); border-radius: 12px; overflow: hidden; background: #f4feff;
}
.signature-container canvas { width: 100%; height: 170px; display: block; cursor: crosshair; touch-action: none; }
.signature-actions { display: flex; justify-content: flex-end; padding: 0.4rem 0.6rem; background: #eef9fb; }
.sig-clear-btn {
  background: transparent; border: 1px solid var(--cyan-dark); color: var(--cyan-dark);
  border-radius: 50px; padding: 0.3rem 1rem; cursor: pointer; font-family: var(--font); font-size: 0.85rem;
}
.sig-clear-btn:hover { background: var(--cyan); color: #fff; }

/* Alertas y submit */
.form-alert { border-radius: 10px; padding: 0.9rem 1.1rem; margin-bottom: 1.2rem; font-weight: 600; display: none; }
.form-alert.error { display: block; background: #fdecec; color: var(--err); border: 1px solid #f5c2c2; }
.form-alert.ok { display: block; background: #e8f7ee; color: var(--ok); border: 1px solid #b6e2c6; }
.form-submit-area { text-align: center; }

/* Overlay de carga */
#loading-overlay {
  position: fixed; inset: 0; background: rgba(42,35,32,0.72); z-index: 2000;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
}
#loading-overlay.show { display: flex; }
#loading-overlay p { color: var(--cream); font-weight: 600; }
.spinner {
  width: 54px; height: 54px; border: 6px solid rgba(255,255,255,0.3);
  border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Éxito */
.success-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 620px; margin: 2rem auto; padding: 3rem 2rem; text-align: center;
}
.success-card .big { font-size: 4rem; margin-bottom: 0.6rem; }
.success-card h2 { color: var(--ok); margin-bottom: 0.8rem; }
.success-code {
  font-size: 2.4rem; font-weight: 900; color: var(--red); letter-spacing: 3px; margin: 0.6rem 0 1rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  background: var(--ink); color: var(--cream); text-align: center; padding: 2.5rem 1.4rem;
}
footer .foot-logo { font-weight: 700; font-size: 1.2rem; margin-bottom: 0.5rem; }
footer p { font-size: 0.92rem; opacity: 0.9; }
.footer-links { margin-top: 0.8rem; display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--cream); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { text-decoration: underline; }

/* ── Páginas legales ──────────────────────────────────────────────────────── */
.legal-page { max-width: 800px; margin: 0 auto; padding: 3rem 1.4rem; }
.legal-page h1 { color: var(--red); margin-bottom: 0.3rem; }
.legal-page .updated { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 2rem; }
.legal-page h2 { color: var(--cyan-dark); font-size: 1.25rem; margin: 1.8rem 0 0.6rem; }
.legal-page p, .legal-page li { color: var(--ink-soft); margin-bottom: 0.6rem; }
.legal-page ul { padding-left: 1.4rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   PANEL DE ADMINISTRACIÓN
   ═══════════════════════════════════════════════════════════════════════════ */
.admin-body { background: #f3ede1; }

.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.4rem; }
.admin-login-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2.6rem 2.2rem; max-width: 380px; width: 100%; text-align: center;
}
.admin-login-card .big { font-size: 3rem; margin-bottom: 0.6rem; }
.admin-login-card h1 { color: var(--red); margin-bottom: 0.2rem; }
.admin-login-card p { color: var(--ink-soft); margin-bottom: 1.4rem; }

.admin-panel { display: none; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  background: var(--red); padding: 1rem 1.6rem;
}
.admin-header h1 { color: #fff; font-size: 1.4rem; }
.admin-header .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.admin-content { max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-box { background: #fff; border-radius: 12px; padding: 1.2rem; text-align: center; box-shadow: var(--shadow); border-bottom: 5px solid var(--cyan); }
.stat-box.red { border-bottom-color: var(--red); }
.stat-box.gold { border-bottom-color: var(--gold); }
.stat-box .n { font-size: 2.2rem; font-weight: 900; color: var(--ink); }
.stat-box .l { color: var(--ink-soft); font-size: 0.88rem; }

.admin-toolbar { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.admin-toolbar input, .admin-toolbar select { width: auto; flex: 1; min-width: 180px; }

.table-wrap { background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--ink); color: var(--cream); text-align: left; padding: 0.8rem 0.9rem;
  font-size: 0.85rem; white-space: nowrap;
}
tbody td { padding: 0.75rem 0.9rem; border-bottom: 1px solid #eee; font-size: 0.92rem; vertical-align: top; }
tbody tr:hover { background: #fdf7ec; }

.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 50px; font-size: 0.78rem; font-weight: 600; }
.badge-ok { background: #e3f6ea; color: var(--ok); border: 1px solid #b6e2c6; }
.badge-no { background: #fdecec; color: var(--err); border: 1px solid #f3c4c4; }
.badge-info { background: #e5f7fa; color: var(--cyan-dark); border: 1px solid #b9e8ef; }

.btn-detalle {
  background: var(--cyan); color: #fff; border: 0; border-radius: 50px;
  padding: 0.35rem 0.9rem; cursor: pointer; font-family: var(--font); font-size: 0.85rem; white-space: nowrap;
}
.btn-detalle:hover { background: var(--cyan-dark); }

/* Modal */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(42,35,32,0.65); z-index: 3000;
  display: none; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto;
}
#modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); max-width: 760px; width: 100%;
  padding: 2rem 1.8rem; position: relative; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem; background: var(--cream-2); border: 0;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: var(--ink);
}
.modal h2 { color: var(--red); margin-bottom: 1.2rem; padding-right: 2rem; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.modal-section-title {
  grid-column: 1 / -1; color: var(--cyan-dark); font-weight: 700; font-size: 1.05rem;
  border-bottom: 2px solid var(--cream-2); padding-bottom: 0.3rem; margin-top: 0.6rem;
}
.modal-field { display: flex; flex-direction: column; gap: 0.15rem; }
.modal-field label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.modal-field span { color: var(--ink); font-size: 0.95rem; }
.modal-firma { grid-column: 1 / -1; }
.modal-firma img { max-width: 320px; border: 2px solid var(--cyan); border-radius: 8px; background: #f4feff; padding: 4px; }
.modal-notas { grid-column: 1 / -1; margin-top: 1rem; }
.modal-notas label { display: block; font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 0.3rem; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--red); padding: 0.6rem 1rem 1rem; gap: 0.2rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; }
  .hamburger { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
}
