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

html,
body {
    height: 100vh;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    padding: 5% 10%;
    align-items: center;
    justify-content: center;
}

main {
    width: 100%;
    height: 100%;
    display: flex;
}

#lado-direito,
#lado-esquerdo {
    border-radius: 10px;
}


/* ============================================================
   LAYOUTS DESKTOP (>= 991px)
   ============================================================ */

@media (min-width: 991px) {
    #lado-direito {
        flex: 1;
    }
    #lado-esquerdo {
        width: 30%;
        min-width: 380px;
    }
    body[data-layout="padrao"] main {
        flex-direction: row;
    }
    body[data-layout="padrao-esquerda"] main {
        flex-direction: row-reverse;
    }
    body[data-layout="padrao-centro"] #lado-direito {
        display: none;
    }
    body[data-layout="padrao-centro"] #lado-esquerdo {
        margin: 0 auto;
    }
    body[data-layout="cheio"],
    body[data-layout="cheio-esquerda"],
    body[data-layout="cheio-centro"] {
        padding: 0;
    }
    body[data-layout="cheio"] main {
        flex-direction: row;
    }
    body[data-layout="cheio-esquerda"] main {
        flex-direction: row-reverse;
    }
    body[data-layout="cheio-centro"] #lado-direito {
        display: none;
    }
    body[data-layout="cheio-centro"] #lado-esquerdo {
        margin: 0 auto;
    }
}


/* ============================================================
   LADO PUBLICITARIO (imagem/gradiente)
   ============================================================ */

#lado-direito {
    flex: 1;
    position: relative;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    animation: moveBg 30s linear infinite alternate;
}

@keyframes moveBg {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}


/* ============================================================
   LADO FORMULARIO
   ============================================================ */

#lado-esquerdo {
    width: 30%;
    min-width: 380px;
}

#lado-form {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* ============================================================
   HEADER
   ============================================================ */

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    max-height: 56px;
    margin-bottom: 16px;
    display: inline-block;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    opacity: 0.9;
}


/* ============================================================
   FORMULARIO
   ============================================================ */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.campo label {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.01em;
}

.campo input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.campo input::placeholder {
    opacity: 0.35;
}

.campo input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.campo input.erro {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}


/* ============================================================
   TOGGLE SENHA
   ============================================================ */

.senha-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.senha-wrapper input {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    user-select: none;
    line-height: 1;
}

.toggle-password:hover {
    opacity: 0.9;
}


/* ============================================================
   BOTAO
   ============================================================ */

.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--cor-base);
    color: #fff;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    letter-spacing: 0.01em;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}


/* ============================================================
   BOTAO GOOGLE
   ============================================================ */

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.google-icon {
    width: 20px;
    height: 20px;
}


/* ============================================================
   LINKS
   ============================================================ */

.login-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: -4px;
}

.login-links a {
    font-size: 0.8rem;
    color: inherit;
    opacity: 0.55;
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.login-links a:hover {
    color: var(--cor-base);
    text-decoration: underline;
}

.login-links-rodape {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: -4px;
}

.login-links-rodape a {
    font-size: 0.72rem;
    color: inherit;
    opacity: 0.35;
    text-decoration: none;
    transition: opacity 0.2s;
}

.login-links-rodape a:hover {
    color: var(--cor-base);
    text-decoration: underline;
}


/* ============================================================
   RODAPE
   ============================================================ */

.login-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.75rem;
    opacity: 0.4;
}


/* ============================================================
   MENSAGENS
   ============================================================ */

.msg-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.msg-box {
    max-width: 440px;
    width: 90%;
    padding: 32px 28px 28px;
    border-radius: 16px;
    text-align: center;
    background: #fff;
    color: #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.msg-box .msg-icone {
    margin-bottom: 12px;
}

.icone-msg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.icone-msg.sucesso {
    background: #22c55e;
}

.icone-msg.alerta {
    background: #f59e0b;
}

.icone-msg.erro {
    background: #ef4444;
}

.msg-box .msg-texto {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.msg-box .msg-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: #1e293b;
    color: #fff;
    transition: opacity 0.2s;
}

.msg-box .msg-btn:hover {
    opacity: 0.85;
}

.msg-box.msg-1 {
    border-top: 4px solid #22c55e;
}

.msg-box.msg-1 .msg-btn {
    background: #22c55e;
}

.msg-box.msg-2 {
    border-top: 4px solid #f59e0b;
}

.msg-box.msg-2 .msg-btn {
    background: #f59e0b;
}

.msg-box.msg-3 {
    border-top: 4px solid #ef4444;
}

.msg-box.msg-3 .msg-btn {
    background: #ef4444;
}


/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 990px) {
    body {
        padding: 20px !important;
    }
    #lado-direito {
        display: none;
    }
    #lado-esquerdo {
        width: 100%;
        min-width: 0;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #lado-form {
        width: 100%;
        max-width: 420px;
        padding: 48px 40px 32px;
        border-radius: 16px;
        height: auto;
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}