/* ============================================================
   /dia-nino — Estilos del registro Dia del Nino.
   Se carga como <link rel="stylesheet"> desde el template
   functions/templates/web/dia_nino.html.

   Convencion: todo prefijado con .dn-* para no colisionar con
   el sitio principal.
   ============================================================ */


/* ===== BOTON DE MUSICA (flotante sutil, esquina inferior izquierda) =====
   Discreto: solo aparece en /dia-nino, no autoplay, click para prender/apagar.
   Volumen bajo (0.10) para que sea ambiental, no protagonista. */
.dn-music-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #6b7280;
    font-size: 1rem;
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.dn-music-btn:hover {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(85, 102, 43, 0.15);
}
.dn-music-btn.playing {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    animation: dn-music-pulse 2.5s ease-in-out infinite;
}
@keyframes dn-music-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(85, 102, 43, 0.25); }
    50%      { box-shadow: 0 4px 16px rgba(85, 102, 43, 0.5); }
}
@media (max-width: 575px) {
    .dn-music-btn { bottom: 88px; left: 16px; width: 40px; height: 40px; }
}


/* ===== BANNER DE MODO PRUEBA (solo con ?preview=1) =====
   Fixed encima de todo (incluido el navbar del sitio que es fixed-top).
   Cuando visible, el hero baja su padding-top con la clase .with-banner. */
.dn-preview-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;   /* encima del navbar (que suele ser ~1030) */
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    text-align: center;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
    display: none;
    border-bottom: 3px solid #78350f;
}
.dn-preview-banner.visible { display: block; }
.dn-preview-banner strong { color: #78350f; }
.dn-preview-banner .badge {
    display: inline-block;
    background: #78350f;
    color: #fef3c7;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    margin-right: 10px;
}
/* Cuando hay banner, empujar TODO el sitio hacia abajo (incluye navbar) */
body.dn-with-banner { padding-top: 46px; }
body.dn-with-banner .navbar.fixed-top { top: 46px !important; }


/* ===== HERO SIMPLE (solo titulo con emoji) ===== */
.dn-hero {
    background: transparent;
    padding: 140px 16px 20px;
    text-align: center;
}
@media (max-width: 991px) { .dn-hero { padding: 115px 16px 18px; } }
@media (max-width: 575px) { .dn-hero { padding: 100px 16px 14px; } }

.dn-hero h1 {
    font-weight: 800;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.dn-hero h1 .emoji {
    display: inline-block;
    margin-right: 10px;
    animation: dn-bounce 2.5s ease-in-out infinite;
}
@keyframes dn-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.dn-hero .lead {
    color: #4b5563;
    font-size: 1rem;
    max-width: 640px;
    margin: 10px auto 0;
    line-height: 1.5;
}


/* ===== CONTENEDOR PRINCIPAL ===== */
.dn-section {
    padding: 10px 16px 80px;
}
.dn-container {
    max-width: 960px;
    margin: 0 auto;
}


/* ===== PROGRESS BAR DE PASOS ===== */
.dn-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 640px;
    margin: 0 auto 32px;
    position: relative;
}
.dn-stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: #e5e7eb;
    z-index: 0;
}
.dn-stepper .dn-step-fill {
    position: absolute;
    top: 20px;
    left: 20px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
    z-index: 1;
    transition: width 0.4s ease;
    width: 0;
}
.dn-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.dn-step-num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #9ca3af;
    transition: all 0.3s ease;
    font-size: 1rem;
}
.dn-step.active .dn-step-num {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-color: var(--primary-blue);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(85, 102, 43, 0.35);
}
.dn-step.done .dn-step-num {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}
.dn-step-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6b7280;
    text-align: center;
    letter-spacing: 0.02em;
}
.dn-step.active .dn-step-label,
.dn-step.done .dn-step-label {
    color: var(--primary-blue);
}


