/* Module launch overlay — Home launcher premium transition */

.module-launch-overlay {
    --launch-bg-deep: #06142e;
    --launch-bg-mid: #081b3a;
    --launch-bg-high: #0b2554;
    --launch-blue: #2563eb;
    --launch-sky: #38bdf8;
    --launch-cyan: #22d3ee;
    --launch-orange: #f97316;
    --launch-text: #ffffff;
    --launch-text-muted: rgba(255, 255, 255, 0.72);
    --launch-border: rgba(255, 255, 255, 0.14);
    position: fixed;
    inset: 0;
    z-index: 10200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    overflow: hidden;
    background:
        radial-gradient(ellipse 120% 80% at 50% 120%, rgba(37, 99, 235, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 15% 20%, rgba(34, 211, 238, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 45% at 85% 25%, rgba(249, 115, 22, 0.08) 0%, transparent 45%),
        linear-gradient(165deg, var(--launch-bg-deep) 0%, var(--launch-bg-mid) 42%, var(--launch-bg-high) 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
}

.module-launch-overlay.is-visible {
    display: flex;
    opacity: 1;
    visibility: visible;
}

html.module-launch-active,
html.module-launch-active body {
    overflow: hidden;
}

html.module-launch-active .appTopBar {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.launch-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 20%, transparent 75%);
    pointer-events: none;
}

.launch-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: launch-orb-drift 12s ease-in-out infinite alternate;
}

.launch-bg-orb-1 {
    width: 28rem;
    height: 28rem;
    top: -8rem;
    left: -6rem;
    background: rgba(37, 99, 235, 0.35);
}

.launch-bg-orb-2 {
    width: 22rem;
    height: 22rem;
    right: -5rem;
    bottom: -4rem;
    background: rgba(34, 211, 238, 0.2);
    animation-delay: -4s;
}

.launch-bg-orb-3 {
    width: 14rem;
    height: 14rem;
    top: 35%;
    right: 18%;
    background: rgba(249, 115, 22, 0.14);
    animation-delay: -7s;
}

@keyframes launch-orb-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(1.5rem, -1rem) scale(1.08); }
}

.launch-shell {
    position: relative;
    z-index: 1;
    width: min(1080px, 100%);
    text-align: center;
    animation: launch-shell-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.module-launch-overlay.is-visible .launch-shell {
    animation: launch-shell-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes launch-shell-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.launch-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
}

.launch-logo__img {
    display: block;
    width: auto;
    height: 84px;
    max-width: 180px;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
}

.launch-logo__text {
    display: none;
}

.launch-subtitle {
    margin: 0 0 0.35rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--launch-sky);
}

.launch-module-name {
    margin: 0 0 0.3rem;
    font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    font-size: clamp(1.4rem, 3.4vw, 1.95rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--launch-text);
    text-shadow: 0 0 40px rgba(56, 189, 248, 0.25);
}

.launch-module-description {
    margin: 0 auto 1.75rem;
    max-width: 32rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--launch-text-muted);
}

.launch-module-description:empty {
    display: none;
    margin-bottom: 1.25rem;
}

.launch-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) minmax(0, 1fr);
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.65rem;
}

.launch-steps {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.25rem 0;
}

.launch-step {
    position: relative;
    padding-left: 1.35rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.38);
    transition: color 0.28s ease, transform 0.28s ease;
}

.launch-step::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.launch-step.is-active {
    color: var(--launch-text);
    transform: translateX(2px);
}

.launch-step.is-active::before {
    border-color: var(--launch-cyan);
    background: var(--launch-cyan);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.65);
}

.launch-step.is-done {
    color: var(--launch-text-muted);
}

.launch-step.is-done::before {
    border-color: var(--launch-blue);
    background: var(--launch-blue);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.45);
}

.launch-core {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.launch-platform {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.launch-platform__ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.launch-platform__ring--outer {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 55%, rgba(37, 99, 235, 0.35) 0%, rgba(6, 20, 46, 0) 68%),
        radial-gradient(circle, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
    box-shadow:
        0 0 60px rgba(37, 99, 235, 0.35),
        inset 0 0 30px rgba(34, 211, 238, 0.12);
    animation: launch-platform-pulse 2.8s ease-in-out infinite;
}

.launch-platform__ring--inner {
    width: 68%;
    height: 68%;
    border-color: rgba(34, 211, 238, 0.35);
    animation: launch-platform-spin 14s linear infinite;
}

@keyframes launch-platform-pulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.04); opacity: 1; }
}

@keyframes launch-platform-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.launch-module-icon {
    position: relative;
    z-index: 2;
    width: 5.25rem;
    height: 5.25rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.15rem;
    color: #fff;
    background: linear-gradient(135deg, var(--launch-blue) 0%, #1d4ed8 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 12px 40px rgba(37, 99, 235, 0.45),
        0 0 50px rgba(34, 211, 238, 0.2);
    animation: launch-icon-float 3.2s ease-in-out infinite;
}

.launch-module-icon i {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

@keyframes launch-icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.launch-core__particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--launch-cyan);
    box-shadow: 0 0 8px var(--launch-cyan);
    opacity: 0.7;
    animation: launch-particle-orbit 6s linear infinite;
}

.launch-core__particle--1 { top: 18%; left: 22%; animation-duration: 5s; }
.launch-core__particle--2 { bottom: 20%; right: 18%; animation-duration: 7s; animation-delay: -2s; }
.launch-core__particle--3 { top: 42%; right: 8%; width: 3px; height: 3px; animation-duration: 4.5s; animation-delay: -1s; }

