/*
   🍰 GISOUZA CONFEITARIA — SISTEMA DE AUTENTICAÇÃO
   Design: Paleta GiSouza + Glassmorphism + Smooth Animations
*/

/* ============================================================
   SOBREPOSIÇÃO DO MODAL
   ============================================================ */
.sobreposicao-modal-login {
    position: fixed;
    inset: 0;
    background: var(--fundo-modal);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.sobreposicao-modal-login.ativo {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   CONTAINER DO MODAL
   ============================================================ */
.container-modal-login {
    background: var(--fundo-secundario) !important;
    width: 100%;
    max-width: 460px;
    border-radius: 28px;
    padding: 0;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--borda-terciaria);
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--cor-accent) transparent;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sobreposicao-modal-login.ativo .container-modal-login {
    transform: scale(1) translateY(0);
}

/* Acento superior colorido */
.container-modal-login::before {
    content: '';
    display: block;
    height: 6px;
    background: linear-gradient(90deg, var(--cor-accent), #60a5fa, var(--cor-accent));
    background-size: 200% auto;
    animation: gradienteAndar 3s linear infinite;
    border-radius: 28px 28px 0 0;
}

@keyframes gradienteAndar {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* Padding interno */
.container-modal-login>*:not(:first-child) {
    padding: 0 40px;
}

/* ============================================================
   TEMA AUTOMÁTICO (Variáveis do style.css)
   ============================================================ */
.campo-entrada {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--borda-principal, #f29bb0);
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px !important;
    line-height: normal;
    transition: all 0.25s ease;
    background: #ffffff;
    color: #8D0327 !important; /* Texto rosa/vinho nítido no modo claro */
    font-weight: 600;
    box-sizing: border-box;
}

body.light .campo-entrada,
.light .campo-entrada {
    background: #ffffff !important;
    border: 1.5px solid #f29bb0 !important;
    color: #8D0327 !important; /* Rosa bordô da confeitaria */
    font-weight: 600 !important;
}

body.light .campo-entrada::placeholder,
.light .campo-entrada::placeholder {
    color: rgba(141, 3, 39, 0.45) !important;
    font-weight: 500;
}

body.light .campo-entrada:focus,
.light .campo-entrada:focus {
    outline: none;
    border-color: #8D0327 !important;
    background: #ffffff !important;
    color: #8D0327 !important;
    box-shadow: 0 0 0 4px rgba(141, 3, 39, 0.15) !important;
}

.rotulo-campo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #5A3030;
    letter-spacing: 0.2px;
}

.rotulo-campo i {
    color: var(--cor-accent, #8D0327);
    font-size: 0.85rem;
}

.fechar-modal-login {
    position: absolute;
    top: 18px;
    right: 20px;
    background: #FFFFFF;
    border: 1px solid rgba(232, 211, 188, 0.7);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: #5A3030;
    transition: background 0.25s, color 0.25s, transform 0.3s;
    z-index: 10;
}

.fechar-modal-login:hover {
    background: #F7EFE5;
    color: var(--cor-accent, #8D0327);
    transform: rotate(90deg);
}

.titulo-secao-form {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--cor-accent);
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--borda-terciaria);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.titulo-secao-form::before {
    content: '';
    width: 4px;
    height: 14px;
    background: var(--cor-accent);
    border-radius: 2px;
}

/* Grid para campos de cadastro */
.grid-cadastro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .grid-cadastro {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   CABEÇALHO
   ============================================================ */
.cabecalho-login {
    text-align: center;
    padding: 36px 40px 24px;
    border-bottom: 1px solid var(--borda-terciaria);
    margin-bottom: 28px;
}

.cabecalho-login h2 {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.cabecalho-login p {
    font-size: 0.93rem;
}

/* ============================================================
   TELAS DE AUTENTICAÇÃO
   ============================================================ */
.tela-autenticacao {
    padding-bottom: 40px;
    /* Aumentado para não colar na borda */
}

.tela-autenticacao.hidden {
    display: none !important;
}

/* ============================================================
   CAMPOS DO FORMULÁRIO
   ============================================================ */
.grupo-formulario {
    margin-bottom: 20px;
}

.form-scroll-custom {
    scrollbar-width: thin;
    scrollbar-color: var(--cor-accent) rgba(255, 255, 255, 0.05);
}

.form-scroll-custom::-webkit-scrollbar {
    width: 6px;
}

.form-scroll-custom::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.form-scroll-custom::-webkit-scrollbar-thumb {
    background: var(--cor-accent);
    border-radius: 10px;
}

/* Campo de senha com botão de toggle */
.campo-senha-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.campo-senha-wrapper .campo-entrada {
    padding-right: 46px;
}

.toggle-senha {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--texto-suave);
    font-size: 0.95rem;
    padding: 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.toggle-senha:hover {
    color: var(--cor-accent);
}

/* ============================================================
   BOTÃO PRINCIPAL
   ============================================================ */
.botao-principal-login {
    width: 100%;
    background: var(--cor-accent);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.2px;
    margin-top: 8px;
    box-shadow: 0 6px 20px rgba(141, 3, 39, 0.25);
    background: #8D0327;
}

.botao-principal-login:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #a8042f;
    box-shadow: 0 10px 28px rgba(141, 3, 39, 0.35);
}

.botao-principal-login:active:not(:disabled) {
    transform: translateY(0);
}

.botao-principal-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   BOTÃO LINK
   ============================================================ */
.botao-link {
    background: none;
    border: none;
    color: #8D0327;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    transition: opacity 0.2s, text-decoration 0.2s;
    font-family: inherit;
}

.botao-link:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.botao-link.cadastro-link {
    background: #8D0327;
    color: white;
    border-radius: 999px;
    padding: 10px 18px;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(141, 3, 39, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.botao-link.cadastro-link:hover {
    background: #a8042f;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(141, 3, 39, 0.3);
}

.botao-link.cadastro-link:active {
    transform: translateY(0);
}

.rodape-modal-text {
    color: #5A3030;
    opacity: 0.9;
    font-weight: 600;
    margin-right: 10px;
}

/* ============================================================
   RODAPÉ DO MODAL
   ============================================================ */
.rodape-modal-login {
    margin-top: 28px;
    text-align: center;
    font-size: 0.9rem;
}

.checkbox-legal {
    font-size: 0.9rem;
    color: var(--texto-principal);
}

.checkbox-legal input {
    margin-right: 10px;
    accent-color: var(--cor-accent);
}

.checkbox-legal a {
    color: var(--cor-accent);
    text-decoration: underline;
}

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.hidden {
    display: none !important;
}

/* ============================================================
   SPINNER DE CARREGAMENTO
   ============================================================ */
.carregador {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: white;
    animation: girar 0.75s infinite linear;
    flex-shrink: 0;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   🍞 NOTIFICAÇÕES TOAST
   ============================================================ */
#container-notificacoes {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notificacao {
    background: #FFFFFF;
    color: #5A3030;
    border: 1px solid rgba(232, 211, 188, 0.7);
    padding: 14px 22px;
    border-radius: 14px;
    box-shadow: 0 12px 35px rgba(90, 48, 48, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 5px solid #8D0327;
    min-width: 260px;
    max-width: 340px;
    pointer-events: all;
    font-size: 0.9rem;
    font-weight: 500;
}

.notificacao.visivel {
    transform: translateX(0);
}

/* Classes de tipo — usadas pelo JS */
.notificacao-sucesso {
    border-left-color: #22c55e;
}

.notificacao-erro {
    border-left-color: #ef4444;
}

.notificacao-info {
    border-left-color: var(--cor-accent);
}

.notificacao i {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.notificacao-sucesso i {
    color: #22c55e;
}

.notificacao-erro i {
    color: #ef4444;
}

.notificacao-info i {
    color: var(--cor-accent);
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 500px) {
    .container-modal-login {
        border-radius: 20px;
    }

    .cabecalho-login {
        padding: 28px 24px 20px;
    }

    .container-modal-login>*:not(:first-child) {
        padding: 0 24px;
    }

    .tela-autenticacao {
        padding-bottom: 24px;
    }

    #container-notificacoes {
        right: 12px;
        left: 12px;
        bottom: 16px;
    }

    .notificacao {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}