/* ═══════════════════════════════════════════════════════════════
   LOGIN — Portal do Franqueado · 4 Estylos Pizzaria
   Layout: foto | barra vermelha | formulário
═══════════════════════════════════════════════════════════════ */

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

/* ── ROOT: grid de 3 colunas foto | barra | form ── */
#login-root {
    display: grid;
    grid-template-columns: 1fr 6px minmax(380px, 440px);
    height: 100vh;
    width: 100vw;
}

/* ═══════════════════════════════════════════════════════════════
   PAINEL ESQUERDO — foto com overlay
═══════════════════════════════════════════════════════════════ */
#login-left {
    position: relative;
    overflow: hidden;
    background: #111;
}

/* Vídeo de fundo */
#login-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .12s ease-out;
    will-change: transform;
}

/* Partículas flutuantes */
.l-particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(230,51,41,.55);
    z-index: 3;
    animation: float-particle 6s ease-in-out infinite alternate;
    box-shadow: 0 0 10px rgba(230,51,41,.6);
    pointer-events: none;
}

@keyframes float-particle {
    0%   { transform: translateY(0) scale(1);   opacity: .5; }
    50%  { transform: translateY(-18px) scale(1.3); opacity: .9; }
    100% { transform: translateY(4px) scale(.8);  opacity: .4; }
}

/* Overlay gradiente escuro */
#login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0,0,0,.72) 0%,
        rgba(20,0,0,.55) 50%,
        rgba(0,0,0,.8)  100%
    );
}

/* Conteúdo sobre a foto */
#login-left-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 52px 60px;
    animation: fade-up .9s ease both;
}

#login-logo-left {
    display: none; /* só exibe no mobile */
}

/* Título com Woodchuck */
#login-tagline {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    line-height: 1;
}

/* "Portal do" — Woodchuck Heavy, grande, vermelho */
.tag-small {
    font-family: 'WoodchuckHavy', sans-serif;
    font-size: clamp(32px, 4vw, 56px);
    color: #e63329;
    letter-spacing: 4px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
    line-height: 1;
    text-shadow:
        0 2px 16px rgba(230,51,41,.6),
        0 0 50px rgba(230,51,41,.25);
    animation: fade-up .8s ease both .1s;
}

/* "FRANQUEADO" — Woodchuck Heavy, médio, branco com outline */
.tag-big {
    font-family: 'WoodchuckHavy', sans-serif;
    font-size: clamp(34px, 4.2vw, 60px);
    color: #fff;
    letter-spacing: 6px;
    text-transform: uppercase;
    display: block;
    line-height: 1;
    text-shadow:
        2px 2px 0px rgba(0,0,0,.55),
        0 0 40px rgba(230,51,41,.3),
        0 6px 24px rgba(0,0,0,.4);
    -webkit-text-stroke: 1px rgba(255,255,255,.18);
    animation: fade-up .9s cubic-bezier(.22,.68,0,1.2) both .2s;
    transition: letter-spacing .4s ease, text-shadow .4s ease;
}

#login-left-content:hover .tag-big {
    letter-spacing: 9px;
    text-shadow:
        2px 2px 0px rgba(0,0,0,.55),
        0 0 60px rgba(230,51,41,.5),
        0 6px 32px rgba(0,0,0,.4);
}

#login-subtag {
    font-size: 14px;
    color: rgba(255,255,255,.6);
    line-height: 1.6;
    margin-bottom: 32px;
    font-weight: 300;
}

/* Pills de funcionalidades */
#login-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.l-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.75);
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(6px);
    transition: background .25s, border-color .25s, color .25s, transform .2s;
    cursor: default;
    animation: fade-up .9s ease both;
}
.l-pill:nth-child(1) { animation-delay: .15s; }
.l-pill:nth-child(2) { animation-delay: .25s; }
.l-pill:nth-child(3) { animation-delay: .35s; }

.l-pill:hover {
    background: rgba(230,51,41,.25);
    border-color: rgba(230,51,41,.5);
    color: #fff;
    transform: translateY(-2px);
}
.l-pill i { font-size: 11px; color: #e63329; }

/* ═══════════════════════════════════════════════════════════════
   BARRA VERMELHA DIVISÓRIA
═══════════════════════════════════════════════════════════════ */
#login-barra {
    background: #e63329;
    position: relative;
    z-index: 10;
    overflow: visible;
}

/* Glow lateral */
#login-barra-glow {
    position: absolute;
    inset: 0;
    width: 1px;
    left: -14px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(230,51,41,.5) 30%,
        rgba(230,51,41,.7) 50%,
        rgba(230,51,41,.5) 70%,
        transparent 100%
    );
    animation: glow-pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glow-pulse {
    0%, 100% { opacity: .5; }
    50%       { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   PAINEL DIREITO — formulário
═══════════════════════════════════════════════════════════════ */
#login-right {
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 32px;
    position: relative;
    overflow-y: auto;
}

#login-form-wrap {
    width: 100%;
    max-width: 340px;
    animation: slide-in-right .6s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Logo */
#login-logo-wrap {
    text-align: center;
    margin-bottom: 28px;
    animation: fade-down .7s ease both .1s;
}

