@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,400;1,200&display=swap');

/* ------------------------------------------- */
/* 0. CORREÇÃO DE BORDAS BRANCAS E OVERFLOW HORIZONTAL */
/* ------------------------------------------- */
html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    /* CRÍTICO: Impede que o conteúdo cause barra de rolagem horizontal e as bordas brancas */
    overflow-x: hidden; 
    height: 100%;
}

/* ------------------------------------------- */
/* 1. CENTRALIZAÇÃO E EXPANSIVIDADE */
/* ------------------------------------------- */
.desktop {
    background-color: #fff2dd;
    width: 100%;
    min-height: 100vh; /* Garante que ocupe a altura total da tela */
    position: relative;
    display: flex; 
    justify-content: center;
    align-items: center;
    padding: 0; /* Removido padding para evitar overflow */
}

/* Caixa branca centralizada e Responsiva */
.desktop .rectangle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    width: 90%; 
    max-width: 1339px;
    /* AJUSTE CHAVE: Altura aumentada para caber tudo */
    height: 95vh; 
    max-height: 1000px; /* Aumentado o limite de altura */
    min-height: 600px;
    
    background-color: #ffffff;
    border-radius: 40px;
    z-index: 1; 
}

/* Os formulários agora usam o fluxo de layout Flexbox */
#cadastro-form,
#login-form {
    position: absolute;
    z-index: 5; 
    /* AJUSTE CHAVE: Subindo o bloco para 58% (estava em 65%) */
    top: 58%; 
    left: 50%;
    transform: translate(-50%, -50%); /* Centraliza o formulário */
    
    width: 80%; 
    max-width: 1000px;
    height: auto;
    max-height: 90vh;
    
    padding: 0 5%;
    overflow-y: auto; /* Permite scroll em telas pequenas */
    
    /* CRÍTICO: Usa Flexbox para centralizar e organizar o conteúdo interno */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0; /* Garante que os elementos não tenham espaçamento indesejado por padrão */
}

/* CLASSE CRÍTICA PARA ALTERNÂNCIA DE TELAS */
.hidden-form {
    display: none !important;
}

/* Link de Voltar ao Index */
.desktop .back-to-index-link {
    position: absolute;
    top: 30px; 
    left: 30px; 
    font-family: "Poppins-Regular", Helvetica;
    font-weight: 400;
    font-size: clamp(14px, 2vw, 18px);
    color: #780000;
    text-decoration: none;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
}

.desktop .back-to-index-link:hover {
    text-decoration: underline;
}

.desktop .back-arrow {
    margin-right: 5px;
    font-size: 1.5em; 
}

/* ------------------------------------------- */
/* 2. RÓTULOS, LINHAS e INPUTS (FLUIDO E CENTRALIZADO) */
/* ------------------------------------------- */

/* Contêiner de cada grupo de input: VOLTA PARA FLUXO NORMAL */
.desktop .input-group {
    position: relative; 
    width: 100%;
    max-width: 644px; /* Limita a largura dos campos */
    /* AJUSTE: Espaçamento reduzido entre os campos */
    margin-bottom: clamp(20px, 3vw, 30px); 
}

/* Estilos de Rótulos */
.desktop .text-wrapper,
.desktop .text-wrapper-2,
.desktop .div {
    position: static; 
    left: auto;
    font-family: "Poppins-ExtraLight", Helvetica;
    font-weight: 200;
    color: #000000;
    font-size: clamp(24px, 3vw, 40px);
    white-space: nowrap;
    margin-left: 0;
}

/* Estilos de Linhas */
.desktop .frame-name,
.desktop .frame-email,
.desktop .frame-password {
    position: static; 
    left: auto; 
    width: 100%; 
    height: 1px;
    background-color: #780000;
    margin-top: 5px;
}

/* INPUT FIELD */
.desktop .input-field {
    border: none;
    background-color: transparent;
    padding: 0;
    font-size: clamp(20px, 2.5vw, 32px);
    color: #000000;
    width: 100%; /* Ocupa a largura do input-group */
    height: 60px;
    line-height: 60px;
    outline: none;
    position: static; 
    left: auto;
    z-index: 20;
}


/* ------------------------------------------- */
/* 3. POSICIONAMENTO (REMOVIDO COMPLETAMENTE) */
/* ------------------------------------------- */

/* NOTA: Blocos de posicionamento fixo removidos para usar o Flexbox */


/* ------------------------------------------- */
/* 4. CHECKBOX, BOTÃO E FEEDBACK (FLUIDO E COMPACTO) */
/* ------------------------------------------- */

#cadastro-form .terms-group {
    position: relative; 
    top: auto; 
    left: auto;
    width: 100%; 
    max-width: 644px; /* Limita a largura dos termos */
    display: flex; 
    align-items: center; 
    /* AJUSTE: Espaçamento reduzido */
    margin-top: clamp(10px, 1.5vw, 15px);
    margin-bottom: clamp(15px, 2vw, 25px);
}

/* Estilo para o container do texto */
.terms-text-container {
    width: 100%;
}

/* Estilo do Checkbox */
.desktop .custom-checkbox { 
    width: clamp(20px, 2.5vw, 24px); 
    height: clamp(20px, 2.5vw, 24px); 
    margin-right: clamp(10px, 2vw, 15px); 
    flex-shrink: 0; 
}