/* ===== CARDS DE PASO ===== */
.dn-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow:
        0 20px 50px rgba(30, 58, 138, 0.10),
        0 0 0 1px rgba(30, 41, 59, 0.05);
    display: none;
}
.dn-card.active {
    display: block;
    animation: dn-fade-in 0.4s ease;
}
@keyframes dn-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dn-card h2 {
    color: var(--primary-blue);
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dn-card h2 i { color: var(--secondary-blue); }
.dn-card .subtitulo {
    color: #6b7280;
    font-size: 0.92rem;
    margin: 0 0 24px;
}


/* ===== FORM INPUTS ===== */
.dn-card .form-label {
    color: var(--primary-blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.dn-card .form-control,
.dn-card .form-select {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dn-card .form-control:focus,
.dn-card .form-select:focus {
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 4px rgba(85, 102, 43, 0.15);
}


/* ===== BOTONES DE PASO ===== */
.dn-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    gap: 12px;
}
.dn-btn {
    padding: 12px 26px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dn-btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    box-shadow: 0 6px 16px rgba(85, 102, 43, 0.28);
}
.dn-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(85, 102, 43, 0.38);
}
.dn-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.dn-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}
.dn-btn-secondary:hover { background: #e5e7eb; }
.dn-btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.dn-btn-danger:hover { background: #fecaca; }


/* ===== PASO 2: NIÑOS REGISTRADOS ===== */
.dn-ninios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 22px 0 12px;
}
.dn-ninios-header h3 {
    margin: 0;
    color: #111827;
    font-size: 1.05rem;
    font-weight: 700;
}
.dn-contador {
    background: #f0fdf4;
    color: #166534;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid #bbf7d0;
}

.dn-ninios-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.dn-ninio-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}
.dn-ninio-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.dn-ninio-info { flex: 1; min-width: 0; }
.dn-ninio-info strong {
    display: block;
    color: #111827;
    font-weight: 700;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dn-ninio-info small {
    color: #6b7280;
    font-size: 0.8rem;
}
.dn-ninio-badge {
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    white-space: nowrap;
}
.dn-ninios-vacio {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
    font-style: italic;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}


/* ===== SELECTOR DE REGALO (cards visuales) ===== */
.dn-regalos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 4px;
}
.dn-regalo-card {
    padding: 16px;
    border-radius: 14px;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 12px;
    align-items: center;
    text-align: left;
}
.dn-regalo-card:hover {
    border-color: var(--secondary-blue);
    background: #f8fafc;
    transform: translateY(-1px);
}
.dn-regalo-card.selected {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfccb 100%);
    box-shadow: 0 4px 12px rgba(85, 102, 43, 0.18);
}
.dn-regalo-emoji {
    font-size: 1.8rem;
    flex-shrink: 0;
}
.dn-regalo-nombre {
    display: block;
    font-weight: 700;
    color: #111827;
    font-size: 0.92rem;
    margin-bottom: 2px;
}
.dn-regalo-desc {
    color: #6b7280;
    font-size: 0.78rem;
    line-height: 1.35;
}


/* ===== PASO 3: ENCUESTA (compacta, sin tanto scroll) ===== */
.dn-encuesta-intro {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfccb 100%);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    border: 1px dashed rgba(85, 102, 43, 0.3);
    color: #14532d;
    font-size: 0.82rem;
}
.dn-encuesta-intro strong { color: #14532d; }

.dn-preg-group {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}
.dn-preg-group:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.dn-preg-titulo {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #111827;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 8px;
}
.dn-preg-titulo i { color: var(--primary-blue); font-size: .95rem; }

/* Cards clickeables compactas */
.dn-opcion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
    margin-top: 4px;
}
.dn-opcion-card {
    padding: 8px 6px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.25;
}
.dn-opcion-card:hover {
    border-color: var(--secondary-blue);
    background: #f8fafc;
}
.dn-opcion-card.selected {
    border-color: var(--primary-blue);
    background: linear-gradient(135deg, #f0fdf4, #ecfccb);
    color: var(--primary-blue);
    font-weight: 700;
}
.dn-opcion-card .emoji {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 2px;
}
.dn-opcion-card small { font-size: 0.7rem; opacity: 0.75; }

/* Sub-opciones compactas */
.dn-sub-opciones {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    display: none;
}
.dn-sub-opciones.visible { display: block; }
.dn-sub-opciones label {
    font-size: 0.75rem;
    color: #6b7280;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}


/* ===== CONTADORES DE NINIOS ===== */
.dn-contadores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.dn-contador-input {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
}
.dn-contador-input label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 6px;
}
.dn-contador-input input {
    width: 60px;
    text-align: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
}
@media (max-width: 575px) {
    .dn-contadores-grid { grid-template-columns: 1fr; }
}


/* ===== ERRORES Y ALERTAS ===== */
.dn-error {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.9rem;
    margin-bottom: 16px;
    display: none;
}
.dn-error.visible { display: block; }


/* ===== PANTALLA DE ÉXITO ===== */
.dn-exito {
    text-align: center;
    padding: 50px 24px;
    display: none;
}
.dn-exito.visible { display: block; animation: dn-fade-in 0.5s ease; }
.dn-exito-emoji {
    font-size: 4.5rem;
    margin-bottom: 16px;
    line-height: 1;
    animation: dn-bounce 2s ease-in-out infinite;
}
/* Sobrescribir el flex de .dn-card h2 para centrar bien */
.dn-exito h2 {
    color: var(--primary-blue);
    font-weight: 800;
    margin: 0 auto 12px;
    display: block !important;   /* pisa el flex de .dn-card h2 */
    text-align: center;
    font-size: 1.6rem;
    letter-spacing: -0.01em;
}
.dn-exito p {
    color: #4b5563;
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.55;
}
.dn-exito .dn-actions {
    justify-content: center;
    margin-top: 28px;
}


/* ===== LOADER OVERLAY ===== */
.dn-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    backdrop-filter: blur(4px);
}
.dn-loader.visible { display: flex; }
.dn-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: dn-spin 0.9s linear infinite;
}
@keyframes dn-spin {
    to { transform: rotate(360deg); }
}
.dn-loader p {
    color: var(--primary-blue);
    font-weight: 700;
    margin: 0;
}


/* ===== ESTADO "NO HAY EVENTO ACTIVO" ===== */
.dn-no-evento {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
    padding: 40px 24px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.08);
}
.dn-no-evento .emoji { font-size: 3.5rem; margin-bottom: 12px; }
.dn-no-evento h2 { color: #111827; margin: 0 0 8px; }
.dn-no-evento p { color: #6b7280; margin: 0 0 20px; }
