/* ============================================================
   app.css – Estilos universales para HappyTime
   ============================================================ */

/* ========== Variables ========== */
:root {
  --crimson: #8a000b;  
  --midnight: #0a2540;  
  --teal: #0f766e;      
  --gold: #c99a2e;      
  --slate: #64748b;     
  --leaf: #2e7d32;      

  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;

  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow: 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 6px 18px rgba(0,0,0,.08);

  --container: 1200px;
}

/* ========== Reset + Layout base centrado ========== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  line-height: 1.45;
}

/* ========== Tipografía ========== */
h1,h2,h3 { margin:0 0 .75rem; color: #ffffff; line-height: 1.2; }
h1 { font-size: 3rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: .5rem 0; }
small, .muted { color: var(--slate); font-size: .92rem; }
.hl { color: var(--crimson); font-weight: 800; }

/* ========== Layout / Containers ========== */
.container {
  background-image: url('../img/glow2.png');
  background-repeat: no-repeat;
  background-size: contain;      /* ajusta la imagen al tamaño del contenedor */
  background-position: top center; /* centra la imagen */
 /* background: linear-gradient(162deg, #FFA533 10%, #FF7338 30%, #9B1695 80%);*/
  max-width: var(--container);
  width: 100%;
  margin:0px auto;
  border-radius: 25px;
  padding:0px 20px;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

.personaje {
  padding: 0px;
}

.personaje-img {
    width:550px;
    
    animation: float 4s ease-in-out infinite;
}

/* Animación bounce */
@keyframes float {
  0%, 100% { transform: translateY(-10px); }
  50% { transform: translateY(-20px); }
}

.card {
  /*background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;*/
  vertical-align: middle;
  margin: auto;
  width:550px;
}

.card--muted { background: #fafafa; }

.grid-2 {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 120px;
  align-items: start;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .personaje-img { width:100%; margig:0px auto;}
}

/* ========== Header / Usuario ========== */
.header { text-align: center; margin-bottom: 12px; }
.user-name { font-size: 1.5rem; font-weight: 800; text-align: center; margin: 0; }
.user-id { font-size: .95rem; color: var(--slate); text-align: center; margin: 4px 0 16px; }
.level-info { margin-top: 12px; font-weight: 700; text-align: center; font-size:1.1rem; }

/* ========== Formularios ========== */
.consulta-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
    padding-top: 30px;
    padding-bottom: 30px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
}

.update-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
    padding-top: 30px;
    padding-bottom: 30px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
}

.cedula-input {
  width: 100%; 
  max-width: 300px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid #ccc; border-radius: 8px;
  font-size: 2rem; font-weight: 600; letter-spacing: 0.05rem;
  margin-left: auto;
  margin-right: auto; 
}

.cedula-input:focus { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 3px rgba(138,0,11,.2); }

/* ========== Error Message ========== */
.input-error {
  display: none;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #c00;
  background-color: rgba(255, 255, 255, 0.7);
  color: #8a000b;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: center; /* Alinea el texto al centro */
  width: 100%; /* Ocupa todo el ancho disponible */
  max-width: 300px; /* Establece un máximo para que no se estire demasiado */
  margin-left: auto;
  margin-right: auto; /* Centra el contenedor de error */
}

/* ========== Botones ========== */
.btn {
  width: 180px; max-width: 90%;
  padding: 0.6rem; font-size: 1rem; text-align: center;
  border: none; border-radius: 10px; cursor: pointer;
  background: var(--crimson); color: #fff; font-weight: 700;
  box-shadow: var(--shadow); text-decoration: none;
}

.btn:hover { filter: brightness(.95); text-decoration: none; color:8a000b; }
.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: #ffffff;
  margin: 10px auto;          /* centra el botón en el footer */
  display: inline-flex;
  justify-content: center;
}

.btn--full { width: 100%; }

