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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

.instructions {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.instructions p {
    text-align: justify;
    line-height: 1.8;
}

.form-section {
    background: white;
    padding: 30px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

h3 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.3rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.question-group {
    margin-bottom: 30px;
}

.question {
    font-weight: 600;
    margin-bottom: 15px;
    color: #2d3748;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f7fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.checkbox-label:hover {
    background: #edf2f7;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
    font-size: 15px;
}

.inline-input {
    margin-left: 10px;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    width: auto;
    max-width: 200px;
}

.inline-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    margin-top: 15px;
}

.input-group label {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.input-group input {
    margin-left: 10px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
}

.sub-options {
    margin-top: 10px;
    margin-left: 30px;
}

.sub-label {
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
}

/* Range Slider */
input[type="range"] {
    width: 200px;
    margin: 0 10px;
    cursor: pointer;
}

.range-value {
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
}

.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

/* Form Footer */
.form-footer {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Relatório */
.relatorio-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.relatorio-container h2 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
}

#relatorio-conteudo {
    line-height: 1.8;
}

.relatorio-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.relatorio-section h4 {
    color: #4a5568;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .form-section {
        padding: 20px;
    }

    .inline-input {
        max-width: 150px;
        font-size: 12px;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    input[type="range"] {
        width: 150px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .container {
        max-width: 100%;
    }

    header {
        background: none;
        color: black;
        border: 2px solid #333;
    }

    .form-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .button-group {
        display: none;
    }

    .checkbox-label {
        background: white;
        border: 1px solid #ddd;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeIn 0.5s ease-out;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Textarea */
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Sub-questions */
.sub-question {
    margin-top: 20px;
    padding: 20px;
    background: #f0f4f8;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* MIDAS Scale */
.midas-question {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.midas-question label {
    display: block;
    font-weight: 500;
    color: #2d3748;
}

.midas-question input {
    margin: 8px 0 0 8px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 80px;
}

.midas-result, .gad7-result {
    margin-top: 20px;
    padding: 15px;
    background: #e6fffa;
    border-radius: 8px;
    border: 1px solid #38b2ac;
}

.midas-result p, .gad7-result p {
    margin: 5px 0;
}

/* GAD-7 Scale */
.gad7-options {
    margin-top: 15px;
}

.gad7-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    margin-bottom: 10px;
}

.gad7-header span:first-child {
    text-align: left;
}

.gad7-question {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.gad7-question:hover {
    background: #f7fafc;
}

.gad7-question span {
    text-align: left;
    font-size: 14px;
}

.gad7-question label {
    text-align: center;
    cursor: pointer;
    padding: 5px;
}

.gad7-question input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Número exato exclusivo */
.numero-exato-ativo {
    background: #fff5f5 !important;
    border-color: #fc8181 !important;
}

/* Tooltips/Balões de ajuda */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #2d3748;
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    top: -5px;
    left: 105%;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent #2d3748 transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    animation: fadeIn 0.3s;
}

/* h4 styling */
h4 {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gad7-header,
    .gad7-question {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }
    
    .gad7-header span:first-child,
    .gad7-question span {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .gad7-question label {
        display: inline-block;
        margin: 0 10px;
    }
    
    .tooltip .tooltiptext {
        left: -120px;
        width: 200px;
    }
} 