#login-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(230,51,41,.18));
    transition: transform .3s ease, filter .3s ease;
}
#login-logo:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 4px 16px rgba(230,51,41,.32));
}

/* Títulos */
#login-titulo {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    text-align: center;
    margin-bottom: 6px;
    animation: fade-up .7s ease both .15s;
}

#login-sub {
    font-size: 13px;
    color: #aaa;
    text-align: center;
    margin-bottom: 28px;
    animation: fade-up .7s ease both .2s;
}

/* Erro */
#login-erro {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fdecea;
    border: 1px solid #fcc;
    border-left: 4px solid #e63329;
    color: #c62828;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-7px); }
    40%      { transform: translateX(7px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(5px); }
}
.login-shake { animation: shake .4s ease; }

/* ── CAMPOS COM LABEL FLUTUANTE ── */
.login-field {
    position: relative;
    margin-bottom: 24px;
    animation: fade-up .7s ease both;
}
#field-login { animation-delay: .25s; }
#field-senha  { animation-delay: .32s; }

.login-field-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 14px;
    transition: color .2s;
    pointer-events: none;
    z-index: 1;
}

.login-field input {
    width: 100%;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 0;
    padding: 12px 36px 10px 26px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    color: #222;
    background: transparent;
    outline: none;
    transition: border-color .2s;
    height: auto;
}

/* Label flutuante */
.login-field label {
    position: absolute;
    left: 26px;
    top: 12px;
    font-size: 14px;
    color: #aaa;
    pointer-events: none;
    transition: all .2s ease;
    font-family: 'Roboto', sans-serif;
}

/* Quando o input tem conteúdo (placeholder=" " trick) ou está focado */
.login-field input:focus ~ label,
.login-field input:not(:placeholder-shown) ~ label {
    top: -8px;
    font-size: 10.5px;
    color: #e63329;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    left: 26px;
}

/* Barra animada embaixo */
.login-field-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: #e63329;
    transition: width .25s ease;
    border-radius: 2px;
}
.login-field input:focus ~ label ~ .login-field-bar,
.login-field input:focus + .login-field-bar {
    width: 100%;
}

/* Hack: barra vem depois do label no DOM */
.login-field input:focus ~ .login-field-bar { width: 100%; }

.login-field:focus-within .login-field-bar  { width: 100%; }
.login-field:focus-within .login-field-icon { color: #e63329; }

/* Campo com erro */
.login-field.field-error input         { border-color: #e63329; }
.login-field.field-error .login-field-bar { width: 100%; background: #e63329; }

/* Botão de mostrar senha */
#btn-toggle-senha {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
    padding: 6px;
    transition: color .2s;
    display: flex;
    align-items: center;
    height: auto;
    width: auto;
}
#btn-toggle-senha:hover { color: #e63329; }

/* ── BOTÃO ENTRAR ── */
#btn-entrar {
    position: relative;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #e63329 0%, #c0291f 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    letter-spacing: .5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(230,51,41,.35);
    transition: transform .18s ease, box-shadow .18s ease;
    margin-top: 10px;
    animation: fade-up .7s ease both .4s;
    height: auto;
    width: 100%;
}

#btn-entrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(230,51,41,.48);
}
#btn-entrar:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(230,51,41,.3);
}

/* Shimmer no hover */
#btn-shimmer {
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255,255,255,.22) 50%,
        transparent 100%
    );
    transition: left .4s ease;
    pointer-events: none;
}
#btn-entrar:hover #btn-shimmer { left: 150%; }

#btn-entrar.loading {
    opacity: .8;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── RODAPÉ DE LINKS ── */
#login-rodape {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    animation: fade-up .7s ease both .5s;
}

#login-rodape a {
    font-size: 12px;
    color: #aaa;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color .2s;
}
#login-rodape a:hover { color: #e63329; }
.login-sep { color: #ddd; font-size: 12px; }

/* Copyright */
#login-copyright {
    position: absolute;
    bottom: 16px;
    font-size: 10.5px;
    color: #ccc;
    text-align: center;
    animation: fade-up .7s ease both .6s;
}

/* ── ANIMAÇÕES UTILITÁRIAS ── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-down {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVO — mobile: empilha verticalmente
═══════════════════════════════════════════════════════════════ */
@media (max-width: 800px) {
    #login-root {
        grid-template-columns: 1fr;
        grid-template-rows: 220px 4px 1fr;
        height: 100vh;
    }

    #login-barra {
        width: 100%;
        height: 4px;
    }
    #login-barra-glow {
        width: 100%;
        left: 0;
        top: -10px;
        height: 1px;
        background: linear-gradient(to right, transparent, rgba(230,51,41,.6), transparent);
    }

    #login-left-content {
        padding: 0 28px 28px;
        justify-content: flex-end;
    }

    #login-tagline { font-size: 22px; }
    #login-subtag  { display: none; }
    #login-pills   { display: none; }

    #login-logo-left { display: block; height: 36px; margin-bottom: 12px; }

    #login-right {
        padding: 32px 24px 60px;
    }

    #login-copyright { font-size: 10px; }
}
