/**
 * Quiz Styles
 *
 * Styling for the hosting recommendation quiz form and results page.
 * Matches the prototype visual design.
 *
 * @package HostOffers
 * @since   1.1.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    --ho-quiz-green: #00A859;
    --ho-quiz-green-light: #00C96B;
    --ho-quiz-navy: #003366;
    --ho-quiz-bg: #F8FAFC;
    --ho-quiz-card-bg: #FFFFFF;
    --ho-quiz-card-radius: 48px;
    --ho-quiz-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --ho-quiz-choice-radius: 32px;
    --ho-quiz-choice-border: #F1F5F9;
    --ho-quiz-gray: #64748b;
    --ho-quiz-card-max-width: 768px;
    --ho-quiz-slate: #475569;
}

/* ==========================================================================
   Quiz Page Layout
   ========================================================================== */

.ho-quiz-wrapper {
    background: var(--ho-quiz-bg);
    min-height: 100vh;
    padding: 80px 20px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ho-quiz-wrapper__step-label {
    color: var(--ho-quiz-green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 8px;
}

.ho-quiz-wrapper__heading {
    color: var(--ho-quiz-navy);
    font-size: 30px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
}

/* ==========================================================================
   Quiz Card — outer wrapper that holds header + GF form
   ========================================================================== */

.ho-quiz-card {
    background: var(--ho-quiz-card-bg);
    border-radius: var(--ho-quiz-card-radius);
    box-shadow: var(--ho-quiz-card-shadow);
    border: 1px solid #F1F5F9;
    max-width: var(--ho-quiz-card-max-width);
    width: 100%;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* Strip GF wrapper styles so .ho-quiz-card is the visual card */
.ho-quiz-wrapper .gform_wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.ho-quiz-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: #F1F5F9;
    z-index: 2;
    border-radius: 0;
    overflow: hidden;
}

.ho-quiz-progress__fill {
    height: 100%;
    background: var(--ho-quiz-green);
    box-shadow: 0 0 15px rgba(0, 168, 89, 0.5);
    border-radius: 0;
    transition: width 0.4s ease;
}

/* ==========================================================================
   Card Header (Question X / XX% Complete)
   ========================================================================== */

.ho-quiz-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 64px 64px 0 !important;
    margin-bottom: 48px !important;
    flex-direction: row !important;
    width: 100%;
    box-sizing: border-box;
}

.ho-quiz-card-header__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ho-quiz-card-header__left svg {
    width: 16px;
    height: 16px;
    stroke: #9CA3AF;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ho-quiz-card-header__question {
    color: var(--ho-quiz-gray);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ho-quiz-card-header__pct {
    color: var(--ho-quiz-green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ==========================================================================
   Question Text
   ========================================================================== */

.ho-quiz-wrapper .gform_wrapper .gfield_label,
.ho-quiz-wrapper .gform_wrapper .gsection_title {
    color: var(--ho-quiz-navy);
    font-size: 36px;
    font-weight: 800;
    line-height: 1.25;
    padding: 0 64px 48px;
    margin: 0;
}

/* ==========================================================================
   Radio Choices — Card Style
   ========================================================================== */

.ho-quiz-wrapper .gform_wrapper .gfield_radio,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox {
    padding: 0 64px 64px;
    list-style: none;
    margin: 0;
}

.ho-quiz-wrapper .gform_wrapper .gfield_radio .gchoice,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox .gchoice {
    display: block !important;
    grid-template-columns: none !important;
    margin-bottom: 16px;
    width: 100%;
}

.ho-quiz-wrapper .gform_wrapper .gfield_radio .gchoice:last-child,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox .gchoice:last-child {
    margin-bottom: 0;
}

.ho-quiz-wrapper .gform_wrapper .gfield_radio .gchoice label,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox .gchoice label {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 32px;
    border: 2px solid var(--ho-quiz-choice-border);
    border-radius: var(--ho-quiz-choice-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 20px;
    color: var(--ho-quiz-slate);
    font-weight: 700;
    position: relative;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
}

.ho-quiz-wrapper .gform_wrapper .gfield_radio .gchoice label:hover,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox .gchoice label:hover {
    border-color: var(--ho-quiz-green);
    background-color: rgba(0, 168, 89, 0.05);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 168, 89, 0.1);
}

.ho-quiz-wrapper .gform_wrapper .gfield_radio .gchoice label:hover .ho-quiz-choice-chevron,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox .gchoice label:hover .ho-quiz-choice-chevron {
    border-color: var(--ho-quiz-green);
    background: var(--ho-quiz-green);
}

.ho-quiz-wrapper .gform_wrapper .gfield_radio .gchoice label:hover .ho-quiz-choice-chevron svg,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox .gchoice label:hover .ho-quiz-choice-chevron svg {
    stroke: #fff;
}

/* Hide native radio/checkbox inputs */
.ho-quiz-wrapper .gform_wrapper .gfield_radio input[type="radio"],
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Selected state */
.ho-quiz-wrapper .gform_wrapper .gfield_radio input[type="radio"]:checked + label,
.ho-quiz-wrapper .gform_wrapper .gfield_checkbox input[type="checkbox"]:checked + label {
    border-color: var(--ho-quiz-green);
    background: rgba(0, 168, 89, 0.05);
}

/* ==========================================================================
   Choice Icon Container
   ========================================================================== */

.ho-quiz-choice-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 16px;
    background: var(--ho-quiz-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.ho-quiz-choice-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--ho-quiz-navy);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s;
}

/* Icon hover — green tint */
.ho-quiz-wrapper .gform_wrapper .gchoice label:hover .ho-quiz-choice-icon {
    background: rgba(0, 168, 89, 0.1);
}

.ho-quiz-wrapper .gform_wrapper .gchoice label:hover .ho-quiz-choice-icon svg {
    stroke: var(--ho-quiz-green);
}

/* ==========================================================================
   Choice Chevron
   ========================================================================== */

.ho-quiz-choice-chevron {
    margin-left: auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid #f1f5f9;
    transition: all 0.2s;
}

.ho-quiz-choice-chevron svg {
    width: 20px;
    height: 20px;
    stroke: #e2e8f0;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.2s;
}

/* ==========================================================================
   Choice Text
   ========================================================================== */

.ho-quiz-choice-text {
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   Trust Badges
   ========================================================================== */

.ho-quiz-trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.ho-quiz-trust-badges__item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ho-quiz-trust-badges__item svg {
    width: 16px;
    height: 16px;
    stroke: var(--ho-quiz-green);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   Hide Default GF Navigation
   ========================================================================== */

.ho-quiz-wrapper .gform_wrapper .gform_page_footer,
.ho-quiz-wrapper .gform_wrapper .gform_footer {
    display: none !important;
}

/* Hide GF progress bar (we use custom) */
.ho-quiz-wrapper .gform_wrapper .gf_progressbar_wrapper,
.ho-quiz-wrapper .gform_wrapper .gf_page_steps {
    display: none !important;
}

/* Hide GF "(Required)" text */
.ho-quiz-wrapper .gform_wrapper .gfield_required {
    display: none !important;
}

/* ==========================================================================
   GF 2.5+ Overrides (markup version 2 uses fieldset/legend/divs)
   ========================================================================== */

/* Reset GF 2.5 fieldset styling */
.ho-quiz-wrapper .gform_wrapper fieldset.gfield {
    border: none;
    padding: 0;
    margin: 0;
}

/* Question title from <legend> */
.ho-quiz-wrapper .gform_wrapper legend.gfield_label {
    color: var(--ho-quiz-navy);
    font-size: 36px;
    font-weight: 800;
    line-height: 1.25;
    padding: 0 48px 48px;
    margin: 0;
    width: 100%;
    float: none;
}

/* Override GF 2.5 inline label styles for choice labels */
.ho-quiz-wrapper .gform_wrapper .gform-field-label--type-inline {
    font-size: 20px;
    color: var(--ho-quiz-slate);
    font-weight: 700;
    margin: 0;
    padding: 0;
}

/* Override GF 2.5 radio input appearance */
.ho-quiz-wrapper .gform_wrapper .gfield-choice-input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none;
}

/* ==========================================================================
   Finish Overlay (shown while scoring)
   ========================================================================== */

.ho-quiz-finish-overlay {
    background: var(--ho-quiz-card-bg);
    border-radius: var(--ho-quiz-card-radius);
    box-shadow: var(--ho-quiz-card-shadow);
    max-width: var(--ho-quiz-card-max-width);
    width: 100%;
    padding: 60px 32px;
    text-align: center;
    animation: hoQuizFadeIn 0.4s ease;
}

.ho-quiz-finish-overlay__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--ho-quiz-green);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: hoQuizSpin 0.8s linear infinite;
}

.ho-quiz-finish-overlay__text {
    color: var(--ho-quiz-gray);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

@keyframes hoQuizSpin {
    to { transform: rotate(360deg); }
}

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

/* ==========================================================================
   Results Page
   ========================================================================== */

.ho-quiz-results {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ==========================================================================
   Results Personalization Banner
   ========================================================================== */

.ho-quiz-results__banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #003366;
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 32px;
    gap: 16px;
}

.ho-quiz-results__banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ho-quiz-results__banner-text strong {
    font-size: 16px;
    font-weight: 700;
}

.ho-quiz-results__banner-text span {
    font-size: 14px;
    opacity: 0.9;
}

.ho-quiz-results__banner-reset {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.ho-quiz-results__banner-reset:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.ho-quiz-results__expired {
    text-align: center;
    padding: 80px 20px;
}

.ho-quiz-results__expired h1 {
    color: var(--ho-quiz-navy);
    margin-bottom: 16px;
}

.ho-quiz-results__header {
    text-align: center;
    margin-bottom: 40px;
}

.ho-quiz-results__header h1 {
    color: var(--ho-quiz-navy);
    font-size: 32px;
    margin-bottom: 16px;
}

.ho-quiz-results__profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 168, 89, 0.1);
    color: var(--ho-quiz-green);
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.ho-quiz-results__subtitle {
    color: var(--ho-quiz-gray);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   Provider Card
   ========================================================================== */

.ho-quiz-results__card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    overflow: hidden;
}

.ho-quiz-results__card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #F3F4F6;
    flex-wrap: wrap;
}

.ho-quiz-results__logo {
    width: 120px;
    height: 48px;
    object-fit: contain;
}

.ho-quiz-results__provider-name {
    font-size: 22px;
    color: var(--ho-quiz-navy);
    margin: 0;
    flex: 1;
}

.ho-quiz-results__match-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 168, 89, 0.08);
    border-radius: 12px;
    padding: 8px 16px;
    min-width: 100px;
}

