/* =============================================================
   Voti Login — CSS
   Fundo 100% via CSS (sem imagem pesada).
   Decoracoes em ::before/::after do .login-page:
     nao sao elementos HTML, nao bloqueiam cliques nunca.
   ============================================================= */

:root {
    --accent-1: #ff9a2a;
    --accent-2: #ff5a8a;
    --card-bg:  linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.09));
    --card-bd:  rgba(255,255,255,.22);
    --text:     #f3f4f6;
    --muted:    #cbd5e1;
    --ease:     cubic-bezier(.2,.9,.22,1);
    font-family: 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- reset minimo ---- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.login-body-voti {
    height: 100dvh;
    min-height: 100dvh;
    width: 100%;
    overflow: hidden;
    /* fundo escuro instantaneo */
    background-color: #0a0a0d;
}

/* =============================================================
   LOGIN-PAGE
   Centraliza o card. Fundo rico em CSS puro via background
   e pseudo-elementos — nunca bloqueiam cliques.
   ============================================================= */
.login-page {
    position: relative;
    width:  100%;
    height: 100dvh;
    min-height: 100dvh;
    box-sizing: border-box;
    overflow: hidden;

    /* centraliza o card */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(40px, 12vh, 110px) 24px 32px;

    /* fundo escuro limpo — os blobs sao os elementos HTML */
    background:
        radial-gradient(ellipse 70% 55% at 50% 50%, rgba(30,25,45,.60), transparent 70%),
        linear-gradient(145deg, #0f0e14 0%, #0a0a10 45%, #06060a 100%);
    animation: bgPulse 20s ease-in-out infinite alternate;
}
@keyframes bgPulse {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 0 0; }
}

/* ====================================================
   BLOBS INDEPENDENTES — cada um com sua animacao
   Todos: position:absolute, z-index:0, pointer-events:none
   ==================================================== */
.vblob {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(2px);
    will-change: transform, border-radius;
}

/* A — blob grafite grande, topo esquerdo */
.vblob--a {
    left:  -14vw; top: -16vh;
    width:  min(58vw, 760px);
    height: min(58vw, 760px);
    background: radial-gradient(circle at 40% 38%,
        rgba(90, 92,110,.72) 0%,
        rgba(55, 57, 70,.45) 40%,
        rgba(22, 22, 28,.15) 64%,
        transparent 76%);
    filter: blur(22px);
    animation: blobA 18s ease-in-out infinite;
}
@keyframes blobA {
    0%,100% { border-radius:42% 58% 55% 45%/48% 42% 58% 52%; transform:translate(0,0) scale(1); }
    30%     { border-radius:62% 38% 44% 56%/52% 55% 45% 48%; transform:translate(2vw,3vh) scale(1.06); }
    65%     { border-radius:38% 62% 58% 42%/58% 42% 56% 44%; transform:translate(-2vw,1vh) scale(.96); }
}

/* B — blob grafite médio, meia esquerda */
.vblob--b {
    left:  -20vw; top: 32vh;
    width:  min(50vw, 660px);
    height: min(50vw, 660px);
    background: radial-gradient(circle at 55% 46%,
        rgba(75, 78, 96,.65) 0%,
        rgba(44, 46, 58,.38) 42%,
        rgba(16, 16, 20,.12) 64%,
        transparent 76%);
    filter: blur(26px);
    animation: blobB 23s ease-in-out infinite;
}
@keyframes blobB {
    0%,100% { border-radius:56% 44% 48% 52%/44% 56% 44% 56%; transform:translate(0,0) scale(1); }
    40%     { border-radius:42% 58% 60% 40%/60% 42% 58% 42%; transform:translate(3vw,-4vh) scale(1.08); }
    70%     { border-radius:65% 35% 42% 58%/52% 48% 52% 48%; transform:translate(-1vw,2vh) scale(.94); }
}

