:root {
    --primary-color: #007bff;
    --secondary-color: #f8f9fa; /* Lighter gray for background */
    --accent-color: #ff5722;
    --text-color: #343a40; /* Darker text */
    --input-border-color: #ced4da;
    --input-focus-border-color: #80bdff;
    --input-bg-color: #fff;
    --button-hover-color: #0056b3;
    --error-color: #dc3545;
    --success-color: #28a745;
    --white: #fff;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
}

.footer-icon {
    vertical-align: middle;
    margin-right: 5px;
    width: 20px;
    height: 20px;
    display: inline-block;
}

footer a:hover {
    text-decoration: underline;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    min-height: 100%;
    position: relative;
    line-height: 1.6;
}

/* --- Header and Footer (Untouched as requested) --- */
header {
    width: 100%;
    background-color: black;
    color: white;
    padding: 10px 0;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}
.logo {
    max-width: 110px;
    margin-left: 1.5em;
}
.header-links {
    margin-right: 20px;
    display: flex;
}
.header-links a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    font-size: 16px;
    background-color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 5px;
}
.header-links a:hover {
    background-color: var(--accent-color);
    color: white;
}
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 5px;
    text-align: center;
    font-size: 14px;
    position: relative;
    bottom: 0;
    width: 100%;
    margin-top: 40px; /* Add some space above footer */
}
footer p {
    margin: 5px 0;
}
footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    display: inline-block;
}
footer a:hover {
    text-decoration: underline;
}

/* --- Form Container Improvements --- */
main {
    padding: 20px 0; /* Add padding to main content area */
}

.form-container {
    width: 90%;
    max-width: 650px; /* Slightly narrower for better focus */
    margin: 40px auto; /* More vertical margin */
    padding: 40px; /* More padding */
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid #e9ecef;
    position: relative;
}

.form-container h2 {
    margin-bottom: 15px; /* More space below heading */
    font-size: 28px; /* Larger heading */
    color: var(--text-color);
    font-weight: 700; /* Bolder */
    text-align: center; /* Center heading */
    border-bottom: 1px solid #eee; /* Subtle separator */
    padding-bottom: 15px;
}

.form-container p {
    font-size: 16px;
    color: #6c757d; /* Lighter text for description */
    margin-bottom: 30px; /* More space below description */
    text-align: center; /* Center description */
    padding-left: 0; /* Remove previous padding */
}

/* --- Form Element Improvements --- */
#registrationForm label {
    display: block; /* Ensure labels are on their own line */
    margin-bottom: 8px; /* Space below label */
    font-weight: 600; /* Slightly bolder labels */
    font-size: 15px;
    color: #495057;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="password"],
.form-container input[type="date"],
.form-container input[type="tel"],
.form-container select#gender {
    width: 100%; /* Use full width */
    padding: 14px 16px; /* More padding */
    margin-bottom: 20px; /* Consistent margin below inputs */
    border: 1px solid var(--input-border-color);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    font-size: 16px;
    background-color: var(--input-bg-color);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Remove browser default appearance for select */
.form-container select#gender {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8em auto;
    padding-right: 2.5rem; /* Make space for arrow */
}

/* Remove the inline style for #gender */
/* The style block inside <header> in index.php should be removed */

.form-container input[type="text"]:focus,
.form-container input[type="email"]:focus,
.form-container input[type="password"]:focus,
.form-container input[type="date"]:focus,
.form-container input[type="tel"]:focus,
.form-container select#gender:focus {
    border-color: var(--input-focus-border-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Input specific adjustments */
.form-container input#cpf {
    margin-bottom: 20px; /* Ensure consistent margin */
}

/* Remove the extra div around phone input */
/* The <div style="position: relative;"> in index.php should be removed */

.form-container button[type="submit"] {
    width: 100%;
    padding: 15px; /* Slightly larger padding */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 600; /* Bolder text */
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.1s;
    margin-top: 10px; /* Add some space above button */
}

.form-container button[type="submit"]:hover {
    background-color: var(--button-hover-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.form-container button[type="submit"]:active {
    transform: translateY(1px);
}

/* --- Message Area Styling --- */
#message {
    text-align: center;
    font-size: 15px; /* Slightly smaller */
    margin-top: 25px;
    padding: 12px;
    border-radius: var(--border-radius);
    display: none; /* Hide by default, show via JS */
}

#message.success {
    color: var(--success-color);
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    display: block;
}

#message.error {
    color: var(--error-color);
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    display: block;
}

/* --- New Loader Styles (Replaces .loader-overlay) --- */
.spinner-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8); /* Lighter overlay */
    justify-content: center;
    align-items: center;
    z-index: 1001; /* Ensure it's above other content */
    backdrop-filter: blur(3px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3; /* Light grey */
    border-top: 5px solid var(--primary-color); /* Blue */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Remove Old Loader Styles --- */
/* .loader-overlay, .loader-overlay img { display: none !important; } */
/* Better to remove the HTML element itself */

/* --- Menu Button and Mobile Menu (Untouched as requested) --- */
.menu-button {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-left: 10px;
    transition: transform 0.3s ease-in-out;
}
.menu-button div {
    width: 30px;
    height: 3px;
    background: white;
    margin: 5px 0;
    border-radius: 3px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
.menu-button.open div:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.menu-button.open div:nth-child(2) {
    opacity: 0;
}
.menu-button.open div:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}
.menu {
    display: none;
    position: fixed;
    top: 60px; /* Adjust based on header height */
    left: 0;
    width: 100vw;
    height: calc(100vh - 60px);
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 1001;
    padding-top: 20px;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu.show {
    display: block;
    opacity: 1;
    transform: translateX(0);
}
.menu a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    margin: 15px 20px;
    font-size: 18px;
    text-align: center;
    padding: 10px;
    border-radius: var(--border-radius);
}
.menu a:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
}

/* --- Media Queries (Partially adjusted for form, mostly untouched) --- */
@media (max-width: 768px) {
    .header-links {
        display: none;
    }
    .menu-button {
        display: flex;
    }
    .form-container {
        width: 90%;
        padding: 30px;
        margin: 30px auto;
    }
    .form-container h2 {
        font-size: 24px;
    }
    /* Keep menu styles as they were */
    .menu {
        top: 60px; /* Assuming header height is around 60px */
        height: calc(100vh - 60px);
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 90px; /* Adjusted */
        margin-left: 1em;
    }
    .form-container {
        padding: 20px;
        margin: 20px auto;
    }
    .form-container h2 {
        font-size: 22px;
    }
    .form-container input[type="text"],
    .form-container input[type="email"],
    .form-container input[type="password"],
    .form-container input[type="date"],
    .form-container input[type="tel"],
    .form-container select#gender {
        padding: 12px 14px;
        font-size: 15px;
    }
    .form-container button[type="submit"] {
        padding: 14px;
        font-size: 16px;
    }
    footer {
        font-size: 13px; /* Adjusted */
        padding: 10px 5px;
    }
    .footer-icon {
        width: 18px;
        height: 18px;
    }
    /* Keep menu styles as they were */
}

