#tabulos-quiz-wrapper {
    --t-white: #fff;
    --t-ivory: #f1f1e6;
    --t-bordeaux: #960c47;
    --t-bordeaux-dark: #6f0733;
    --t-gold: #c3a343;
    --t-gold-light: #ede18f;
    --t-gradient-start: #960c47;
    --t-gradient-end: #c3a343;
    --t-bg-card: #fff;
    --t-text-primary: #351725;
    --t-text-secondary: #000;
    --t-border: #e4ded5;
    --t-error: #b4234d;

    font-family: "Montserrat", Helvetica, Arial, sans-serif;
    color: var(--t-text-primary);
    position: relative;
    padding: 2rem 0;
    box-sizing: border-box;
    line-height: 1.5;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
}

#tabulos-quiz-wrapper * {
    box-sizing: border-box;
}

/* Inner Container */
#tabulos-quiz-wrapper .tabulos-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

/* --- HEADER --- */
#tabulos-quiz-wrapper .quiz-header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    position: relative;
}

#tabulos-quiz-wrapper .tabulos-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 1rem;
    text-transform: uppercase;
    color: var(--t-text-secondary);
    animation: tabulosFadeIn 1s ease-out 0.3s both;
}

#tabulos-quiz-wrapper .tabulos-intro {
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 1rem;
    color: var(--t-text-secondary);
    line-height: 1.6;
    animation: tabulosFadeIn 1s ease-out 0.3s both;
}

/* --- PROGRESS TEXT --- */
#tabulos-quiz-wrapper .progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--t-text-secondary);
}

/* --- QUESTION CARD --- */
#tabulos-quiz-wrapper .question-card {
    background: var(--t-bg-card);
    border-radius: 20px;
    padding: 3rem;
    margin: 2rem 0;
    border: 1px solid rgba(150, 12, 71, 0.1);
    box-shadow: 0 18px 55px rgba(92, 55, 70, 0.12);
    position: relative;
    overflow: hidden;
    animation: tabulosSlideInUp 0.6s ease-out;
}

/* The Background Track (Not Loaded State) */
#tabulos-quiz-wrapper .card-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--t-ivory);
    z-index: 1;
}

/* The Foreground Bar (Loaded State) */
#tabulos-quiz-wrapper .card-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 6px;
    background: linear-gradient(to right, var(--t-bordeaux), #bd426f);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 2px 12px rgba(150, 12, 71, 0.22);
}

#tabulos-quiz-wrapper .question-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--t-text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    display: block;
    color: var(--t-gold);
    background: radial-gradient(ellipse farthest-corner at right bottom, #ede18f 0%, #d1b464 8%, #9f7928 30%, #8a6e2f 40%, transparent 80%),
        radial-gradient(ellipse farthest-corner at left top, #ede18f 0%, #d1b464 25%, #5d4a1f 62.5%, #5d4a1f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

#tabulos-quiz-wrapper .question-text {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 2.5rem;
    color: var(--t-text-primary);
}

/* --- ANSWER OPTIONS --- */
#tabulos-quiz-wrapper .answer-option {
    background: #fdfdf9;
    border: 1px solid var(--t-border);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#tabulos-quiz-wrapper .answer-option:hover {
    border-color: var(--t-bordeaux);
    transform: translateX(5px);
    box-shadow: 0 10px 28px rgba(150, 12, 71, 0.12);
}

#tabulos-quiz-wrapper .answer-option::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(150, 12, 71, 0.06),
        rgba(195, 163, 67, 0.1)
    );
    transition: left 0.4s ease;
    z-index: 0;
}

#tabulos-quiz-wrapper .answer-option:hover::before {
    left: 0;
}

#tabulos-quiz-wrapper .option-label {
    position: relative;
    z-index: 1;
}