/* Estilo do Texto dos Termos */
.desktop .aceita-o-dos-termos {
    width: 100%; 
    font-size: clamp(12px, 1.5vw, 16px);
    line-height: 1.3;
}


/* BOTÃO */
.desktop .submit-btn {
    border: none;
    cursor: pointer;
    position: relative; 
    top: auto; 
    left: auto;
    transform: none; 

    width: 100%;
    max-width: 644px; /* Garante alinhamento com os campos */
    height: clamp(40px, 6vw, 52px);
    background-color: #e6ac4e;
    border-radius: 20px;
    transition: background-color 0.2s;
    
    display: flex; 
    justify-content: center;
    align-items: center;
    padding: 0; 
    z-index: 20;
    /* AJUSTE CHAVE: Margem reduzida para subir mais o botão */
    margin-top: clamp(10px, 2vw, 20px); 
    margin-bottom: 10px;
}

.desktop .submit-btn:hover {
    background-color: #d89e41;
}

/* Texto "Cadastre-se" / "Entrar" */
.desktop .text-wrapper-3 {
    font-family: "Poppins-Regular", Helvetica;
    font-weight: 400;
    color: #ffffff;
    font-size: 32px;
    text-align: center;
    line-height: 1; 
    white-space: nowrap;
    width: auto;
}

/* Mensagem de Feedback (Mantida para erros) */
#cadastro-message, 
#login-message {
    position: relative; 
    top: auto; 
    left: auto;
    transform: none;

    width: 100%;
    max-width: 644px;
    text-align: center;
    font-family: "Poppins", Helvetica;
    font-size: clamp(16px, 2.5vw, 20px);
    min-height: 25px; 
    z-index: 25; 
    /* AJUSTE: Margem de cima e baixo reduzida */
    margin-top: 5px; 
    margin-bottom: 5px; 
}

/* LINK/BOTÃO DE ALTERNÂNCIA */
.desktop .toggle-link {
    position: relative; 
    top: auto;
    left: auto;
    transform: none;

    width: 100%;
    max-width: 644px; /* Garante alinhamento */
    font-family: "Poppins-ExtraLight", Helvetica;
    font-weight: 200;
    font-size: clamp(14px, 2vw, 18px);
    color: #000000;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
    z-index: 20;
    /* AJUSTE: Margem reduzida */
    margin-top: 5px;
    margin-bottom: 5px;
}
.desktop .toggle-link:hover {
    text-decoration: underline;
    color: #780000;
}

/* Posição específica para o link de recuperação */
#login-form #open-recovery-modal {
    top: auto; 
    width: 100%;
}

#login-form #toggle-to-cadastro {
    top: auto;
}

/* LOGO e Título "Login" / "Cadastro" (Posicionamento mantido para ficarem acima) */
.desktop .group {
    position: absolute;
    top: 5vh; /* Ajuste para cima (5vh) */
    left: 50%;
    transform: translateX(-50%);
    width: 25%;
    max-width: 300px;
    height: auto; 
    z-index: 20; 
}

.desktop .text-wrapper-4 {
    position: absolute;
    top: 15vh; /* Ajuste para cima (15vh) */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    font-family: "Poppins-ExtraLightItalic", Helvetica;
    font-weight: 200;
    font-style: italic;
    color: #780000;
    font-size: clamp(40px, 6vw, 64px);
    z-index: 20;
}

/* ------------------------------------------- */
/* 5. MODAIS (RECOVERY E SUCESSO) */
/* ------------------------------------------- */

/* Classe para esconder elementos - essencial para o modal */
.hidden-element {
    display: none !important;
}

/* Estilos de fundo e centralização do Modal (APLICADO A AMBOS) */
#recovery-modal,
#success-modal { 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;
}

/* Estilo para o 'X' de fechar (APLICADO A AMBOS) */
#close-recovery-modal,
#close-success-modal { 
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #780000;
}

/* Título e Texto do Modal de Sucesso */
#success-modal h3 {
    font-family: "Poppins-Regular", Helvetica;
    color: #006600; /* Verde para sucesso */
    font-size: 24px;
    margin-bottom: 15px;
}

#success-modal #success-message {
    color: #333;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Botão "Ir para Login" no Modal de Sucesso */
#success-modal-to-login { 
    background-color: #e6ac4e;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    width: 100%;
}
#success-modal-to-login:hover {
    background-color: #d89e41;
}

/* Estilos de inputs e botão de recovery (mantidos) */
#recovery-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#recovery-form button {
    background-color: #e6ac4e;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

#recovery-form button:hover {
    background-color: #d89e41;
}

/* MENSAGENS DE FEEDBACK */
#cadastro-message,
#login-message,
#recovery-message {
    min-height: 25px; 
    padding: 5px 0;
    
    text-align: center;
    font-family: 'Poppins', Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 500;
    
    background-color: transparent !important; 
    border: none !important; 
    
    color: inherit; 
    
    z-index: 100;
}

#cadastro-message,
#login-message {
    position: relative; 
    top: auto; 
    width: 100%; 
    left: auto;
    transform: none;
}

#recovery-message {
    position: relative; 
    margin-top: 15px;
}