html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Reintroduce min-height for body */
    background: linear-gradient(135deg, #d9fcfa 0%, #fed6e3 100%); /* Gradiente animado */
    background-size: 200% 200%; /* Re-add background-size */
    animation: gradientAnimation 10s ease infinite alternate; /* Re-add animation */
    color: #333;
    overflow: hidden; /* Prevent unwanted scrollbars */
}

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

.container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 15px; /* Bordas mais arredondadas */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Sombra mais pronunciada */
    width: 100%;
    max-width: 450px; /* Aumenta ligeiramente a largura */
    text-align: center;
    overflow: hidden; /* Keep overflow hidden for container */
    position: relative; /* Keep position relative */
    transform: scale(0.95); /* Começa ligeiramente menor */
    animation: fadeInScale 0.8s ease-out forwards; /* Animação de entrada */
    height: auto; /* Allow height to adjust to content */
    display: flex;
    flex-direction: column; /* Arrange content vertically */
    /* Removed justify-content: space-between from here */
    max-height: 90vh; /* Limit height to prevent overflow on very small screens */
}

.logo {
    max-width: 150px; /* Ajuste o tamanho conforme necessário */
    margin-bottom: 30px; /* Espaçamento abaixo da logo */
    margin-top: 10px; /* Espaçamento acima da logo */
    display: block; /* Garante que a margem automática funcione para centralizar */
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-wrapper {
    position: relative;
    width: 100%;
    height: auto; /* Allow height to adjust to content */
    display: flex;
    flex-direction: column; /* Arrange form-boxes vertically */
}

.form-box {
    position: absolute; /* Keep absolute for transitions between login/register forms */
    top: 0;
    left: 0;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(100%);
    height: auto; /* Allow form-box to adjust its height dynamically */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.form-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Adjustments for the full registration form */
.form-box.register-full {
    position: relative; /* Make this relative to contain its flex children */
    height: auto; /* Allow register-full to adjust its height dynamically */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Space out title/progress, steps, and buttons */
    /* Remove opacity, visibility, transform as they are handled by .form-box.active */
}

/* The register-full specific styles are now merged into .form-box.active */

.btn {
    width: auto; /* Alterado para auto, permitindo que a largura seja controlada por contextos específicos */
    padding: 14px; /* Aumenta o padding */
    background-color: #191F30; /* Azul principal */
    color: #fff;
    border: none;
    border-radius: 8px; /* Bordas mais arredondadas */
    font-size: 19px; /* Tamanho da fonte maior */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    letter-spacing: 0.5px; /* Espaçamento entre letras */
}

.btn:hover {
    background-color: #0E1320; /* Tom mais escuro de #191F30 para o hover */
    transform: translateY(-3px); /* Move mais para cima */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2); /* Sombra ao passar o mouse */
}

.form-box.login .btn {
    width: 100%; /* Garante que o botão de login ocupe 100% da largura */
}

/* Ajustes para o formulário de cadastro completo */
/* The register-full specific styles are now merged into .form-box.active */

.form-box.register-full .step {
    display: none;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    box-sizing: border-box; /* Include padding in the element's total width */
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Ensure steps can scroll if content is too long */
    overflow-y: auto;
    /* Removed padding-right: 5px; to prevent horizontal scrollbar */
    flex-grow: 1;
}

.form-box.register-full .step.active {
    display: flex;
    flex-grow: 1;
    justify-content: space-between; /* Distribute internal content and buttons */
    align-items: stretch;
    transform: translateX(0);
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.form-box.register-full .step.animate-next-exit {
    transform: translateX(-100%);
}

.form-box.register-full .step.animate-prev {
    transform: translateX(0);
}

/* Ensure inactive steps are fully hidden and don't take up space */
.form-box.register-full .step:not(.active) {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    height: 100%; /* Ensure hidden steps occupy space for smooth transitions */
}

.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 2%;
    background-color: #191F30;
    border-radius: 10px;
    transition: width 0.6s ease-in-out;
}



.form-box.register-full .btn.prev-step {
    background-color: #777; /* Cor diferente para o botão anterior */
    /* margin-right: 10px; Removido para usar o gap do btn-group */
}

.form-box.register-full .btn-group {
    display: flex;
    justify-content: center !important; /* Força a centralização */
    gap: 10px; /* Espaçamento entre os botões */
    width: 100%; /* Garante que o grupo de botões ocupe a largura total */
    flex-wrap: wrap; /* Allow buttons to wrap to the next line if needed */
}

.form-box.register-full .btn-group .btn {
    width: max-content; /* Allow width to adjust to content, without !important */
    flex-grow: 0;
    flex-shrink: 0;
    margin: 0; /* Remove margins, without !important */
    padding-left: 30px; /* Adjust padding, without !important */
    padding-right: 30px; /* Adjust padding, without !important */
}

.form-box.register-full .btn.prev-step:hover {
    background-color: #555;
}


h2 {
    margin-bottom: 25px;
    color: #444; /* Cor mais suave */
    font-size: 32px; /* Tamanho maior */
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #191F30;
    border-radius: 5px;
}

.input-group {
    margin-bottom: 20px;
    position: relative; /* Para animações de label */
}

.input-group input {
    width: 100%;
    padding: 12px 10px;
    border: none;
    border-bottom: 2px solid #ddd;
    background-color: transparent;
    font-size: 16px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    outline: none;
    box-sizing: border-box; /* Ensure padding is included in the width */
}

.error-message {
    color: #e74c3c; /* Cor vermelha para a mensagem de erro */
    font-size: 0.85em; /* Tamanho de fonte menor */
    margin-top: 5px; /* Espaçamento acima da mensagem */
    display: block; /* Garante que ocupe sua própria linha */
    text-align: left;
}

.input-group input:focus {
    border-color: #191F30;
    background-color: #f9f9f9; /* Leve alteração de fundo ao focar */
}

/* Estilo para input inválido */
.input-group input.invalid {
    border-color: #e74c3c; /* Cor vermelha para indicar erro */
    background-color: #ffe8e8; /* Fundo mais claro para erro */
}

.input-group label {
    text-align: left;
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.switch-form {
    margin-top: 25px;
    font-size: 15px; /* Tamanho da fonte ligeiramente maior */
    color: #777;
}

.switch-form a {
    color: #191F30; /* Azul principal */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.switch-form a:hover {
    color: #0E1320; /* Tom mais escuro de #191F30 para o hover */
    text-decoration: underline;
}

/* Estilos para o Pop-up de Mensagens */
.popup-container {
    position: fixed;
    top: 20px; /* Posiciona no topo com um pequeno espaçamento */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center; /* Centraliza horizontalmente */
    align-items: flex-start; /* Alinha ao topo */
    padding: 0 20px; /* Adiciona padding lateral */
    box-sizing: border-box;
    z-index: 1000; /* Garante que fique acima de outros elementos */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-container.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 500px; /* Aumenta um pouco a largura máxima */
    width: 100%;
    transform: translateY(-100%); /* Começa fora da tela */
    transition: transform 0.3s ease;
}

.popup-container.active .popup-content {
    transform: translateY(0); /* Desliza para a posição */
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333;
}

/* Estilos para as Mensagens */
.message {
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
}

.message ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.message ul li {
    margin-bottom: 5px;
}

.message.error {
    background-color: #ffe8e8; /* Fundo vermelho claro */
    color: #cc0000; /* Texto vermelho escuro */
    border: 1px solid #cc0000;
}

.message.success {
    background-color: #e8ffe8; /* Fundo verde claro */
    color: #008000; /* Texto verde escuro */
    border: 1px solid #008000;
}

.file-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.file-input-group input[type="file"] {
    flex-grow: 1;
    padding-right: 30px; /* Espaço para o botão de remover */
}

.remove-file-btn {
    position: absolute;
    right: 10px;
    cursor: pointer;
    color: #ff0000; /* Cor vermelha para o 'x' */
    font-weight: bold;
    font-size: 1.2em;
    padding: 5px;
    line-height: 1;
}

.remove-file-btn:hover {
    color: #cc0000;
}