/* C — blob grafite inferior esquerdo */
.vblob--c {
    left: -8vw; bottom: -12vh;
    width:  min(44vw, 580px);
    height: min(44vw, 580px);
    background: radial-gradient(circle at 46% 42%,
        rgba(68, 70, 88,.60) 0%,
        rgba(38, 40, 52,.35) 44%,
        rgba(12, 12, 16,.10) 64%,
        transparent 76%);
    filter: blur(24px);
    animation: blobC 20s ease-in-out infinite;
}
@keyframes blobC {
    0%,100% { border-radius:48% 52% 58% 42%/52% 48% 44% 56%; transform:translate(0,0) scale(1); }
    35%     { border-radius:58% 42% 42% 58%/46% 54% 60% 40%; transform:translate(4vw,-2vh) scale(1.05); }
    70%     { border-radius:38% 62% 52% 48%/60% 40% 50% 50%; transform:translate(-3vw,3vh) scale(.97); }
}

/* D — blob grafite claro pequeno, centro esquerdo */
.vblob--d {
    left: 8vw; top: 48vh;
    width:  min(26vw, 340px);
    height: min(26vw, 340px);
    background: radial-gradient(circle at 50% 48%,
        rgba(100,102,122,.55) 0%,
        rgba( 60, 62, 78,.30) 44%,
        rgba( 18, 18, 24,.08) 64%,
        transparent 76%);
    filter: blur(28px);
    animation: blobD 27s ease-in-out infinite;
}
@keyframes blobD {
    0%,100% { border-radius:50% 50% 52% 48%/48% 50% 50% 52%; transform:translate(0,0) scale(1); }
    25%     { border-radius:62% 38% 48% 52%/54% 46% 60% 40%; transform:translate(-3vw,-5vh) scale(1.10); }
    55%     { border-radius:42% 58% 60% 40%/44% 56% 38% 62%; transform:translate(3vw,4vh) scale(.92); }
    80%     { border-radius:56% 44% 44% 56%/58% 42% 54% 46%; transform:translate(-1vw,-2vh) scale(1.04); }
}

