/* GateControl PWA Splash Screen */
html, body {
    background: #f7f7f8;
    min-height: 100vh;
    color: #f8f9fa;
}

body.gc-app-ready {
    background: #ffffff;
    color: inherit;
}

:root {
    --gc-splash-primary: #007e7a;
    --gc-splash-primary-light: #00a29d;
    --gc-splash-primary-dark: #005b58;
    --gc-splash-secondary: rgba(0, 126, 122, 0.08);
    --gc-splash-text: #212529;
    --gc-splash-muted: rgba(0, 126, 122, 0.65);
    --gc-splash-border: rgba(0, 126, 122, 0.12);
    --gc-splash-surface: #ffffff;
    --gc-splash-on-surface: #212529;
    --gc-splash-title: #1a1a1a;
}

.gc-splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5f4 0%, #f5fafa 100%);
    z-index: 100000;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    color: var(--gc-splash-on-surface);
    overflow: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.gc-splash--hidden {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

.gc-splash__card {
    position: relative;
    width: min(520px, 92vw);
    max-height: 88vh;
    padding: clamp(32px, 6vw, 48px) clamp(28px, 7vw, 48px);
    background: var(--gc-splash-surface);
    border-radius: 8px;
    border: 1px solid rgba(0, 126, 122, 0.08);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 1px 3px 1px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.gc-splash__glow {
    position: absolute;
    inset: -60px -80px;
    background: radial-gradient(circle at 20% 20%, rgba(0, 162, 157, 0.15), transparent 70%),
                radial-gradient(circle at 80% 10%, rgba(0, 126, 122, 0.12), transparent 60%),
                radial-gradient(circle at 50% 120%, rgba(0, 91, 88, 0.1), transparent 75%);
    opacity: 0.6;
    filter: blur(40px);
    z-index: 0;
}

.gc-splash__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
}


.gc-splash__logo-wrapper {
    width: 96px;
    height: 96px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 126, 122, 0.08) 0%, rgba(0, 162, 157, 0.12) 100%);
    border: 1px solid rgba(0, 126, 122, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.gc-splash__logo-wrapper img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.gc-splash__logo-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.gc-splash__headline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.gc-splash__title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    letter-spacing: -0.01em;
    font-weight: 600;
    margin: 0;
    color: var(--gc-splash-title);
}

.gc-splash__subtitle {
    margin: 0;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--gc-splash-primary);
}

.gc-splash__status {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gc-splash__message {
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--gc-splash-on-surface);
    text-align: center;
}

.gc-splash__progress-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 126, 122, 0.12);
    overflow: hidden;
    position: relative;
}

.gc-splash__progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--gc-splash-primary) 0%, var(--gc-splash-primary-light) 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(0, 126, 122, 0.3);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gc-splash__progress-info {
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    font-weight: 500;
    color: var(--gc-splash-primary);
    text-align: center;
}

.gc-splash__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gc-splash-on-surface);
    opacity: 0.7;
}

.gc-splash__footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gc-splash__status-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: auto;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), rgba(0, 126, 122, 0.4));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 8px rgba(0, 126, 122, 0.3);
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gc-splash__status-light--success {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), var(--gc-splash-primary));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 16px rgba(0, 126, 122, 0.6), 0 0 24px rgba(0, 126, 122, 0.4);
}

.gc-splash__footer .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gc-splash-primary);
    opacity: 0.5;
}

.gc-splash__background-ornament {
    position: absolute;
    inset: -140px;
    background: radial-gradient(circle at 10% 10%, rgba(0, 162, 157, 0.15), transparent 65%),
                radial-gradient(circle at 80% 20%, rgba(0, 126, 122, 0.12), transparent 65%),
                radial-gradient(circle at 50% 120%, rgba(0, 91, 88, 0.1), transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

/* Animação de pulso na barra de progresso */
@keyframes progress-pulse {
    0%, 100% {
        opacity: 1;
        transform: scaleX(1);
    }
    50% {
        opacity: 0.8;
        transform: scaleX(0.98);
    }
}

.gc-splash__progress-fill {
    animation: progress-pulse 2s ease-in-out infinite;
}

/* Animação de fade-in do card */
@keyframes card-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gc-splash__card {
    animation: card-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Animação de entrada do logo */
@keyframes logo-entry {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.gc-splash__logo-wrapper {
    animation: logo-entry 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

/* Animação do status light */
@keyframes status-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.gc-splash__status-light {
    animation: status-pulse 2s ease-in-out infinite;
}

.gc-splash__status-light--success {
    animation: none;
}

@media (max-width: 768px) {
    .gc-splash__card {
        padding: 28px 20px;
        width: calc(100vw - 32px);
    }

    .gc-splash__logo-row {
        text-align: center;
        gap: 14px;
    }

    .gc-splash__logo-wrapper {
        width: 80px;
        height: 80px;
        border-radius: 14px;
    }

    .gc-splash__logo-wrapper img {
        width: 60px;
        height: 60px;
    }

    .gc-splash__headline {
        align-items: center;
    }

    .gc-splash__title {
        font-size: 1.5rem;
    }

    .gc-splash__subtitle {
        font-size: 0.75rem;
    }

    .gc-splash__footer {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.7rem;
    }

    .gc-splash__status-light {
        width: 10px;
        height: 10px;
    }
}

/* Suporte a temas escuros do sistema */
@media (prefers-color-scheme: dark) {
    :root {
        --gc-splash-surface: #1e1e1e;
        --gc-splash-on-surface: #e8e8e8;
        --gc-splash-title: #ffffff;
    }

    .gc-splash {
        background: linear-gradient(135deg, #0a1f1e 0%, #1a2f2e 100%);
    }

    .gc-splash__card {
        background: var(--gc-splash-surface);
        border: 1px solid rgba(0, 126, 122, 0.2);
        box-shadow:
            0 2px 4px rgba(0, 0, 0, 0.5),
            0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .gc-splash__logo-wrapper {
        background: linear-gradient(135deg, rgba(0, 126, 122, 0.15) 0%, rgba(0, 162, 157, 0.2) 100%);
        border: 1px solid rgba(0, 126, 122, 0.25);
    }

    .gc-splash__message {
        color: #e8e8e8;
    }
}
