/* ============================================================
   DIVINO ADMIN — Splash (Login) + Welcome Back Toast (Dashboard)
   ============================================================ */

/* Esconde o conteúdo do body enquanto o splash está ativo */
body.admin-splash-loading > *:not(#admin-splash) {
    visibility: hidden;
}

/* ============================================================
   LOGIN SPLASH — overlay full-screen
   ============================================================ */

#admin-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #001551 0%, #0037b0 60%, #1d4ed8 100%);
    overflow: hidden;
    will-change: opacity, transform;
}

/* Glow radial de fundo */
#admin-splash .as-glow {
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29, 78, 216, 0.45) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: asGlowIn 0.8s ease-out 0.1s forwards;
}

/* Grid de pontos decorativos */
#admin-splash .as-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0;
    animation: asFadeIn 0.5s ease 0.2s forwards;
}

/* Anéis concêntricos */
#admin-splash .as-ring {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0;
    transform: scale(0.5);
    animation: asRingIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}
#admin-splash .as-ring-2 {
    width: 270px;
    height: 270px;
    border-color: rgba(255, 255, 255, 0.07);
    animation-delay: 0.4s;
}
#admin-splash .as-ring-3 {
    width: 360px;
    height: 360px;
    border-color: rgba(255, 255, 255, 0.04);
    animation-delay: 0.5s;
}

/* Conteúdo central */
#admin-splash .as-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

/* Ícone */
#admin-splash .as-icon {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(24px) scale(0.7);
    animation: asIconIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s forwards,
               asPulseRing 2s ease-in-out 1.2s infinite;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

#admin-splash .as-icon .material-symbols-outlined {
    font-size: 38px !important;
    color: #ffffff;
    font-family: 'Material Symbols Outlined' !important;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    line-height: 1;
}

/* Badge laranja */
#admin-splash .as-badge {
    background: rgba(253, 118, 26, 0.15);
    border: 1px solid rgba(253, 118, 26, 0.3);
    color: #ffaa6b;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(10px);
    animation: asTextIn 0.4s ease 0.55s forwards;
}

/* Título */
#admin-splash .as-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 2.6rem;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #ffffff;
    opacity: 0;
    transform: translateY(16px);
    animation: asTextIn 0.45s cubic-bezier(0.25, 1, 0.5, 1) 0.65s forwards;
    margin-top: 4px;
}
#admin-splash .as-title span { color: #fd761a; }

/* Subtítulo */
#admin-splash .as-subtitle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    opacity: 0;
    transform: translateY(10px);
    animation: asTextIn 0.4s ease 0.8s forwards;
}

/* Dots loader */
#admin-splash .as-loader {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    opacity: 0;
    animation: asFadeIn 0.3s ease 1.05s forwards;
}
#admin-splash .as-loader span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    animation: asDot 1.1s ease-in-out infinite;
}
#admin-splash .as-loader span:nth-child(2) { animation-delay: 0.15s; }
#admin-splash .as-loader span:nth-child(3) { animation-delay: 0.3s;  }

/* Barra de progresso */
#admin-splash .as-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
}
#admin-splash .as-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #fd761a, #ffb347);
    animation: asProgress 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
    border-radius: 0 2px 2px 0;
}

/* Saída */
#admin-splash.as-exit {
    animation: asOut 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

/* ============================================================
   WELCOME BACK TOAST — Dashboard (já logado)
   ============================================================ */

#admin-welcome-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid rgba(29, 78, 216, 0.08);
    border-radius: 20px;
    padding: 16px 20px 20px;
    box-shadow: 0 20px 60px rgba(0, 55, 176, 0.13), 0 4px 16px rgba(0, 0, 0, 0.06);
    min-width: 280px;
    max-width: 340px;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    animation: awIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
    will-change: opacity, transform;
}

#admin-welcome-toast .aw-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8, #0037b0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.3);
}

#admin-welcome-toast .aw-avatar .material-symbols-outlined {
    font-size: 22px !important;
    color: #ffffff;
    font-family: 'Material Symbols Outlined' !important;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    line-height: 1;
}

#admin-welcome-toast .aw-text { flex: 1; }

#admin-welcome-toast .aw-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fd761a;
    margin-bottom: 2px;
}

#admin-welcome-toast .aw-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0037b0;
    line-height: 1.2;
}

#admin-welcome-toast .aw-sub {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(0, 55, 176, 0.45);
    margin-top: 2px;
}

/* Barra de progresso do toast */
#admin-welcome-toast .aw-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(29, 78, 216, 0.06);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}
#admin-welcome-toast .aw-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #1d4ed8, #fd761a);
    transform-origin: left;
    animation: awProgress 2.8s linear 0.9s forwards;
}

/* Saída do toast */
#admin-welcome-toast.aw-exit {
    animation: awOut 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes asGlowIn  { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes asFadeIn  { to { opacity: 1; } }
@keyframes asRingIn  { to { opacity: 1; transform: scale(1); } }
@keyframes asIconIn  { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes asTextIn  { to { opacity: 1; transform: translateY(0); } }
@keyframes asProgress { to { width: 100%; } }

@keyframes asOut {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); }
}
@keyframes asDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.35; }
    40%           { transform: scale(1);   opacity: 1;    }
}
@keyframes asPulseRing {
    0%   { box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 0   rgba(253,118,26,0.35); }
    70%  { box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 12px rgba(253,118,26,0);   }
    100% { box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 0   rgba(253,118,26,0);   }
}

@keyframes awIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes awOut {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-14px) scale(0.94); }
}
@keyframes awProgress {
    0%   { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}

/* ============================================================
   RESPONSIVO — Mobile
   ============================================================ */
@media (max-width: 767px) {
    #admin-splash .as-title  { font-size: 2rem; }
    #admin-splash .as-icon   { width: 64px; height: 64px; border-radius: 20px; }
    #admin-splash .as-glow   { width: 340px; height: 340px; }
    #admin-splash .as-ring   { width: 140px; height: 140px; }
    #admin-splash .as-ring-2 { width: 210px; height: 210px; }
    #admin-splash .as-ring-3 { width: 280px; height: 280px; }

    #admin-welcome-toast {
        top: auto;
        bottom: 20px;
        right: 50%;
        transform: translateX(50%) translateY(20px) scale(0.95);
        animation: awInMobile 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
    }
    #admin-welcome-toast.aw-exit {
        animation: awOutMobile 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
    }
}

@keyframes awInMobile {
    to { opacity: 1; transform: translateX(50%) translateY(0) scale(1); }
}
@keyframes awOutMobile {
    0%   { opacity: 1; transform: translateX(50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(50%) translateY(14px) scale(0.94); }
}

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    #admin-splash * { animation: none !important; opacity: 1 !important; transform: none !important; }
    #admin-splash .as-progress-bar { width: 100%; }
    #admin-splash.as-exit { opacity: 0; animation: none !important; }
    #admin-welcome-toast { animation: none !important; opacity: 1 !important; transform: none !important; }
    #admin-welcome-toast .aw-progress-bar { transform: scaleX(0); }
}