#tabulos-quiz-wrapper .answer-option.selected {
    border-color: var(--t-bordeaux);
    background: linear-gradient(to right, rgba(150, 12, 71, 0.07), rgba(241, 241, 230, 0.9));
    box-shadow: 0 10px 30px rgba(150, 12, 71, 0.13);
}

#tabulos-quiz-wrapper .option-label {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--t-gold);
    background: radial-gradient(ellipse farthest-corner at right bottom, #ede18f 0%, #d1b464 8%, #9f7928 30%, #8a6e2f 40%, transparent 80%),
        radial-gradient(ellipse farthest-corner at left top, #ede18f 0%, #d1b464 25%, #5d4a1f 62.5%, #5d4a1f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

#tabulos-quiz-wrapper .option-text {
    color: var(--t-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* --- BUTTONS & CONTROLS --- */
#tabulos-quiz-wrapper .quiz-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 2rem auto 0.5rem auto;
}

#tabulos-quiz-wrapper .next-button,
#tabulos-quiz-wrapper .back-button {
    border: none;
    border-radius: 50px;
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* Next Button - Primary */
#tabulos-quiz-wrapper .next-button {
    background: linear-gradient(135deg, var(--t-bordeaux), #b82e68);
    color: white;
    box-shadow: 0 10px 26px rgba(150, 12, 71, 0.22);
    opacity: 0.5;
}

#tabulos-quiz-wrapper .next-button.active {
    opacity: 1;
}

#tabulos-quiz-wrapper .next-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, var(--t-bordeaux-dark), var(--t-bordeaux));
    box-shadow: 0 14px 34px rgba(150, 12, 71, 0.3);
}

/* Back Button - Secondary */
#tabulos-quiz-wrapper .back-button {
    background: var(--t-white);
    border: 1px solid #d8cfd3;
    color: var(--t-bordeaux);
}

#tabulos-quiz-wrapper .back-button:hover {
    border-color: var(--t-bordeaux);
    background: #fbf5f7;
    color: var(--t-bordeaux-dark);
}

/* Error Message (Smooth Animation) */
#tabulos-quiz-wrapper .tabulos-error-message {
    color: var(--t-error);
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;

    /* Animation Properties */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    margin-top: 0;
}

#tabulos-quiz-wrapper .tabulos-error-message.visible {
    max-height: 50px;
    opacity: 1;
    margin-top: 15px;
}

/* --- FORM INPUTS --- */
#tabulos-quiz-wrapper .tabulos-input {
    width: 100%;
    padding: 15px;
    margin-top: 5px;
    background: #fdfdf9;
    border: 1px solid #d8cfd3;
    border-radius: 10px;
    color: var(--t-text-primary);
    font-size: 1rem;
}
#tabulos-quiz-wrapper .tabulos-input:focus {
    outline: none;
    border-color: var(--t-bordeaux);
    box-shadow: 0 0 0 4px rgba(150, 12, 71, 0.08);
}

/* --- RESULTS & UTILITIES --- */
#tabulos-quiz-wrapper .hidden {
    display: none !important;
}

#tabulos-quiz-wrapper .result-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--t-gold);
    background: radial-gradient(ellipse farthest-corner at right bottom, #ede18f 0%, #d1b464 8%, #9f7928 30%, #8a6e2f 40%, transparent 80%),
        radial-gradient(ellipse farthest-corner at left top, #ede18f 0%, #d1b464 25%, #5d4a1f 62.5%, #5d4a1f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

/* --- BACKGROUNDS (Scoped) --- */
#tabulos-quiz-wrapper .bg-blob-1 {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(
        circle,
        rgba(150, 12, 71, 0.1),
        transparent 70%
    );
    filter: blur(60px);
    z-index: 1;
    pointer-events: none;
}

#tabulos-quiz-wrapper .bg-blob-2 {
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(
        circle,
        rgba(195, 163, 67, 0.12),
        transparent 70%
    );
    filter: blur(60px);
    z-index: 1;
    pointer-events: none;
}

