/* ==========================================================================
   GRIFFO Repanalytics — Login redesign
   Split-screen: wallpaper com overlay azul + painel branco de formulário.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
    --griffo-blue-900: #022C4D;
    --griffo-blue-700: #003A6A;
    --griffo-blue-500: #1563A8;
    --griffo-blue-100: #E6F0FA;
    --griffo-blue-50:  #F1F6FB;
    --griffo-orange-600: #E86A15;
    --griffo-orange-500: #FF8427;
    --gray-900: #16202F;
    --gray-700: #3B4758;
    --gray-500: #6B7787;
    --gray-300: #C6CCD5;
    --gray-200: #E4E8EE;
    --gray-100: #EFF2F6;
    --gray-50:  #F6F8FB;
    --white: #FFFFFF;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
}

*{
    font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif !important;
    box-sizing: border-box;
}
body{
    background: var(--gray-50) !important;
    -webkit-font-smoothing: antialiased;
    color: var(--gray-900);
    overflow: hidden;
}

.container{
    min-height: 100vh;
    display: flex !important;
}

/* -------- painel esquerdo (formulário) -------- */
.login-container{
    max-width: 520px !important;
    min-height: 100vh !important;
    padding: 60px !important;
    background: var(--white);
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 2;
    box-shadow: 6px 0 24px rgba(2,44,77,.06);
}

.loginTitle-container{
    align-items: flex-start !important;
    width: 100% !important;
    margin-bottom: 40px;
}

.login-logo{
    width: 88px !important;
    margin-bottom: 28px !important;
}

.loginTitle{
    color: var(--griffo-blue-900) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
    letter-spacing: -0.01em;
}
.loginTitle::after{
    content: "Acesse seu painel de análise comercial";
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-500);
    margin-top: 6px;
    letter-spacing: 0;
}

#loginForm{
    width: 100% !important;
    align-items: stretch !important;
    gap: 18px;
}

