:root {
    --primary-color: #0056b3;
    --primary-dark: #003d80;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.main-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    display: none; /* Hidden by default */
}

.card.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    filter: brightness(0.9);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

/* Progress Section */
.inspection-header {
    margin-bottom: 30px;
    background: #f1f7ff;
    padding: 20px;
    border-radius: var(--border-radius);
}

.inspection-header h2 {
    border: none;
    margin-bottom: 5px;
    font-size: 1.4rem;
}

.inspection-header h2 span {
    color: var(--text-color);
}

.progress-bar-container {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--success-color);
    width: 0%;
    transition: width 0.4s ease;
}

/* Question Styling */
.criterion-group {
    margin-bottom: 40px;
}

.criterion-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    background: #e7eff7;
    padding: 10px 15px;
    border-left: 5px solid var(--primary-color);
}

.subcriterion-group {
    margin-bottom: 25px;
}

.subcriterion-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--secondary-color);
    padding-left: 10px;
}

.question-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.question-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.question-text {
    font-weight: 500;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.answer-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.option-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.option-btn:hover {
    border-color: var(--primary-color);
}

.option-btn.selected[data-value="Sim"] { border-color: var(--success-color); background: #e8f5e9; color: var(--success-color); }
.option-btn.selected[data-value="Não"] { border-color: var(--danger-color); background: #ffebee; color: var(--danger-color); }
.option-btn.selected[data-value="NA"] { border-color: var(--secondary-color); background: #f5f5f5; color: var(--secondary-color); }

.recommendation-input {
    display: none;
    margin-top: 10px;
}

.recommendation-input.visible {
    display: block;
}

/* Results Table */
.table-responsive {
    overflow-x: auto;
    margin: 30px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    text-align: left;
}

th {
    background-color: var(--primary-color);
    color: white;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f1f7ff;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .main-header h1 { font-size: 1.8rem; }
    .card { padding: 20px; }
    .answer-options { flex-direction: column; }
    .option-btn { width: 100%; }
}

@media print {
    .main-header, .results-actions, .main-footer { display: none; }
    body { background-color: white; }
    .card { box-shadow: none; border: none; padding: 0; }
    table { font-size: 0.8rem; }
}
