:root {
    --primary-color: #004d40;
    /* Verde Escuro Institucional */
    --secondary-color: #00796b;
    --accent-color: #ffca28;
    /* Amarelo para destaque/alertas */
    --background-color: #f5f5f5;
    --text-color: #333;
    --white: #ffffff;
    --error-color: #d32f2f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 2rem;
    background-color: #e0e0e0;
    border-radius: 5px;
    height: 10px;
    overflow: hidden;
}


.progress-bar {
    height: 100%;
    background-color: var(--secondary-color);
    width: 0%;
    transition: width 0.4s ease;
}

/* Form Steps */
.step-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: none;
    /* Hidden by default */
}

.step-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

/* Step Header */
.step-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--background-color);
}

.step-header h2 {
    color: var(--primary-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 121, 107, 0.2);
}

/* Radio/Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f9f9f9;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.radio-item:hover,
.checkbox-item:hover {
    background: #eee;
}

/* Buttons */
.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: #757575;
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #616161;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--text-color);
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    /* Para comportar-se como botão sendo <a> */
    margin-top: 1rem;
}

.btn-accent:hover {
    background-color: #ffb300;
    /* Darker yellow */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Dynamic Sections */
.dependent-item {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    display: none;
}

.alert-danger {
    background-color: #ffebee;
    color: var(--error-color);
    border: 1px solid #ffcdd2;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Summary Table for Step 7 */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.summary-table th,
.summary-table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.summary-table th {
    background-color: #f9f9f9;
    width: 40%;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 1rem auto;
        padding: 0 10px;
        width: 100%;
        max-width: 100%;
    }

    .step-content {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .btn-group {
        flex-direction: column-reverse;
        /* Stack buttons, Back on bottom */
        gap: 0.8rem;
    }

    .btn {
        width: 100%;
        padding: 0.8rem;
        /* Larger touch target */
    }

    .filter-grid {
        grid-template-columns: 1fr;
        /* Stack filters */
    }

    /* Adjust checkbox/radio for better touch */
    .radio-item,
    .checkbox-item {
        padding: 0.8rem;
        width: 100%;
        /* Full width on mobile */
    }

    /* Summary Table Responsive */
    .summary-table th,
    .summary-table td {
        display: block;
        width: 100%;
    }

    .summary-table th {
        background-color: #eee;
        font-weight: bold;
    }

    /* Admin specific */
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Utilities */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid #eee;
}

/* Ensure images/inputs don't overflow */
img,
video,
canvas,
svg {
    max-width: 100%;
}

input,
select,
textarea {
    max-width: 100%;
}