/* -------- alerta de erro de login -------- */
.login-alert{
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 40px 12px 14px;
    position: relative;
    background: #FDECEC;
    border: 1px solid #F5B4B4;
    border-left: 3px solid #D03B3B;
    border-radius: var(--r-sm);
    color: #8C1F1F;
    font-size: 13px;
    line-height: 1.4;
    animation: login-alert-in .32s cubic-bezier(.2,.8,.2,1) both,
               login-alert-shake .48s cubic-bezier(.36,.07,.19,.97) .05s both;
}
.login-alert-icon{
    flex: 0 0 20px;
    margin-top: 1px;
    color: #D03B3B;
}
.login-alert-msg{
    flex: 1;
    font-weight: 500;
}
.login-alert-close{
    position: absolute;
    top: 6px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: #8C1F1F;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: .6;
    transition: background 160ms, opacity 160ms;
}
.login-alert-close:hover{
    background: rgba(208,59,59,.1);
    opacity: 1;
}
@keyframes login-alert-in{
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes login-alert-shake{
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* borda vermelha nos inputs quando há alerta */
.login-container:has(.login-alert) .loginInput{
    border-color: rgba(208,59,59,.45) !important;
    background: #FFF7F7 !important;
}
.login-container:has(.login-alert) .loginInput:focus{
    border-color: var(--griffo-blue-500) !important;
    background: var(--white) !important;
    box-shadow: 0 0 0 3px rgba(21,99,168,.14) !important;
}

.input-wrapper{
    margin-bottom: 0 !important;
    position: relative;
}
.input-wrapper span{
    color: var(--gray-500) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    margin: 14px 14px !important;
    text-transform: uppercase;
}
.input-wrapper span.active{
    font-size: 10px !important;
    margin: 7px 14px !important;
    color: var(--griffo-blue-600, var(--griffo-blue-500)) !important;
}

.loginInput{
    width: 100% !important;
    background: var(--gray-50) !important;
    border: 1.5px solid var(--gray-200) !important;
    border-radius: var(--r-sm) !important;
    padding: 24px 44px 10px 14px !important;
    font-size: 14px !important;
    color: var(--gray-900) !important;
    font-weight: 500 !important;
    transition: border-color 160ms, background 160ms, box-shadow 160ms;
}
.loginInput:hover{
    background: var(--white) !important;
}
.loginInput:focus{
    background: var(--white) !important;
    border-color: var(--griffo-blue-500) !important;
    box-shadow: 0 0 0 3px rgba(21,99,168,.14) !important;
    outline: none !important;
}

div.image-wrapper{
    top: 50% !important;
    right: 12px !important;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    display: flex !important; align-items: center; justify-content: center;
    border-radius: var(--r-sm);
    transition: background 160ms;
}
div.image-wrapper:hover{ background: var(--gray-100); }
div.image-wrapper > .password-img{
    width: 18px !important; height: 18px !important;
    opacity: 0.55;
}
div.image-wrapper:hover > .password-img{ opacity: 1; }

/* -------- botão de login redesenhado -------- */
.loginButton-wrapper{
    width: 100%;
    margin-top: 24px;
}
.loginButton{
    width: 100% !important;
    max-width: 100%;
    height: 50px !important;
    padding: 0 !important;
    gap: 10px !important;
    background: var(--griffo-orange-500) !important;
    border: 0 !important;
    border-radius: var(--r-sm) !important;
    cursor: pointer !important;
    margin: 0 !important;
    box-shadow: 0 2px 8px rgba(255,132,39,.35);
    transition: background 160ms, transform 160ms, box-shadow 220ms;
}
.loginButton:hover:not(:disabled){
    background: var(--griffo-orange-600) !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255,132,39,.32);
}
.loginButton:active:not(:disabled){ transform: translateY(0); }
button.loginButton::before{
    content: 'Entrar' !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    letter-spacing: 0.02em;
}
.loginButton svg{ width: 16px; height: 16px; fill: #fff !important; }

.loginButton:disabled{
    width: 100% !important;
    height: 50px !important;
    gap: 10px !important;
    background: var(--gray-100) !important;
    border: 1.5px dashed var(--gray-300) !important;
    box-shadow: none;
    cursor: not-allowed !important;
}
button.loginButton:disabled::before{
    content: 'Preencha os campos' !important;
    color: var(--gray-500) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}
.loginButton:disabled svg{ display: none; }

/* rodapé do card com link secundário */
.login-container::after{
    content: "© GRIFFO Repanalytics";
    position: absolute;
    bottom: 28px;
    left: 60px;
    font-size: 11px;
    color: var(--gray-400, var(--gray-500));
    letter-spacing: 0.04em;
}

/* -------- painel direito (minimal editorial, estilo B2B premium) -------- */
.wallpaper{
    flex: 1 !important;
    position: relative;
    overflow: hidden;
    background: #022C4D !important;
    filter: none !important;
    color: #fff;
    isolation: isolate;
}

/* fotografia de fundo dessaturada */
.wp-photo{
    position: absolute;
    inset: 0;
    background: url('../../images/login_wallpaper.jpg') no-repeat center / cover;
    filter: grayscale(100%) contrast(1.05) brightness(.55);
    transform: scale(1.04);
    animation: wp-photo-drift 30s ease-in-out infinite alternate;
}
@keyframes wp-photo-drift{
    from { transform: scale(1.04) translate(0, 0); }
    to   { transform: scale(1.08) translate(-1.5%, -1%); }
}

/* camada duotone: mistura azul GRIFFO com aquecimento laranja na direita */
.wp-duotone{
    position: absolute;
    inset: 0;
    background:
        radial-gradient(80% 60% at 85% 20%, rgba(255,132,39,.22) 0%, transparent 60%),
        linear-gradient(135deg, rgba(2,44,77,.92) 0%, rgba(0,58,106,.88) 55%, rgba(21,99,168,.78) 100%);
    mix-blend-mode: multiply;
}
/* segunda passada: reforça o azul profundo e empurra o contraste do lado do texto */
.wp-duotone::after{
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(2,44,77,.85) 0%, rgba(2,44,77,.25) 45%, transparent 70%);
}

/* grain sutil — dá sensação "editorial/premium", imperceptível mas muda tudo */
.wp-noise{
    position: absolute; inset: 0;
    opacity: .08;
    pointer-events: none;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* sheen: passada lenta de luz na diagonal — único elemento animado "grande" */
.wp-sheen{
    position: absolute;
    top: -50%; left: -30%;
    width: 60%; height: 200%;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%);
    transform: translateX(-30%);
    animation: wp-sheen-sweep 11s ease-in-out infinite;
}
@keyframes wp-sheen-sweep{
    0%   { transform: translateX(-30%); opacity: 0; }
    30%  { opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: translateX(260%); opacity: 0; }
}

/* -------- conteúdo editorial sobreposto -------- */
.wp-content{
    position: absolute;
    inset: 0;
    padding: 64px 8% 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
    color: #fff;
}

/* marcador no topo: barra laranja + label institucional */
.wp-mark{
    display: inline-flex;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transform: translateY(-6px);
    animation: wp-fade-in .7s cubic-bezier(.2,.8,.2,1) .2s forwards;
}
.wp-mark-bar{
    display: block;
    width: 36px;
    height: 2px;
    background: var(--griffo-orange-500);
    box-shadow: 0 0 10px rgba(255,132,39,.55);
}
.wp-mark-label{
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    color: rgba(255,255,255,.75);
    text-transform: uppercase;
}

/* headline central */
.wp-headline{
    max-width: 620px;
    opacity: 0;
    transform: translateY(12px);
    animation: wp-fade-in .9s cubic-bezier(.2,.8,.2,1) .35s forwards;
}
.wp-headline h2{
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.08;
    margin: 0 0 18px;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.wp-headline h2 em{
    font-style: normal;
    background: linear-gradient(90deg, #FF8427 0%, #FFB070 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}
.wp-headline p{
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    color: rgba(255,255,255,.78);
    max-width: 480px;
    font-weight: 400;
}

/* rodapé: pílulas leves com categorias, sem dado */
.wp-footer{
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transform: translateY(8px);
    animation: wp-fade-in .8s cubic-bezier(.2,.8,.2,1) .55s forwards;
}
.wp-footer-pill{
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,.72);
    padding: 6px 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 220ms, color 220ms, border-color 220ms;
}
.wp-footer-pill:hover{
    background: rgba(255,132,39,.12);
    border-color: rgba(255,132,39,.4);
    color: #fff;
}
.wp-footer-dot{
    width: 3px; height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
}

@keyframes wp-fade-in{
    to { opacity: 1; transform: translateY(0); }
}

/* motion reduzido: mantém layout, corta animações */
@media (prefers-reduced-motion: reduce){
    .wp-photo, .wp-sheen, .wp-mark, .wp-headline, .wp-footer{
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* responsivo (wallpaper já some <900px pela regra geral) */
@media screen and (max-width: 1280px){
    .wp-content{ padding: 48px 6% 44px; }
    .wp-headline h2{ font-size: 34px; }
}

/* -------- responsivo -------- */
@media screen and (max-width: 900px){
    .login-container{ padding: 40px !important; max-width: 100% !important; }
    .wallpaper{ display: none !important; }
    .login-container::after{ left: 40px; }
}

/* ==========================================================================
   APP LOADER — overlay full-screen exibido enquanto a página carrega
   ========================================================================== */
.app-loader{
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(135deg, rgba(2,44,77,.96) 0%, rgba(0,58,106,.94) 50%, rgba(21,99,168,.92) 100%);
    backdrop-filter: blur(6px) saturate(110%);
    -webkit-backdrop-filter: blur(6px) saturate(110%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 400ms ease, visibility 0ms 400ms, backdrop-filter 400ms ease;
    pointer-events: all;
    overflow: hidden;
}
.app-loader.hidden{
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(0) saturate(100%);
    -webkit-backdrop-filter: blur(0) saturate(100%);
    transition: opacity 400ms ease, visibility 0ms 400ms, backdrop-filter 400ms ease;
}
.app-loader-content{
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 34px 44px 28px;
    min-width: 280px;
    background:
        radial-gradient(circle at 30% 0%, rgba(255,132,39,.12) 0%, transparent 55%),
        radial-gradient(circle at 80% 100%, rgba(21,99,168,.22) 0%, transparent 50%),
        linear-gradient(160deg, rgba(3,30,54,.94) 0%, rgba(2,44,77,.92) 50%, rgba(4,54,95,.92) 100%);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 22px;
    box-shadow:
        0 30px 80px rgba(0,0,0,.45),
        0 1px 0 rgba(255,255,255,.08) inset,
        0 -1px 0 rgba(0,0,0,.2) inset;
    overflow: hidden;
}
.app-loader-content::before{
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,132,39,.35), transparent 40%, transparent 60%, rgba(21,99,168,.3));
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
            mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: .55;
}

.app-loader-logo-wrap{
    position: relative;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}
.app-loader-logo-wrap::before{
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,132,39,.35) 0%, rgba(255,132,39,0) 65%);
    animation: griffo-aura-pulse 2.4s ease-in-out infinite;
    filter: blur(2px);
}
.app-loader-logo-ring{
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.08);
    border-top-color: var(--griffo-orange-500);
    border-right-color: rgba(255,132,39,.6);
    animation: griffo-spin 1.4s cubic-bezier(.5,.05,.5,.95) infinite;
    box-shadow: 0 0 20px rgba(255,132,39,.25);
}
.app-loader-logo-wrap::after{
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-top-color: rgba(59,130,199,.55);
    border-left-color: rgba(59,130,199,.25);
    animation: griffo-spin-reverse 2s linear infinite;
}
.app-loader-logo{
    position: relative;
    z-index: 2;
    width: 48px;
    height: auto;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)) drop-shadow(0 0 12px rgba(255,132,39,.3));
    animation: griffo-logo-pulse 2.4s ease-in-out infinite;
}
@keyframes griffo-spin{ to { transform: rotate(360deg); } }
@keyframes griffo-spin-reverse{ to { transform: rotate(-360deg); } }
@keyframes griffo-logo-pulse{
    0%, 100% { transform: scale(1); opacity: .95; }
    50%      { transform: scale(1.06); opacity: 1; }
}
@keyframes griffo-aura-pulse{
    0%, 100% { transform: scale(.85); opacity: .5; }
    50%      { transform: scale(1.15); opacity: .95; }
}

