/* Reset e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #667eea;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
    margin-bottom: 2rem;
}

.back-button:hover {
    background: #5a67d8;
    color: white;
}

.index-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2rem;
    color: #fbbf24;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    position: relative;
}

.form-container {
    padding: 2rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.form-section h2 {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2 i {
    color: #4f46e5;
    font-size: 1.2rem;
}

/* Question Groups */
.question-group {
    margin-bottom: 1.5rem;
}

.question-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Input Styling */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group input {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group select {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Informação sobre dados */
.data-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    color: #1e40af;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-info i {
    color: #2563eb;
    font-size: 1rem;
}

/* Radio Button Styling */
.radio-group {
    display: grid;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.radio-option:hover {
    background-color: #f1f5f9;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #4f46e5;
    background-color: #4f46e5;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Checkbox Styling */
.checkbox-group {
    display: grid;
    gap: 0.75rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.checkbox-option:hover {
    background-color: #f1f5f9;
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #4f46e5;
    background-color: #4f46e5;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

/* Stress Scale Slider */
.stress-scale {
    margin-top: 1rem;
}

.stress-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #10b981, #f59e0b, #ef4444);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 1rem;
}

.stress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stress-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

#stress-value {
    font-weight: 600;
    color: #4f46e5;
    font-size: 1.2rem;
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
}

/* Form Actions */
.form-actions {
    padding: 2rem;
    background: #f8fafc;
    margin: 0 -2rem -2rem -2rem;
    border-top: 1px solid #e2e8f0;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Results Container */
.results-container {
    padding: 2rem;
    animation: slideIn 0.5s ease-out;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.secondary-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.secondary-btn:hover {
    background: #4b5563;
}

/* Risk Level Card */
.risk-level-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.risk-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#risk-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.risk-icon-low {
    background: #d1fae5;
    color: #059669;
}

.risk-icon-moderate {
    background: #fef3c7;
    color: #d97706;
}

.risk-icon-high {
    background: #fee2e2;
    color: #dc2626;
}

.risk-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.risk-info p {
    color: #6b7280;
    font-weight: 500;
}

#risk-summary {
    color: #374151;
    font-size: 1rem;
    line-height: 1.6;
}

/* Assessment Info */
.assessment-info {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    color: #0c4a6e;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.assessment-info i {
    color: #0ea5e9;
}

/* Recommendations */
.recommendations-section h3 {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendations-grid {
    display: grid;
    gap: 1rem;
}

.recommendation-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.recommendation-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.recommendation-card h4 {
    color: #1e293b;
    font-weight: 600;
    font-size: 1rem;
}

.recommendation-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.priority-1 .recommendation-icon {
    background: #fee2e2;
    color: #dc2626;
}

.priority-2 .recommendation-icon {
    background: #fef3c7;
    color: #d97706;
}

.priority-3 .recommendation-icon {
    background: #dbeafe;
    color: #2563eb;
}

.priority-4 .recommendation-icon {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading-spinner p {
    color: #6b7280;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 12px;
    }

    .header {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .form-container,
    .results-container {
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .input-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .risk-indicator {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .form-actions {
        padding: 1rem;
        margin: 0 -1rem -1rem -1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .radio-group,
    .checkbox-group {
        gap: 0.5rem;
    }

    .radio-option,
    .checkbox-option {
        padding: 0.5rem;
    }
}