/* ---- blob principal sólido (laranja→vermelho→rosa) direita ---- */
.login-page::before {
    content: "";
    position: absolute;
    right:  -16vw;
    bottom: -22vh;
    width:  min(78vw, 1100px);
    height: min(78vw, 1100px);
    /* tons quentes como no ref: laranja → coral → vermelho → rosa */
    background:
        radial-gradient(circle at 30% 28%, #ff4a7a 0%, transparent 45%),
        radial-gradient(circle at 72% 65%, #ff8c18 0%, transparent 48%),
        radial-gradient(circle at 52% 50%, #ff5c2a 0%, transparent 52%),
        radial-gradient(circle at 42% 72%, #e03a10 0%, transparent 42%);
    border-radius: 42% 58% 57% 43% / 45% 42% 58% 55%;
    /* blur menor = bordas mais definidas como no ref */
    filter: blur(3px);
    pointer-events: none;
    animation: morphBlob 22s ease-in-out infinite;
    z-index: 0;
}
@keyframes morphBlob {
    0%,100% { border-radius:42% 58% 57% 43%/45% 42% 58% 55%; transform:translate3d(0,0,0)      rotate(0deg);  }
    25%     { border-radius:54% 46% 40% 60%/50% 44% 56% 50%; transform:translate3d(-3vw,-2vh,0) rotate(7deg);  }
    50%     { border-radius:38% 62% 63% 37%/60% 54% 46% 40%; transform:translate3d(2vw,1.5vh,0) rotate(-6deg); }
    75%     { border-radius:62% 38% 46% 54%/42% 58% 42% 58%; transform:translate3d(-1vw,3vh,0)  rotate(4deg);  }
}

/* ---- ::after — halos + linhas curvas SVG (ref: linha laranja fina) ---- */
.login-page::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        /* halo laranja quente (direita — atras do blob) */
        radial-gradient(ellipse 30% 30% at 86% 80%, rgba(255,130,30,.40),  transparent 100%),
        /* halo coral superior direita */
        radial-gradient(ellipse 16% 14% at 98% 54%, rgba(255,60,100,.28),  transparent 100%),
        /* contra-luz muito sutil na esquerda (borda do blob esq) */
        radial-gradient(ellipse 18% 30% at  0%  46%, rgba(110,115,145,.10), transparent 100%),

        /* LINHA LARANJA — entre card e blob (ref original) */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 600' preserveAspectRatio='none'%3E%3Cpath d='M180 0 C60 120%2C200 260%2C70 380 C-10 460%2C140 520%2C60 600' stroke='%23ff9a2a' stroke-opacity='0.55' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"),
        /* LINHA CINZA — esquerda, bordas dos blobs */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 600' preserveAspectRatio='none'%3E%3Cpath d='M20 0 C140 100%2C0 240%2C130 370 C210 450%2C60 520%2C140 600' stroke='%23b0b4cc' stroke-opacity='0.22' stroke-width='1.1' fill='none'/%3E%3C/svg%3E"),
        /* LINHA CINZA SEGUNDA — esquerda mais interna */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 600' preserveAspectRatio='none'%3E%3Cpath d='M60 0 C-20 130%2C160 280%2C40 420 C-10 490%2C120 550%2C80 600' stroke='%239094b8' stroke-opacity='0.15' stroke-width='0.9' fill='none'/%3E%3C/svg%3E");

    background-size:
        100% 100%, 100% 100%, 100% 100%,  /* halos          */
        160px 84vh,                        /* linha laranja  */
        145px 80vh,                        /* linha cinza 1  */
        120px 72vh;                        /* linha cinza 2  */

    background-position:
        0 0, 0 0, 0 0,
        right 28vw  bottom 0,
        left   7vw  top    3vh,
        left  20vw  top    0;

    background-repeat: no-repeat;
    animation: haloShift 10s ease-in-out infinite;
}
@keyframes haloShift {
    0%,100% { opacity:.86; }
    50%     { opacity:1;   }
}

/* =============================================================
   LOGO
   position:absolute dentro do .login-page.
   z-index:0 → abaixo do card (z-index:1).
   pointer-events:none no HTML e CSS → nunca bloqueia.
   ============================================================= */
.brand-mark {
    position: absolute;
    right:  clamp(16px, 5vw, 90px);
    bottom: clamp(20px, 7vh, 80px);
    z-index: 0;
    pointer-events: none !important;
    user-select: none;
    /* entrada suave */
    opacity: 1;
    animation: logoIn 1s var(--ease) .3s both;
}
.brand-mark img {
    display: block;
    width: clamp(160px, 20vw, 290px);
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.55));
    animation: logoFloat 6s ease-in-out infinite;
}
@keyframes logoIn {
    from { opacity:0; transform:translateY(14px); }
    to   { opacity:1; transform:translateY(0); }
}
@keyframes logoFloat {
    0%,100% { transform:translateY(0); }
    50%     { transform:translateY(-8px); }
}

/* =============================================================
   CARD — z-index:1 garante que fica ACIMA dos decorativos
   ============================================================= */
.login-card {
    position: relative;
    z-index: 1;
    width: min(520px, 92vw);
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-bd);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 80px rgba(0,0,0,.50);
    color: var(--text);
    overflow: hidden;
    animation: cardIn 420ms var(--ease) both;
}
@keyframes cardIn {
    from { opacity:0; transform:translateY(14px) scale(.993); }
    to   { opacity:1; transform:translateY(0)    scale(1); }
}

.login-card__head  { padding: 28px 28px 8px; }
.login-card__title { font-size:22px; font-weight:700; margin:0; color:var(--text); }
.login-card__sub   { margin:2px 0 0; color:var(--muted) !important; font-size:13px; }
.login-card__body  { padding: 20px 28px 8px; }
.login-card__footer {
    padding: 8px 28px 24px;
    display: flex; flex-direction: column; gap:10px; align-items:stretch;
}