.app-loader-brand{
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    line-height: 1;
    margin-top: 2px;
}
.app-loader-brand-name{
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.24em;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.app-loader-brand-sub{
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.32em;
    color: var(--griffo-orange-500);
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255,132,39,.5);
}

.app-loader-dots{
    display: block !important;
    position: relative;
    width: 180px;
    height: 3px;
    margin-top: 6px;
    background: rgba(255,255,255,.08);
    border-radius: 999px;
    overflow: hidden;
    gap: 0 !important;
}
.app-loader-dots span{
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--griffo-orange-500), transparent) !important;
    animation: griffo-progress-slide 1.6s cubic-bezier(.4,0,.2,1) infinite !important;
    box-shadow: 0 0 12px rgba(255,132,39,.6);
}
.app-loader-dots span:nth-child(2),
.app-loader-dots span:nth-child(3){
    display: none !important;
}
@keyframes griffo-progress-slide{
    0%   { left: -40%; }
    100% { left: 100%; }
}

.app-loader-label{
    color: rgba(255,255,255,.7);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    animation: griffo-label-fade 2.2s ease-in-out infinite;
}
@keyframes griffo-label-fade{
    0%, 100% { opacity: .5; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce){
    .app-loader-logo-wrap::before,
    .app-loader-logo-wrap::after,
    .app-loader-logo-ring,
    .app-loader-logo,
    .app-loader-dots span,
    .app-loader-label{
        animation: none !important;
    }
}