.ho-quiz-results__match-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ho-quiz-green);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ho-quiz-results__match-pct {
    font-size: 28px;
    font-weight: 800;
    color: var(--ho-quiz-green);
}

/* ==========================================================================
   Category Score Bars
   ========================================================================== */

.ho-quiz-results__card-body {
    padding: 24px;
}

.ho-quiz-results__category-bars {
    margin-bottom: 20px;
}

.ho-quiz-results__bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ho-quiz-results__bar-label {
    width: 90px;
    font-size: 12px;
    color: var(--ho-quiz-gray);
    font-weight: 500;
    flex-shrink: 0;
}

.ho-quiz-results__bar-track {
    flex: 1;
    height: 8px;
    background: #F3F4F6;
    border-radius: 4px;
    overflow: hidden;
}

.ho-quiz-results__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ho-quiz-green), var(--ho-quiz-green-light));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.ho-quiz-results__bar-value {
    width: 40px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ho-quiz-navy);
    text-align: right;
    flex-shrink: 0;
}

/* ==========================================================================
   Price & Pros
   ========================================================================== */

.ho-quiz-results__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--ho-quiz-navy);
    margin-bottom: 12px;
}

.ho-quiz-results__pros {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ho-quiz-results__pros li {
    padding: 4px 0;
    font-size: 14px;
    color: var(--ho-quiz-gray);
}

.ho-quiz-results__pros li::before {
    content: "\2713 ";
    color: var(--ho-quiz-green);
    font-weight: 700;
    margin-right: 6px;
}

/* ==========================================================================
   Card Footer CTAs
   ========================================================================== */

.ho-quiz-results__card-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    align-items: center;
}