@keyframes launch-particle-orbit {
    0% { transform: translate(0, 0) scale(1); opacity: 0.2; }
    50% { transform: translate(6px, -10px) scale(1.2); opacity: 0.85; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.2; }
}

.launch-info-card {
    text-align: left;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid var(--launch-border);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.launch-info-card__title {
    margin: 0 0 0.45rem;
    font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--launch-text);
}

.launch-info-card__desc {
    margin: 0 0 0.75rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--launch-text-muted);
}

.launch-info-card__desc:empty {
    display: none;
    margin-bottom: 0;
}

.launch-info-card__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.launch-info-card__list li {
    position: relative;
    padding-left: 1rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.35;
}

.launch-info-card__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--launch-orange) 0%, var(--launch-sky) 100%);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
}

.launch-progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--launch-text-muted);
}

.launch-progress-label strong,
.launch-progress-value {
    display: none;
}

.launch-progress {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--launch-border);
    overflow: hidden;
    margin-bottom: 1rem;
}

.launch-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--launch-blue) 0%, var(--launch-sky) 55%, var(--launch-cyan) 100%);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.65);
    transition: width 0.12s linear;
    position: relative;
    will-change: transform;
}

.module-launch-overlay.is-indeterminate .launch-progress-bar {
    width: 38%;
    transition: none;
    animation: launch-progress-shuttle 1.35s ease-in-out infinite;
}

.module-launch-overlay.is-indeterminate .launch-progress-bar::after {
    animation: launch-progress-shine 1.1s ease-in-out infinite;
}

@keyframes launch-progress-shuttle {
    0% { transform: translateX(-8%); }
    50% { transform: translateX(250%); }
    100% { transform: translateX(-8%); }
}

.launch-progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
    animation: launch-progress-shine 1.6s ease-in-out infinite;
}

@keyframes launch-progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.launch-tip {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 0.6875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.01em;
}

@media (max-width: 991.98px) {
    .module-launch-overlay {
        padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        align-items: center;
    }

    .launch-shell {
        width: 100%;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .launch-logo {
        margin-bottom: 0.45rem;
    }

    .launch-logo__img {
        height: 74px;
        max-width: 158px;
    }

    .launch-subtitle {
        font-size: 0.72rem;
        margin-bottom: 0.25rem;
    }

    .launch-module-name {
        font-size: clamp(1.2rem, 5vw, 1.55rem);
        margin-bottom: 0.2rem;
    }

    .launch-module-description {
        margin-bottom: 0.85rem;
        font-size: 0.8125rem;
        max-width: 20rem;
    }

    .launch-content {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 0;
        margin-bottom: 0.9rem;
    }

    .launch-content-side {
        display: none !important;
    }

    .launch-core {
        width: 158px;
        height: 158px;
    }

    .launch-module-icon {
        width: 4.1rem;
        height: 4.1rem;
        font-size: 1.7rem;
        border-radius: 16px;
    }

    .launch-progress-label {
        margin-bottom: 0.35rem;
        font-size: 0.7rem;
    }

    .launch-progress {
        margin-bottom: 0.65rem;
    }

    .launch-tip {
        font-size: 0.625rem;
        line-height: 1.35;
        padding: 0 0.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .module-launch-overlay,
    .launch-shell,
    .launch-bg-orb,
    .launch-platform__ring--outer,
    .launch-platform__ring--inner,
    .launch-module-icon,
    .module-launch-overlay.is-indeterminate .launch-progress-bar,
    .launch-core__particle,
    .launch-progress-bar::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ícones por módulo — espelha gradientes do launcher */
.launch-module-icon--entidades { background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%); }
.launch-module-icon--facturacao { background: linear-gradient(135deg, #f97316 0%, #f43f5e 100%); }
.launch-module-icon--financeiro { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.launch-module-icon--funcionarios { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.launch-module-icon--projectos { background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%); }
.launch-module-icon--contabilidade { background: linear-gradient(135deg, #818cf8 0%, #4338ca 100%); }
.launch-module-icon--logistica { background: linear-gradient(135deg, #475569 0%, #334155 100%); }
.launch-module-icon--pos { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.launch-module-icon--frotas { background: linear-gradient(135deg, #eab308 0%, #f97316 100%); }
.launch-module-icon--producao { background: linear-gradient(135deg, #57534e 0%, #292524 100%); }
.launch-module-icon--hst { background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); }
.launch-module-icon--bombas { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.launch-module-icon--hotelaria { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); }
.launch-module-icon--clinica { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }
.launch-module-icon--academico { background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%); }
.launch-module-icon--ecommerce { background: linear-gradient(135deg, #22d3ee 0%, #7c3aed 100%); }
.launch-module-icon--restaurante { background: linear-gradient(135deg, #fb923c 0%, #b45309 100%); }
.launch-module-icon--lavandaria { background: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%); }
.launch-module-icon--microcredito { background: linear-gradient(135deg, #a3e635 0%, #3f6212 100%); }
.launch-module-icon--cursos { background: linear-gradient(135deg, #818cf8 0%, #312e81 100%); }
.launch-module-icon--tickets { background: linear-gradient(135deg, #fb7185 0%, #9d174d 100%); }
.launch-module-icon--ginasio { background: linear-gradient(135deg, #f97316 0%, #ef4444 100%); }
.launch-module-icon--advogados { background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%); }
.launch-module-icon--relatorios { background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%); }
.launch-module-icon--empresa { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.launch-module-icon--config { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }
.launch-module-icon--usuarios { background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%); }
.launch-module-icon--grupos { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
.launch-module-icon--parametros { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); }
.launch-module-icon--schema { background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%); }
