/* ==========================================================================
   BASE.CSS - Design System Conexa Saúde
   ========================================================================== */

/* ==========================================================================
   1. RESET
   ========================================================================== */

.ct *,
.ct *::before,
.ct *::after {
    box-sizing: border-box;
}

.ct input,
.ct select,
.ct textarea,
.ct button {
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================================================
   2. CONTAINER
   ========================================================================== */

.ct {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ct__container {
    max-width: 600px;
    width: 100%;
}

.ct__card {
    background-color: var(--ct-color-background);
    border-radius: var(--ct-border-radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

/* ==========================================================================
   3. HEADER (Logo + Título)
   ========================================================================== */

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

.ct__logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.ct__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ct__header-text {
    flex: 1;
}

.ct__header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ct-color-text);
    margin: 0 0 0.25rem;
}

.ct__header-subtitle {
    font-size: 0.875rem;
    color: var(--ct-color-text-light);
    margin: 0;
}

/* ==========================================================================
   4. PROGRESS BAR
   ========================================================================== */

.ct__progress-wrapper {
    margin-bottom: 1.5rem;
}

.ct__progress {
    height: 6px;
    background-color: var(--ct-color-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.ct__progress-bar {
    height: 100%;
    background-color: var(--ct-color-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ct__progress-text {
    font-size: 0.875rem;
    color: var(--ct-color-text-light);
    text-align: center;
}

/* ==========================================================================
   5. SLIDER & SLIDES
   ========================================================================== */

.ct__slider {
    position: relative;
}

.ct .ct__slide {
    display: none !important;
}

.ct .ct__slide.ct__slide--active {
    display: block !important;
    animation: ct-fadeIn 0.3s ease;
}

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

/* ==========================================================================
   6. BACK BUTTON
   ========================================================================== */

.ct__back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ct-color-text-light);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.5rem;
}

.ct__back:hover {
    color: var(--ct-color-primary);
}

/* ==========================================================================
   7. QUESTION
   ========================================================================== */

.ct__question {
    margin-bottom: 1.5rem;
}

.ct__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ct-color-text);
    margin: 0 0 0.5rem;
}

/* Título menor na tela de lead */
.ct__slide[data-ct-slide="lead"] .ct__title {
    font-size: 1rem;
}

.ct__description {
    font-size: 0.8125rem;
    color: var(--ct-color-text-light);
    margin: 0;
}

/* ==========================================================================
   8. OPTIONS (Grid 2x2)
   ========================================================================== */

.ct__options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ct__option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    min-height: 64px;
    background-color: var(--ct-color-background);
    border: 2px solid var(--ct-color-border);
    border-radius: var(--ct-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ct__option:hover {
    border-color: var(--ct-color-primary);
}

.ct__option--selected,
.ct__option:has(.ct__option-input:checked) {
    border-color: var(--ct-color-primary);
    background-color: var(--ct-color-primary-light);
}

.ct__option--selected .ct__option-text,
.ct__option:has(.ct__option-input:checked) .ct__option-text {
    color: var(--ct-color-primary);
    font-weight: 500;
}

.ct__option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ct__option-text {
    font-size: 0.9375rem;
    color: var(--ct-color-text);
    line-height: 1.4;
}

/* Single column for long options */
.ct__options--single {
    grid-template-columns: 1fr;
}

/* ==========================================================================
   9. BUTTONS
   ========================================================================== */

.ct__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1.125rem 1.5rem;
    min-height: 56px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--ct-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ct__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ct__button--primary {
    background-color: var(--ct-color-primary);
    color: #ffffff;
}

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

.ct__button--secondary {
    background-color: transparent;
    color: var(--ct-color-text);
    border: 1px solid var(--ct-color-border);
}

.ct__button--secondary:hover:not(:disabled) {
    border-color: var(--ct-color-primary);
    color: var(--ct-color-primary);
}

/* CTA Button */
.ct__button--cta {
    text-decoration: none;
    font-size: 1.0625rem;
}

.ct__button--cta:hover {
    text-decoration: none;
}

/* ==========================================================================
   10. FORM FIELDS
   ========================================================================== */

.ct__form {
    display: flex;
    flex-direction: column;
}

.ct__fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ct__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.ct__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ct-color-text-light);
}

.ct__input,
.ct__select,
.ct__textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--ct-color-text);
    background-color: var(--ct-color-background);
    border: 1px solid var(--ct-color-border);
    border-radius: var(--ct-border-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ct__input:focus,
.ct__select:focus,
.ct__textarea:focus {
    outline: none;
    border-color: var(--ct-color-primary);
    box-shadow: 0 0 0 3px var(--ct-color-primary-light);
}

.ct__input::placeholder,
.ct__textarea::placeholder {
    color: var(--ct-color-text-light);
}

.ct__input--invalid {
    border-color: var(--ct-color-error);
}

.ct__error {
    font-size: 0.75rem;
    color: var(--ct-color-error);
    min-height: 1rem;
}

/* Two columns for inputs */
.ct__fields--row {
    flex-direction: row;
    gap: 1rem;
}

.ct__fields--row .ct__field {
    flex: 1;
}

/* ==========================================================================
   11. CHECKBOX
   ========================================================================== */

.ct__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--ct-color-text-light);
    cursor: pointer;
    line-height: 1.5;
}

.ct__checkbox-label input {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    accent-color: var(--ct-color-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.ct__checkbox-label a {
    color: var(--ct-color-primary);
    text-decoration: underline;
}

.ct__checkbox-label a:hover {
    text-decoration: none;
}

/* ==========================================================================
   12. LOADING
   ========================================================================== */

.ct__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
}

.ct__spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--ct-color-border);
    border-top-color: var(--ct-color-primary);
    border-radius: 50%;
    animation: ct-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes ct-spin {
    to {
        transform: rotate(360deg);
    }
}

.ct__loading p {
    color: var(--ct-color-text-light);
    margin: 0;
}

/* ==========================================================================
   13. RESULT
   ========================================================================== */

.ct__result {
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.ct__result h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ct-color-text);
    margin: 0 0 1rem;
}

.ct__result p {
    color: var(--ct-color-text);
    margin: 0 0 1rem;
}

.ct__result strong {
    color: var(--ct-color-primary);
}

.ct__cta {
    margin-bottom: 1rem;
}

.ct__actions {
    display: flex;
    gap: 0.75rem;
}

.ct__actions .ct__button {
    flex: 1;
}

/* ==========================================================================
   14. INFO BOX
   ========================================================================== */

.ct__info {
    padding: 1rem;
    background-color: var(--ct-color-primary-light);
    border-radius: var(--ct-border-radius);
    margin-bottom: 1.5rem;
}

.ct__info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ct-color-text);
}

/* ==========================================================================
   15. RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
    .ct__card {
        padding: 1.5rem;
    }

    .ct__options {
        grid-template-columns: 1fr;
    }

    .ct__fields--row {
        flex-direction: column;
    }

    .ct__header-title {
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    .ct__card {
        padding: 2.5rem;
    }

    .ct__title {
        font-size: 1.25rem;
    }
}