/* Footer interno de tarjetas con botones centrados */
.footer {
  margin-top: 18px; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; align-items: center;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ========== Alertas / Estados ========== */
.alert { padding: 12px; border-radius: 10px; border: 1px solid var(--border); margin: 10px 0;  margin:10px auto;}
.alert--ok { color: #0b5f2a; background: rgba(46,125,50,.08); border-color: rgba(46,125,50,.25); margin:10px auto;}
.alert--warn { color: #fff; background: rgba(0,0,0,.15); border-color: rgba(0,0,0,.25); margin:10px auto;}
.alert--bad { color: #8a000b; background: rgba(138,0,11,.08); border-color: rgba(138,0,11,.3); margin:10px auto;}

/* ========== Productos – cajas individuales 250x350 ========== */
.products-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* centrado horizontal */
  gap: 20px;
  margin-top: 15px;
}
.products-grid .product-card {
  display: flex;
  flex-direction: column;
  align-items: center;      /* centra contenido dentro de la caja */
  justify-content: flex-start;
  width: 250px;
  height: 250px;
  padding: 0;
  border-radius: 12px;
  border: 1px #ffffff solid;
  text-align: center;
  color: #fff;              /* texto blanco por defecto */
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  overflow: hidden;         /* evita desbordes de texto/img */
}

/* Colores por nivel (fondo) */
.products-level-1 .product-card { background-color: #f2632e; }
.products-level-2 .product-card { background-color: #fbac18; }
.products-level-3 .product-card { background-color: #ef3c6b; }

.products-grid .product-card img {
  width: 250px; height: 250px;
  object-fit: contain;
}
.products-grid .product-card h3 {
  margin: 6px 0 6px;
  font-size: 1.3rem; font-weight: 700;
  color: #ffffff !important;
}
.products-grid .product-card p {
  margin: 0;
  font-size: 1.2rem;
  color: #ffffff !important;
}

/* Responsive: en mobile, una debajo de la otra */
@media (max-width: 768px) {
  .products-grid { flex-direction: column; gap: 16px; align-items: center; }
  .products-grid .product-card { width: 90%; max-width: 300px; height: 300px; }
  .products-grid .product-card img {width: 300px; height: 300px; object-fit: contain;}
  .personaje-img { width:100%;}
  .card { width:100%;}

}

/* ========== Footer marcas participantes (siempre centrado) ========== */
.site-footer {
  display: flex; justify-content: center; align-items: center;
  width: 100%;
  padding: 2rem 0;
  margin-top: auto;
  background: transparent;
}
.site-footer .footer-inner {
  width: 100%; max-width: 1400px;
  margin: 0 auto;
  display: flex; justify-content: center; align-items: center;
  padding: 0 1rem;
}
.site-footer .footer-img {
  width: 90%; max-width: 1200px;
  height: auto; display: block;
  border-radius: 12px; background: #fff;
  margin-left: auto; margin-right: auto; /* centra la imagen */
}
@media (max-width: 768px) {
  .site-footer .footer-img { width: 95%; max-width: none; }
}

/* ========== Modal (ajustado) ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-backdrop.active { display: flex; opacity: 1; }
.modal {
  position: relative;
  width: min(90%, 600px);
  max-height: 80vh;
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow-y: auto;
  padding: 20px;
  animation: modalFadeIn 0.3s ease;
}
.modal h2 { font-size: 1.4rem; text-align: center; margin-top: 0; color: var(--midnight); }
.modal .close-btn {
  position: absolute; top: 10px; right: 14px;
  background: transparent; border: none;
  font-size: 1.5rem; cursor: pointer;
  color: #444; opacity: .7; transition: opacity .2s ease;
}
.modal .close-btn:hover { opacity: 1; }

@keyframes modalFadeIn {
  from { transform: translateY(-10px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ====== Inputs unificados (texto, email, tel, date) ====== */
.consulta-form input[type="text"],
.consulta-form input[type="email"],
.consulta-form input[type="tel"],
.consulta-form input[type="date"]{
  width: 100%;
  max-width: 300px;            /* igual que .cedula-input */
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1.1rem;           /* un pelín menor que el de cédula (2rem) */
  font-weight: 600;
  letter-spacing: 0.02rem;
  background: #ffffff;         /* mismo fondo usado en formularios */
  color: #111;
  margin-left: auto;
  margin-right: auto;          /* centrado */
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* Estado focus consistente (mismo efecto que .cedula-input) */
.consulta-form input[type="text"]:focus,
.consulta-form input[type="email"]:focus,
.consulta-form input[type="tel"]:focus,
.consulta-form input[type="date"]:focus{
  outline: none;
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px rgba(138,0,11,.2);
}

/* Indicador del calendario (WebKit) – coherente con el tema */
.consulta-form input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(0.4);
  opacity: .8;
  cursor: pointer;
  transition: opacity .2s ease;
}
.consulta-form input[type="date"]::-webkit-calendar-picker-indicator:hover{
  opacity: 1;
}

/* Estados de solo lectura / deshabilitado por si los usas */
.consulta-form input[readonly],
.consulta-form input:disabled{
  background: #f5f5f5;
  color: #999;
}

/* Mantén el estilo existente del campo cédula tal cual */




/* ========== Confetti global ========== */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Contenedor que cubre toda la pantalla, sin bloquear clics */
.confetti-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 99999; /* por encima de todo */
}

/* Cada pieza de confeti */
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(
    to bottom,
    #ffe394 0%,
    #ffd34a 40%,
    #b68200 100%
  ); /* degradé dorado */
  box-shadow: 0 0 6px rgba(255,255,255,.4), 0 0 12px rgba(255,215,0,.5);
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

