:root {
  --azul: #0d2b5e;
  --azul-oscuro: #081a3d;
  --azul-medio: #1a3f7a;
  --dorado: #c9a227;
  --dorado-claro: #e8c85a;
  --blanco: #ffffff;
  --gris-claro: #f4f6fa;
  --gris: #e0e4ed;
  --texto: #1a1a2e;
  --sombra: 0 6px 28px rgba(13,43,94,0.14);
  --sombra-hover: 0 12px 40px rgba(13,43,94,0.22);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', Arial, sans-serif; color: var(--texto); background: #fff; }

/* NAV */
nav {
  background: var(--azul-oscuro);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 68px;
}
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo img { height: 48px; object-fit: contain; }
.nav-logo-text { color: var(--dorado); font-size: 1.1rem; font-weight: 700; letter-spacing: 1px; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,0.85); text-decoration: none;
  padding: 8px 13px; border-radius: 6px; font-size: 0.88rem;
  font-weight: 500; letter-spacing: 0.3px; transition: all 0.2s;
}
.nav-links a:hover { background: rgba(201,162,39,0.18); color: var(--dorado-claro); }
.nav-links a.active { color: var(--dorado); }
.nav-btn-congregate {
  background: transparent; border: 2px solid var(--dorado);
  color: var(--dorado) !important; border-radius: 6px; font-weight: 700 !important;
  padding: 7px 14px !important;
}
.nav-btn-congregate:hover { background: var(--dorado) !important; color: var(--azul-oscuro) !important; }
.nav-btn-login {
  background: var(--dorado); color: var(--azul-oscuro) !important;
  font-weight: 700 !important; border-radius: 6px; padding: 7px 16px !important;
  border: 2px solid var(--dorado);
}
.nav-btn-login:hover { background: var(--dorado-claro) !important; }
.nav-btn-logout {
  background: rgba(220,38,38,0.15); color: #ef4444 !important;
  border-radius: 30px; padding: 7px 18px !important; font-weight: 700 !important;
  border: 1.5px solid rgba(220,38,38,0.3); font-size: 0.85rem !important;
  transition: all 0.2s; white-space: nowrap;
}
.nav-btn-logout:hover { background: rgba(220,38,38,0.28) !important; color: #ef4444 !important; }
.nav-hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav-hamburger span { display: block; width: 24px; height: 2px; background: var(--dorado); border-radius: 2px; transition: 0.3s; }

/* BIBLIA BANNER */
#biblia-banner {
  background: linear-gradient(90deg, var(--azul) 0%, var(--azul-medio) 100%);
  border-bottom: 2px solid var(--dorado);
  padding: 14px 24px;
  text-align: center;
  min-height: 54px;
  position: relative; z-index: 1;
}
#biblia-banner .biblia-texto {
  color: var(--dorado-claro); font-style: italic; font-size: 1rem;
  max-width: 900px; margin: 0 auto;
}
#biblia-banner .biblia-ref {
  color: rgba(255,255,255,0.6); font-size: 0.8rem; margin-top: 3px;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul) 60%, var(--azul-medio) 100%);
  min-height: 92vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: visible; padding: 80px 24px 60px;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(201,162,39,0.08) 0%, transparent 70%);
}
.hero-content { text-align: center; position: relative; z-index: 2; max-width: 860px; overflow: visible; }

/* TORCH + LOGO ROW */
.hero-torch-logo-row {
  display: flex; align-items: center; justify-content: center;
  gap: 36px; margin-bottom: 24px; flex-wrap: wrap;
  overflow: visible; position: relative; z-index: 5;
}

