@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

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

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #F0EBF8;
    color: #202124;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

.form-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 16px 24px;
}

/* ===== Cards ===== */
.card {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.card-body {
    padding: 24px;
}

/* ===== Header Card ===== */
.header-card {
    border-top: 10px solid #673AB7;
}

.header-card h1 {
    font-size: 32px;
    font-weight: 400;
    color: #202124;
    line-height: 1.25;
    margin-bottom: 12px;
}

.header-description {
    font-size: 14px;
    color: #202124;
    line-height: 1.7;
    margin-bottom: 16px;
}

.header-description strong {
    font-weight: 700;
}

.header-description p {
    margin-bottom: 12px;
}

.required-notice {
    color: #DB4437;
    font-size: 14px;
    padding-top: 12px;
    border-top: 1px solid #dadce0;
}

/* ===== Section Headers ===== */
.section-header {
    background: #673AB7;
    color: #fff;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.section-header strong {
    font-weight: 700;
}

/* ===== Question Cards ===== */
.question-card .card-body {
    padding: 24px;
}

.question-title {
    font-size: 14px;
    font-weight: 400;
    color: #202124;
    margin-bottom: 16px;
    line-height: 1.6;
}

.question-title .required {
    color: #DB4437;
    margin-left: 4px;
}

.question-description {
    font-size: 14px;
    color: #202124;
    line-height: 1.6;
    margin-bottom: 16px;
}

.question-description p {
    margin-bottom: 8px;
}

/* ===== Text Inputs ===== */
.text-input-wrapper {
    position: relative;
    margin-top: 8px;
}

.text-input {
    width: 100%;
    max-width: 320px;
    border: none;
    border-bottom: 1px solid #dadce0;
    padding: 8px 0;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    color: #202124;
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
}

.text-input:focus {
    border-bottom: 2px solid #673AB7;
    padding-bottom: 7px;
}

.text-input::placeholder {
    color: #70757a;
}

.text-input.full-width {
    max-width: 100%;
}

/* Textarea */
.textarea-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #dadce0;
    padding: 8px 0;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    color: #202124;
    background: transparent;
    outline: none;
    resize: none;
    min-height: 32px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.textarea-input:focus {
    border-bottom: 2px solid #673AB7;
    padding-bottom: 7px;
}

.textarea-input::placeholder {
    color: #70757a;
}

/* ===== Radio Buttons ===== */
.radio-group {
    display: flex;
    flex-direction: column;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
    min-height: 40px;
}

.radio-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #5f6368;
    border-radius: 50%;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.radio-option input[type="radio"]:checked {
    border-color: #673AB7;
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: #673AB7;
    border-radius: 50%;
}

.radio-option label {
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    flex: 1;
}

/* ===== Checkboxes ===== */
.checkbox-option {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
    min-height: 40px;
}

.checkbox-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #5f6368;
    border-radius: 2px;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-option input[type="checkbox"]:checked {
    background: #673AB7;
    border-color: #673AB7;
}

.checkbox-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-option label {
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    flex: 1;
}

/* "Outro:" inline text input */
.other-input {
    border: none;
    border-bottom: 1px solid #dadce0;
    padding: 4px 0;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    color: #202124;
    background: transparent;
    outline: none;
    margin-left: 4px;
    width: 200px;
}

.other-input:focus {
    border-bottom: 2px solid #673AB7;
}

.other-input:disabled {
    border-bottom: 1px solid #dadce0;
    color: #70757a;
}

/* ===== Grid / Matrix Questions ===== */
.grid-question {
    overflow-x: auto;
}

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

.grid-table th {
    font-size: 12px;
    font-weight: 500;
    color: #202124;
    padding: 8px 0;
    text-align: center;
    min-width: 48px;
}

.grid-table td {
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid #dadce0;
}

.grid-table td:first-child {
    text-align: left;
    font-size: 14px;
    color: #202124;
    padding-right: 16px;
    min-width: 140px;
}

.grid-table input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #5f6368;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}

.grid-table input[type="radio"]:checked {
    border-color: #673AB7;
}

.grid-table input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: #673AB7;
    border-radius: 50%;
}

/* ===== Linear Scale ===== */
.linear-scale {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.linear-scale .radio-option {
    padding: 4px 0;
}

/* ===== Buttons ===== */
.nav-buttons {
    display: flex;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
}

.btn {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
}

.btn-outlined {
    color: #673AB7;
    background: #fff;
    border: 1px solid #dadce0;
}

.btn-outlined:hover {
    background: #F0EBF8;
}

.btn-filled {
    color: #fff;
    background: #673AB7;
}

.btn-filled:hover {
    background: #5c2da6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-text {
    color: #673AB7;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    margin-left: auto;
}

.btn-text:hover {
    text-decoration: underline;
}

.clear-selection {
    color: #673AB7;
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Roboto', Arial, sans-serif;
    padding: 4px 0;
    margin-top: 4px;
    display: none;
}

.clear-selection.visible {
    display: inline-block;
}

.clear-selection:hover {
    text-decoration: underline;
}

/* ===== Validation Errors ===== */
.card.error {
    border-left: 4px solid #DB4437;
}

.error-message {
    color: #DB4437;
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

.error-message.visible {
    display: block;
}

.grid-error {
    color: #DB4437;
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

.grid-error.visible {
    display: block;
}

/* ===== Footer ===== */
.form-footer {
    text-align: center;
    padding: 16px 0 24px;
    font-size: 12px;
    color: #70757a;
}

.form-footer p {
    margin-bottom: 4px;
}

.form-footer .brand {
    font-size: 16px;
    color: #70757a;
    margin-top: 12px;
    font-weight: 500;
}

.form-footer .brand strong {
    font-weight: 700;
}

/* ===== Confirmation Page ===== */
.confirmation-card .card-body {
    padding: 24px;
}

.confirmation-card .message {
    font-size: 14px;
    color: #202124;
    margin-bottom: 16px;
}

.confirmation-card .link {
    color: #673AB7;
    text-decoration: none;
    font-size: 14px;
}

.confirmation-card .link:hover {
    text-decoration: underline;
}

/* ===== Page visibility ===== */
.form-page {
    display: none;
}

.form-page.active {
    display: block;
}

/* ===== Responsive ===== */
@media (max-width: 680px) {
    .form-container {
        padding: 8px;
    }

    .card-body {
        padding: 16px;
    }

    .header-card h1 {
        font-size: 24px;
    }

    .grid-table td:first-child {
        min-width: 100px;
        font-size: 12px;
    }

    .grid-table th {
        font-size: 11px;
        min-width: 36px;
    }
}