.ho-quiz-results__cta-primary {
    display: inline-block;
    padding: 12px 28px;
    background: var(--ho-quiz-green);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
}

.ho-quiz-results__cta-primary:hover {
    background: var(--ho-quiz-green-light);
    color: #fff;
}

.ho-quiz-results__cta-secondary {
    color: var(--ho-quiz-green);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.ho-quiz-results__cta-secondary:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Results Footer
   ========================================================================== */

.ho-quiz-results__footer {
    text-align: center;
    margin-top: 40px;
}

.ho-quiz-results__retake-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--ho-quiz-navy);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    margin-right: 16px;
    transition: opacity 0.2s;
}

.ho-quiz-results__retake-btn:hover {
    opacity: 0.9;
    color: #fff;
}

.ho-quiz-results__compare-link {
    color: var(--ho-quiz-green);
    text-decoration: none;
    font-weight: 500;
}

/* ==========================================================================
   Personalization Banner
   ========================================================================== */

.ho-quiz-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ho-quiz-green);
    color: #fff;
    padding: 12px 24px;
    font-size: 14px;
}

.ho-quiz-banner__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ho-quiz-banner__icon {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ho-quiz-banner__text strong {
    display: block;
    font-size: 15px;
}

.ho-quiz-banner__text span {
    opacity: 0.9;
}

.ho-quiz-banner__reset {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.ho-quiz-banner__reset:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .ho-quiz-wrapper__heading {
        font-size: 22px;
    }

    .ho-quiz-wrapper .gform_wrapper .gfield_label,
    .ho-quiz-wrapper .gform_wrapper .gsection_title {
        font-size: 22px;
        padding: 0 24px 24px;
    }

    .ho-quiz-wrapper .gform_wrapper .gfield_radio,
    .ho-quiz-wrapper .gform_wrapper .gfield_checkbox {
        padding: 0 24px 32px;
    }

    .ho-quiz-wrapper .gform_wrapper .gfield_radio .gchoice label,
    .ho-quiz-wrapper .gform_wrapper .gfield_checkbox .gchoice label {
        min-height: 56px;
        padding: 16px 20px;
        font-size: 15px;
        gap: 14px;
        border-radius: 20px;
    }

    .ho-quiz-choice-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 12px;
    }

    .ho-quiz-choice-icon svg {
        width: 18px;
        height: 18px;
    }

    .ho-quiz-choice-chevron {
        width: 32px;
        height: 32px;
    }

    .ho-quiz-choice-chevron svg {
        width: 16px;
        height: 16px;
    }

    .ho-quiz-card-header {
        padding: 36px 24px 0;
        margin-bottom: 24px;
    }

    .ho-quiz-trust-badges {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
    }

    .ho-quiz-results__card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ho-quiz-results__card-footer {
        flex-direction: column;
    }

    .ho-quiz-results__cta-primary {
        width: 100%;
        text-align: center;
    }

    .ho-quiz-results__banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .ho-quiz-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