/* --- ANIMATIONS --- */
@keyframes tabulosFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tabulosFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* --- RESPONSIVE --- */
@media screen and (max-width: 768px) {
    #tabulos-quiz-wrapper .question-card {
        padding: 1.5rem;
    }
    #tabulos-quiz-wrapper .quiz-controls {
        flex-direction: column-reverse;
        gap: 15px;
    }
    #tabulos-quiz-wrapper .next-button,
    #tabulos-quiz-wrapper .back-button {
        width: 100%;
    }
}

/* --- UTILITIES --- */
#tabulos-quiz-wrapper .tabulos-centered-card {
    text-align: center;
}
#tabulos-quiz-wrapper .tabulos-small-text {
    color: var(--t-text-secondary);
    font-size: 0.9rem;
    margin-top: 20px;
}
#tabulos-quiz-wrapper .tabulos-form-title {
    margin-bottom: 20px;
    font-size: 2rem;
    color: var(--t-bordeaux);
}
#tabulos-quiz-wrapper .tabulos-input-group {
    margin: 20px 0;
}
#tabulos-quiz-wrapper .tabulos-checkbox-group {
    text-align: left;
    font-size: 0.8em;
    margin-bottom: 20px;
    color: var(--t-text-secondary);
    line-height: 1.4;
}
#tabulos-quiz-wrapper .tabulos-checkbox-label {
    display: flex;
    align-items: start;
    gap: 10px;
    cursor: pointer;
}
#tabulos-quiz-wrapper .tabulos-checkbox {
    margin-top: 4px;
    flex-shrink: 0;
    accent-color: var(--t-gradient-end);
}
#tabulos-quiz-wrapper .tabulos-spinner {
    margin-top: 10px;
    color: var(--t-bordeaux);
    font-style: italic;
}
#tabulos-quiz-wrapper .tabulos-input:required {
    border-left: 3px solid var(--t-gold);
}
#tabulos-quiz-wrapper .tabulos-input:focus:invalid {
    border-color: var(--t-error);
    box-shadow: 0 0 0 4px rgba(180, 35, 77, 0.1);
}

/* --- TYPE SPECIFIC COLORING --- */

/* Harmonious ivory, bordeaux and gold palette */
#tabulos-quiz-wrapper .answer-option.option-0 {
    --t-opt-color: #cca23a;
}
#tabulos-quiz-wrapper .answer-option.option-1 {
    --t-opt-color: #c63034;
}
#tabulos-quiz-wrapper .answer-option.option-2 {
    --t-opt-color: #d988b3;
}
#tabulos-quiz-wrapper .answer-option.option-3 {
    --t-opt-color: #201ad0;
}
#tabulos-quiz-wrapper .answer-option.option-4 {
    --t-opt-color: #58b284;
}

/* 2. Apply Colors to Label (A, B, C...) */
#tabulos-quiz-wrapper .answer-option[class*="option-"] .option-label {
    background: var(--t-opt-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--t-opt-color);
}

/* 3. Hover State - Border & Shadow */
#tabulos-quiz-wrapper .answer-option[class*="option-"]:hover {
    border-color: var(--t-opt-color);
    box-shadow: 0 5px 20px
        color-mix(in srgb, var(--t-opt-color), transparent 70%);
}

/* 4. Hover Background Animation */
#tabulos-quiz-wrapper .answer-option[class*="option-"]::before {
    background: linear-gradient(
        to right,
        color-mix(in srgb, var(--t-opt-color), transparent 90%),
        color-mix(in srgb, var(--t-opt-color), transparent 80%)
    );
}

/* 5. Selected State */
#tabulos-quiz-wrapper .answer-option[class*="option-"].selected {
    border-color: var(--t-opt-color);
    background: color-mix(in srgb, var(--t-opt-color), transparent 85%);
    box-shadow: 0 5px 30px
        color-mix(in srgb, var(--t-opt-color), transparent 60%);
}