/* campos */
.field { margin-bottom:18px; position:relative; }
.field label { display:block; font-size:12px; color:var(--text) !important; margin:0 0 6px 2px; }
.with-icon { position:relative; }
.with-icon i.material-icons {
    position:absolute; left:12px; top:50%; transform:translateY(-50%);
    font-size:22px; color:#2c2a2a; pointer-events:none;
}
.with-icon .ui-inputfield {
    padding-left:42px !important; height:44px; border-radius:12px;
    border:1px solid rgba(255,255,255,.22);
    background:rgba(255,255,255,.95); color:#111;
    transition:border-color .18s var(--ease), box-shadow .18s var(--ease);
    width:100%;
}
.with-icon .ui-inputfield:focus {
    border-color: rgba(255,154,42,.85);
    box-shadow: 0 0 0 6px rgba(255,154,42,.07);
    background: #fff;
}
.with-icon.with-password-toggle .ui-password { width:100%; display:block; }
.with-icon.with-password-toggle .ui-password input,
.with-icon.with-password-toggle > input {
    width:100% !important; box-sizing:border-box;
    padding-right:52px !important; border-radius:12px !important;
}
.password-toggle {
    position:absolute; z-index:2;
    right:2px; top:50%; transform:translateY(-50%);
    display:inline-flex; align-items:center; justify-content:center;
    width:44px; height:calc(100% - 8px); min-height:36px; max-height:40px;
    border:0; cursor:pointer; border-radius:10px;
    background:transparent; color:#2a2828; box-shadow:none;
    transition:color .15s var(--ease);
}
.password-toggle:hover { color:#111; }
.password-toggle:focus-visible { outline:2px solid rgba(255,154,42,.9); outline-offset:2px; }
.password-toggle .material-icons { font-size:22px; pointer-events:none; }

/* botao entrar */
.btn-login.ui-button {
    width:100%; height:46px; border-radius:12px; border:0;
    background-image: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color:#fff; font-weight:700; letter-spacing:.3px;
    transition: transform .12s var(--ease), filter .18s var(--ease), box-shadow .18s var(--ease);
    box-shadow: 0 10px 30px rgba(0,0,0,.18), 0 6px 14px rgba(255,154,42,.12);
    cursor: pointer;
}
.btn-login.ui-button:enabled:hover  { filter:brightness(1.05); }
.btn-login.ui-button:enabled:active { transform:translateY(1px); }

.forgot { color:#fff; text-decoration:underline; font-size:13px; align-self:flex-end; margin-top:7px; }

/* loader */
.card-loader {
    position:absolute; inset:0; display:none;
    align-items:center; justify-content:center;
    background:rgba(10,10,10,.22);
    backdrop-filter:blur(2px);
}
.login-card.is-loading .card-loader { display:flex; }
.login-card.is-loading { pointer-events:none; }
.ring {
    width:42px; height:42px; border-radius:50%;
    border:3px solid rgba(255,255,255,.30); border-top-color:rgba(255,255,255,.8);
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* =============================================================
   RESPONSIVIDADE
   ============================================================= */
@media (max-height: 640px) {
    html, body    { overflow: auto; }
    .login-body-voti { height:auto; min-height:100vh; }
    .login-page   { height:auto; min-height:100vh; overflow:visible; }
}

@media (max-width: 560px) {
    .brand-mark {
        left:50%; right:auto;
        bottom: 20px;
        transform: translateX(-50%);
        animation: logoInMobile 1s var(--ease) .3s both;
    }
    .brand-mark img { width: clamp(120px, 40vw, 190px); }
}
@keyframes logoInMobile {
    from { opacity:0; transform:translateX(-50%) translateY(10px); }
    to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

@media (max-width: 420px) {
    .login-card        { border-radius:14px; }
    .login-card__head  { padding:20px; }
    .login-card__body  { padding:16px; }
    .login-card__footer { padding:12px 16px 20px; }
}

/* acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .login-page, .login-page::before, .login-page::after,
    .vblob, .login-card, .brand-mark, .brand-mark img { animation:none; }
    .login-card  { opacity:1; transform:none; }
    .brand-mark  { opacity:1; }
}
