/* ===== Styles spécifiques à la page de félicitations ===== */

/* Overlay plein écran pour animations Lottie (Confetti + Success) */
#success-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: none;
}

#confetti-animation {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#success-animation {
    width: 420px;
    height: 420px;
    z-index: 2;
}

.welcome-body {
    background: radial-gradient(circle at top left, #e0e6ff, #f3f4ff 45%, #f9fbff 80%);
    position: relative;
    overflow: hidden;
}

.welcome-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 20%, rgba(46, 78, 239, 0.12), transparent 60%),
        radial-gradient(circle at 90% 80%, rgba(244, 114, 182, 0.1), transparent 60%);
    z-index: -1;
}

.welcome-container {
    width: 100%;
    min-height: calc(100vh - 70px - 52px); /* viewport - header - footer */
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.welcome-card {
    position: relative;
    max-width: 540px;
    width: 100%;
    padding: 2.4rem 2.1rem 2.6rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(12px);
    text-align: center;
    animation: card-pop 0.7s ease-out forwards;
    transform: translateY(20px);
    opacity: 0;
}

@keyframes card-pop {
    0%   { transform: translateY(20px) scale(0.96); opacity: 0; }
    60%  { transform: translateY(-4px) scale(1.02); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Logo dans le cadre blanc */
.welcome-logo-bg {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 60px;
    max-width: 14vw;
    opacity: 0.9;
    pointer-events: none;
}

.welcome-title {
    margin: 0 0 0.6rem;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #1f2937;
}

.welcome-subtitle {
    margin: 0 0 1.1rem;
    font-size: 1.1rem;
    color: #4b5563;
}

.welcome-text {
    margin: 0 0 1.8rem;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #6b7280;
}

.welcome-actions {
    display: flex;
    justify-content: center;
}

/* Pulse animation sur le bouton */
.btn-pulse {
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 16px 35px rgba(46, 78, 239, 0.45); }
    50%      { box-shadow: 0 20px 45px rgba(46, 78, 239, 0.7); }
}

/* Confettis */
.confetti {
    position: absolute;
    width: 10px;
    height: 16px;
    border-radius: 4px;
    opacity: 0;
    animation: confetti-fall 3s ease-out infinite;
}

.confetti-1 { background: var(--primary-blue); left: 10%; top: -10px; animation-delay: 0.1s; }
.confetti-2 { background: #8ea2ff; left: 25%; top: -16px; animation-delay: 0.4s; }
.confetti-3 { background: var(--primary-blue); left: 50%; top: -14px; animation-delay: 0.2s; }
.confetti-4 { background: #8ea2ff; left: 70%; top: -18px; animation-delay: 0.6s; }
.confetti-5 { background: #bcc7ff; left: 86%; top: -12px; animation-delay: 0.3s; }

@keyframes confetti-fall {
    0%   { transform: translate3d(0, -10px, 0) rotateZ(0deg); opacity: 0; }
    10%  { opacity: 1; }
    60%  { transform: translate3d(-10px, 120px, 0) rotateZ(240deg); opacity: 1; }
    100% { transform: translate3d(10px, 180px, 0) rotateZ(360deg); opacity: 0; }
}

/* Lien déconnexion sous le bouton */
.dash-logout {
    display: inline-block;
    margin-top: 1.2rem;
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s;
}

.dash-logout:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* Zone vierge "Tu espacio" (plan de formación por venir) */
.dash-plan-space {
    margin: 1.5rem 0 1.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
    text-align: center;
}

.dash-plan-space-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #475569;
}

.dash-plan-space-placeholder {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

/* ===== Mise en page \"Mi espacio\" (dashboard) ===== */

.mi-espacio-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1100px;
    width: 100%;
}

.mi-espacio-left {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mi-espacio-right {
    flex: 0 0 60%;
}

.mi-espacio-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 1.2rem;
    padding: 1.6rem 1.4rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.mi-espacio-welcome {
    text-align: center;
}

.mi-espacio-title {
    margin: 0 0 0.4rem;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1f2937;
}

.mi-espacio-subtitle {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: #4b5563;
}

.mi-espacio-level {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mi-espacio-level-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.mi-espacio-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
    font-size: 0.9rem;
}

.mi-espacio-whatsapp {
    text-align: center;
}

.mi-espacio-whatsapp-text {
    margin: 0 0 0.8rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.mi-espacio-whatsapp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mi-espacio-whatsapp-logo {
    width: 140px;
    max-width: 60%;
}

.mi-espacio-logout {
    margin-top: auto;
    align-self: center;
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s;
}

.mi-espacio-logout:hover {
    color: #ef4444;
    text-decoration: underline;
}

.mi-espacio-plan {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    background: #0f172a;
}

.mi-espacio-plan iframe {
    display: block;
    border: none;
}

.mi-espacio-plan-placeholder {
    padding: 1.8rem 1.5rem;
    background: #f8fafc;
    border-radius: 1rem;
    border: 1px dashed #cbd5e1;
    text-align: center;
}

@media (max-width: 900px) {
    .mi-espacio-container {
        flex-direction: column;
        max-width: 100%;
    }
    .mi-espacio-left,
    .mi-espacio-right {
        flex: 0 0 auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .welcome-card { padding: 2rem 1.4rem 2.2rem; }
    .welcome-title { font-size: 1.7rem; }
    .welcome-text { font-size: 0.92rem; }
}