/* TORCH ANIMATION — flex column: fire canvas on top, torch below */
.torch-container {
  display: flex; flex-direction: column; align-items: center;
  overflow: visible; flex-shrink: 0; position: relative;
}
.fire-canvas {
  width: 180px; height: 160px;
  margin-bottom: 0;
  position: relative; z-index: 10; pointer-events: none;
}
.torch-img {
  width: 120px; height: 220px; object-fit: contain;
  filter: drop-shadow(0 0 8px #ff6600) drop-shadow(0 0 20px rgba(255,120,0,0.5));
  animation: torchGlow 3s ease-in-out infinite;
  position: relative; z-index: 2;
  margin-top: -20px; /* compensate transparent SVG top padding so torch cup aligns with fire base */
}
@keyframes torchGlow {
  0%, 100% { filter: drop-shadow(0 0 8px #ff6600) drop-shadow(0 0 20px rgba(255,120,0,0.5)); }
  50% { filter: drop-shadow(0 0 18px #ffaa00) drop-shadow(0 0 40px rgba(255,160,0,0.7)); }
}
/* Mobile */
@media (max-width: 600px) {
  .fire-canvas { width: 130px; height: 130px; margin-bottom: 0; }
  .torch-img { width: 70px; height: 130px; margin-top: -12px; }
  .hero-torch-logo-row { gap: 6px !important; }
}
.hero-logo { width: 340px; max-width: 50vw; flex-shrink: 0; height: 365px; object-fit: contain; object-position: left center; }
.hero h1 {
  color: var(--blanco); font-size: 2.1rem; font-weight: 800;
  line-height: 1.2; letter-spacing: 0.5px; margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.hero h2 {
  color: var(--dorado-claro); font-size: 1.05rem; font-weight: 400;
  letter-spacing: 0.5px; margin-bottom: 28px; opacity: 0.9;
}
.hero-frase {
  color: var(--dorado); font-size: 1.5rem; font-weight: 700;
  font-style: italic; letter-spacing: 1px;
  border-top: 1px solid rgba(201,162,39,0.3);
  border-bottom: 1px solid rgba(201,162,39,0.3);
  padding: 12px 0; margin-bottom: 32px;
}
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--dorado); color: var(--azul-oscuro);
  padding: 13px 30px; border-radius: 8px; font-weight: 700;
  text-decoration: none; font-size: 0.95rem; transition: all 0.2s;
  border: 2px solid var(--dorado);
}
.btn-primary:hover { background: var(--dorado-claro); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,162,39,0.4); }
.btn-outline {
  background: transparent; color: var(--blanco);
  padding: 13px 30px; border-radius: 8px; font-weight: 600;
  text-decoration: none; font-size: 0.95rem; transition: all 0.2s;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { border-color: var(--dorado); color: var(--dorado); transform: translateY(-2px); }

/* SECTIONS */
section { padding: 72px 24px; }
.container { max-width: 1100px; margin: 0 auto; }
.section-title {
  font-size: 1.9rem; color: var(--azul); font-weight: 800;
  text-align: center; margin-bottom: 12px; letter-spacing: 0.3px;
}
.section-title::after {
  content: ''; display: block; width: 60px; height: 3px;
  background: var(--dorado); margin: 10px auto 0;
}
.section-subtitle {
  text-align: center; color: #555; font-size: 1rem; margin-bottom: 44px;
  max-width: 680px; margin-left: auto; margin-right: auto;
}
.bg-light { background: var(--gris-claro); }
.bg-azul { background: var(--azul-oscuro); }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 32px 26px;
  box-shadow: var(--sombra); border-top: 3px solid var(--dorado);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative; overflow: hidden;
}
.card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(201,162,39,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--sombra-hover); }
.card-icon { font-size: 2.4rem; margin-bottom: 16px; }
.card h3 { color: var(--azul); font-size: 1.08rem; font-weight: 700; margin-bottom: 10px; }
.card p { color: #555; font-size: 0.93rem; line-height: 1.7; }

/* TEXTO INSTITUCIONAL */
.inst-text { max-width: 840px; margin: 0 auto; }
.inst-text p { color: #444; font-size: 0.98rem; line-height: 1.8; margin-bottom: 16px; }
.inst-text .destacado {
  text-align: center; color: var(--azul); font-size: 1.3rem;
  font-weight: 700; font-style: italic; color: var(--dorado);
  border-left: 4px solid var(--dorado); padding: 12px 20px;
  background: rgba(201,162,39,0.07); border-radius: 0 8px 8px 0; margin: 24px 0;
}

.directiva-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px; margin-top: 36px;
}
.directiva-card {
  background: linear-gradient(160deg, #0f2d6a 0%, #0a1e4a 100%);
  border-radius: 16px; padding: 28px 20px; text-align: center;
  border: 1px solid rgba(201,162,39,0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(201,162,39,0.12);
  transition: transform 0.25s, box-shadow 0.25s;
}
.directiva-card:hover { transform: translateY(-5px); box-shadow: 0 16px 48px rgba(0,0,0,0.45); }
.directiva-card .cargo {
  color: var(--dorado); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px;
}
.directiva-card .nombre { color: var(--blanco); font-size: 1rem; font-weight: 600; margin-top: 8px; }
.directiva-card .avatar {
  width: 72px; height: 72px; border-radius: 50%; background: rgba(201,162,39,0.12);
  margin: 0 auto 14px; display: flex; align-items: center;
  justify-content: center; font-size: 1.8rem; border: 2px solid var(--dorado);
  overflow: hidden;
}
.directiva-card .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* LOCALIDADES */
.localidades-lista {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 32px;
}
.localidad-tag {
  background: var(--azul); color: var(--dorado); padding: 10px 22px;
  border-radius: 30px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid rgba(201,162,39,0.4); letter-spacing: 0.3px;
}

/* EVENTOS */
.eventos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.evento-card {
  background: #fff; border-radius: var(--radius); padding: 22px;
  box-shadow: var(--sombra); display: flex; gap: 16px; align-items: flex-start;
  border-left: 4px solid var(--dorado); transition: transform 0.2s, box-shadow 0.2s;
}
.evento-card:hover { transform: translateY(-3px); box-shadow: var(--sombra-hover); }
.evento-fecha {
  background: linear-gradient(135deg, var(--azul), var(--azul-medio));
  color: var(--dorado); padding: 10px 14px;
  border-radius: 10px; text-align: center; min-width: 56px;
  font-weight: 700; font-size: 0.87rem; line-height: 1.3;
  box-shadow: 0 4px 12px rgba(13,43,94,0.25);
}
.evento-info h4 { color: var(--azul); font-size: 0.97rem; font-weight: 700; margin-bottom: 5px; }
.evento-info p { color: #666; font-size: 0.87rem; }

/* PRENSA */
.prensa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.prensa-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--sombra); transition: transform 0.25s, box-shadow 0.25s;
}
.prensa-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-hover); }
.prensa-card-head {
  background: var(--azul); padding: 16px 20px;
  display: flex; align-items: center; gap: 10px;
}
.prensa-tipo {
  background: var(--dorado); color: var(--azul-oscuro);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  padding: 3px 10px; border-radius: 30px; letter-spacing: 0.5px;
}
.prensa-fecha { color: rgba(255,255,255,0.6); font-size: 0.8rem; margin-left: auto; }
.prensa-card-body { padding: 16px 20px; }
.prensa-card-body h4 { color: var(--azul); font-size: 0.97rem; font-weight: 700; margin-bottom: 8px; }
.prensa-card-body p { color: #666; font-size: 0.88rem; line-height: 1.6; }

/* DOCUMENTOS */
.docs-lista { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.doc-item {
  background: #fff; border-radius: 8px; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--sombra);
  text-decoration: none; transition: transform 0.2s; border: 1px solid var(--gris);
}
.doc-item:hover { transform: translateY(-2px); border-color: var(--dorado); }
.doc-icon { font-size: 2rem; color: #e53e3e; }
.doc-info span { display: block; color: var(--azul); font-weight: 600; font-size: 0.92rem; }
.doc-info small { color: #888; font-size: 0.8rem; }

/* CONTACTO */
.contacto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contacto-info h3 { color: var(--azul); font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.correo-lista { list-style: none; }
.correo-lista li { margin-bottom: 12px; }
.correo-lista a {
  color: var(--azul); text-decoration: none; font-size: 0.93rem;
  display: flex; align-items: center; gap: 10px;
}
.correo-lista a:hover { color: var(--dorado); }
.correo-lista .icono { font-size: 1.1rem; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; color: var(--azul); margin-bottom: 6px; font-size: 0.9rem; }
.form-control {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--gris);
  border-radius: 10px; font-size: 0.93rem; transition: border 0.2s, box-shadow 0.2s;
  background: #fff; color: var(--texto);
}
.form-control:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 4px rgba(13,43,94,0.08); }
textarea.form-control { min-height: 130px; resize: vertical; }
.btn-submit {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul-medio) 100%);
  color: var(--blanco); padding: 13px 28px;
  border: none; border-radius: 10px; font-weight: 700; cursor: pointer;
  font-size: 0.95rem; transition: all 0.2s; width: 100%;
  box-shadow: 0 4px 14px rgba(13,43,94,0.3);
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(13,43,94,0.4); }

/* FOOTER */
footer { background: var(--azul-oscuro); padding: 48px 24px 24px; }
.footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand img { height: 50px; margin-bottom: 14px; }
.footer-brand p { color: rgba(255,255,255,0.55); font-size: 0.87rem; line-height: 1.7; }
.footer-col h4 { color: var(--dorado); font-size: 0.88rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.87rem; transition: color 0.2s; }
.footer-col ul a:hover { color: var(--dorado-claro); }
.footer-bottom { max-width: 1100px; margin: 20px auto 0; text-align: center; color: rgba(255,255,255,0.35); font-size: 0.82rem; }

/* MODAL LOGIN */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: rgba(6,15,35,0.92);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 20px; padding: 40px 36px;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(201,162,39,0.12);
  position: relative;
}
.modal-box h2 { color: #fff; font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.modal-box p { color: rgba(255,255,255,0.55); font-size: 0.87rem; margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 16px; right: 18px; background: none; border: none;
  font-size: 1.4rem; cursor: pointer; color: rgba(255,255,255,0.4); line-height: 1;
}
.modal-close:hover { color: var(--dorado); }
.modal-box label { color: rgba(255,255,255,0.75) !important; font-size: 0.84rem; font-weight: 600; }
.modal-box .form-control {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(201,162,39,0.3) !important;
  color: #fff !important;
}
.modal-box .form-control::placeholder { color: rgba(255,255,255,0.3) !important; }
.modal-box .form-control:focus {
  border-color: var(--dorado) !important;
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15) !important;
  background: rgba(255,255,255,0.1) !important;
}
.modal-box .btn-submit {
  background: var(--dorado);
  color: var(--azul-oscuro);
  font-weight: 800;
  border: none; border-radius: 10px; padding: 14px; width: 100%;
  font-size: 1rem; cursor: pointer; transition: background 0.2s, transform 0.1s;
}
.modal-box .btn-submit:hover { background: #e0b820; transform: translateY(-1px); }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img { height: 56px; filter: brightness(1.1) drop-shadow(0 2px 8px rgba(201,162,39,0.4)); }
.alert-error { background: rgba(185,28,28,0.25); color: #fca5a5; border: 1px solid rgba(220,38,38,0.4); padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; display: none; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .contacto-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 1.6rem; }
}
@media (max-width: 768px) {
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--azul-oscuro); padding: 12px 16px 20px; gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding: 12px 16px; border-radius: 8px; text-align: center; box-sizing: border-box; }
  .nav-links .nav-btn-congregate {
    display: block; width: 100%; text-align: center;
    margin: 4px 0; padding: 11px 16px !important; border-radius: 8px;
  }
  .nav-links .nav-btn-login {
    display: block; width: 100%; text-align: center;
    margin: 4px 0; padding: 11px 16px !important; border-radius: 8px;
  }
  .nav-links .nav-btn-logout {
    display: block; width: 100%; text-align: center;
    margin: 4px 0; padding: 11px 16px !important; border-radius: 8px;
  }
  .hero h1 { font-size: 1.35rem; }
  .hero h2 { font-size: 0.93rem; }
  section { padding: 52px 16px; }
  .section-title { font-size: 1.5rem; }
  /* Mobile: torch and logo stack vertically, reduce gap to half */
  .hero-torch-logo-row { gap: 18px; flex-direction: column; align-items: center; }
  /* Scale down logo on mobile */
  .hero-logo { width: 260px; max-width: 80vw; }
}

/* UTILIDADES */
.text-center { text-align: center; }
.mt-4 { margin-top: 32px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 30px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.badge-dorado { background: rgba(201,162,39,0.15); color: var(--dorado); }

/* SCROLL TOP */
#scrollTop {
  position: fixed; bottom: 24px; right: 24px; z-index: 800;
  background: var(--dorado); color: var(--azul-oscuro);
  width: 44px; height: 44px; border-radius: 50%; border: none;
  font-size: 1.2rem; cursor: pointer; display: none; align-items: center;
  justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: all 0.2s;
}
#scrollTop:hover { transform: translateY(-3px); }
#scrollTop.show { display: flex; }
