/* ==========================================================================
   Survey Popup
   ========================================================================== */

/* ── Overlay ── */
.survey-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* ── Popup Box ── */
.survey-popup {
    background: var(--color-white, #fff);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 46.875rem;
    max-height: 90vh;
    position: relative;
    padding: 2.5rem 0 0;
    direction: rtl;
    text-align: right;
    animation: surveyFadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes surveyFadeIn {
    from {
        opacity: 0;
        transform: translateY(1.25rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Close ── */
.survey-popup__close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text, #1a1a1a);
    transition: background 0.2s;
    z-index: 2;
}

.survey-popup__close:hover {
    background: #f0f4f8;
}

/* ── Title (fixed top) ── */
.survey-popup__title {
    font-size: 1.75rem;
    font-weight: 700;
    /* color: var(--color-primary, #398BE6); */
    /* text-align: center; */
    padding: 1.5rem 2.5rem;
    padding: 0 2.5rem 0.25rem 2.5rem;
    margin: 0;
    /* border-bottom: 1px solid rgba(0, 0, 0, 0.08); */
    flex-shrink: 0;
}

/* ── Scrollable body ── */
.survey-popup__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2.5rem;
    overscroll-behavior: contain;
}

/* Custom scrollbar */
.survey-popup__body::-webkit-scrollbar {
    width: 0.375rem;
}

.survey-popup__body::-webkit-scrollbar-track {
    background: transparent;
}

.survey-popup__body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0.1875rem;
}

.survey-popup__body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Firefox */
.survey-popup__body {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* ── Nav (fixed bottom) ── */
.survey-popup__nav {
    display: flex;
    align-items: center;
    /* RTL: next on LEFT, prev on RIGHT → flex-direction: row-reverse */
    flex-direction: row-reverse;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    gap: 1rem;
}

/* When only one button visible, it still stays on its side */
.survey-popup__nav .survey-btn--next {
    margin-right: auto;
    /* push to LEFT in row-reverse */
}

.survey-popup__nav .survey-btn--prev {
    margin-left: auto;
    /* push to RIGHT in row-reverse */
}

/* ── Buttons ── */
.survey-btn {
    padding: 0.6875rem 2.25rem;
    border-radius: 2rem;
    font-family: var(--font-body, inherit);
    font-size: 1.0625rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 0.125rem solid transparent;
    white-space: nowrap;
    line-height: 1.4;
}

.survey-btn--next {
    background: var(--color-primary, #398BE6);
    color: #fff;
    border-color: var(--color-primary, #398BE6);
    min-width: 10rem;
}

.survey-btn--next:hover {
    background: #2a7ad4;
    border-color: #2a7ad4;
}

.survey-btn--prev {
    background: #fff;
    color: var(--color-primary, #398BE6);
    border-color: var(--color-primary, #398BE6);
    min-width: 8rem;
}

.survey-btn--prev:hover {
    background: #f0f6fd;
}

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

/* ==========================================================================
   Step Styles
   ========================================================================== */
.survey-step__title {
    font-size: 1.3125rem;
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
    /* text-align: center; */
    margin: 0 0 0.5rem;
}

.survey-step__content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-text, #1a1a1a);
}

.survey-step__content p {
    margin-bottom: 0.75rem;
}

.survey-step__content ul,
.survey-step__content ol {
    padding-right: 1.25rem;
    margin-bottom: 0.75rem;
}

.survey-step__desc {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #666;
    /* text-align: center; */
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Questions
   ========================================================================== */
.survey-question {
    margin-bottom: 2rem;
}

.survey-question:last-child {
    margin-bottom: 0;
}

.survey-question__text {
    font-size: 1.1875rem;
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
    margin: 0 0 0.375rem;
}

.survey-question__desc {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #666;
    margin: 0 0 1rem;
}

/* ── Answers ── */
.survey-question__answers {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.survey-answer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: background 0.15s;
    flex-wrap: wrap;
    position: relative;
    direction: rtl;
}

.survey-answer:hover {
    background: #f0f6fd;
}

/* Reached the step's selection limit — block the remaining options */
.survey-answer--disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Hide native input */
.survey-answer input[type="radio"],
.survey-answer input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Custom indicator — circle for radio */
.survey-answer__indicator {
    width: 1.375rem;
    height: 1.375rem;
    min-width: 1.375rem;
    border-radius: 50%;
    border: 0.125rem solid var(--color-primary, #398BE6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.survey-answer__text {
    font-size: 1rem;
    color: var(--color-text, #1a1a1a);
    flex: 1;
    line-height: 1.5;
}

/* Checkbox = square */
input[type="checkbox"]+.survey-answer__indicator {
    border-radius: 0.3125rem;
}

/* Checked */
input:checked+.survey-answer__indicator {
    background: var(--color-primary, #398BE6);
    border-color: var(--color-primary, #398BE6);
}

input[type="radio"]:checked+.survey-answer__indicator::after {
    content: '';
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: #fff;
}

input[type="checkbox"]:checked+.survey-answer__indicator::after {
    content: '';
    width: 0.3125rem;
    height: 0.5625rem;
    border-radius: 0;
    background: transparent;
    border-right: 0.125rem solid #fff;
    border-bottom: 0.125rem solid #fff;
    transform: rotate(45deg);
    margin-top: -0.125rem;
}

/* "Other" input */
.survey-answer__input {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.5rem;
    font-family: var(--font-body, inherit);
    font-size: 0.9375rem;
    direction: rtl;
    transition: border-color 0.2s;
    flex-basis: 100%;
}

.survey-answer__input:focus {
    outline: none;
    border-color: var(--color-primary, #398BE6);
}

.survey-answer__input:disabled {
    opacity: 0.35;
    background: #f8f9fa;
}

/* ==========================================================================
   Sortable
   ========================================================================== */
.survey-sortable__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.survey-sortable__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    background: #f0f6fd;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    cursor: grab;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.survey-sortable__item:active {
    cursor: grabbing;
}

/* Drag handle — far LEFT in RTL (last visually) */
.survey-sortable__grip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: grab;
    padding: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.15s;
    /* order: -1; */
    margin-left: auto;
}

.survey-sortable__item:hover .survey-sortable__grip {
    opacity: 1;
}

.survey-sortable__grip svg {
    display: block;
}

/* Number circle */
.survey-sortable__number {
    width: 1.875rem;
    height: 1.875rem;
    min-width: 1.875rem;
    border-radius: 50%;
    background: var(--color-primary, #398BE6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.survey-sortable__text {
    font-size: 0.9375rem;
    color: var(--color-text, #1a1a1a);
    flex: 1;
    line-height: 1.5;
}

/* Arrows — hidden by default, show on hover + always on mobile */
.survey-sortable__arrows {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.survey-sortable__item:hover .survey-sortable__arrows {
    opacity: 1;
}

.survey-sortable__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 0;
}

.survey-sortable__arrow svg {
    display: block;
}

/* Dragging state */
.survey-sortable__item.ui-sortable-helper {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--color-primary, #398BE6);
    background: #fff;
    z-index: 10;
}

.survey-sortable__item.ui-sortable-placeholder {
    visibility: visible !important;
    background: rgba(57, 139, 230, 0.06);
    border: 2px dashed var(--color-primary, #398BE6);
    border-radius: 0.75rem;
}

/* ==========================================================================
   Text Inputs
   ========================================================================== */
.survey-text-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.survey-text-input {
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
}

.survey-text-input__label {
    font-size: 0.8125rem;
    color: #999;
}

.survey-text-input__field {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.75rem;
    font-family: var(--font-body, inherit);
    font-size: 0.9375rem;
    direction: rtl;
    resize: vertical;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.survey-text-input__field:focus {
    outline: none;
    border-color: var(--color-primary, #398BE6);
}

/* ==========================================================================
   Validation Error
   ========================================================================== */
.survey-question.has-error .survey-question__text {
    color: #dc3545;
}

.survey-question.has-error .survey-question__text::after {
    content: ' *';
    color: #dc3545;
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.survey-btn--loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.survey-btn--loading::after {
    content: '';
    position: absolute;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: surveySpinner 0.6s linear infinite;
    top: 50%;
    left: 50%;
    margin: -0.5625rem 0 0 -0.5625rem;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 48rem) {
    .survey-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .survey-popup {
        max-height: 95vh;
        border-radius: 1.25rem 1.25rem 0 0;
        padding-top: 2rem;
    }

    .survey-popup__title {
        font-size: 1.375rem;
        padding: 0 2.5rem 1rem;
    }

    .survey-popup__body {
        padding: 1.25rem 1.5rem;
    }

    .survey-popup__nav {
        padding: 1rem 1.5rem;
    }

    .survey-popup__close {
        top: 0.625rem;
        left: 0.625rem;
    }

    .survey-btn {
        font-size: 1rem;
        padding: 0.625rem 1.5rem;
    }

    .survey-btn--next {
        min-width: auto;
        flex: 1;
    }

    .survey-btn--prev {
        min-width: auto;
    }

    /* Always show arrows on mobile */
    .survey-sortable__arrows {
        opacity: 1;
    }

    .survey-sortable__grip {
        opacity: 1;
    }

    .survey-answer {
        padding: 0.625rem 0.75rem;
    }

    .survey-step__title {
        font-size: 1.125rem;
    }

    .survey-question__text {
        font-size: 1.0625rem;
    }
}

/* Textarea question type */
.survey-question__textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.9375rem;
    direction: rtl;
    resize: vertical;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.survey-question__textarea:focus {
    outline: none;
    border-color: var(--color-primary, #398BE6);
}

/* Thank You centered layout */
.survey-step--thankyou {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    text-align: center;
}

.survey-step--thankyou .survey-step__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text, #1a1a1a);
}

.survey-step--thankyou .survey-step__content {
    font-size: 1.0625rem;
    color: #555;
    margin-bottom: 2rem;
}

/* Finish button (thank you page) */
.survey-btn--finish {
    background: var(--color-primary, #398BE6);
    color: #fff;
    border-color: var(--color-primary, #398BE6);
    padding: 0.75rem 3rem;
    border-radius: 2rem;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 500;
    cursor: pointer;
    border: 0.125rem solid var(--color-primary, #398BE6);
    transition: all 0.2s;
    min-width: 10rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    text-decoration: none;
}

.survey-btn--finish svg {
    flex-shrink: 0;
    display: block;
}

.survey-btn--finish:hover {
    background: #2a7ad4;
    border-color: #2a7ad4;
}

#surveySubtitle {
    padding: 0 3rem 0.25rem;
    padding: 0.3rem 2.5rem;
    margin: 0;
    flex-shrink: 0;
}




.hero-banner__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.hero-banner__icon img {
    width: 7rem;
    height: 7rem;
    object-fit: contain;
    border-radius: 50%;
}

.hero-banner__tt-heading {
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
    text-align: center;
    margin: 0rem 0 1.25rem;
    line-height: 1;
}

.newhr {
    width: 56%;
    height: 1px;
    background: rgba(255, 255, 255, 0.30);
    stroke-width: 1.5px;
    stroke: rgba(255, 255, 255, 0.30);
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Report a Problem popup
   Reuses .survey-overlay / .survey-popup / .survey-btn / .survey-answer chrome.
   ========================================================================== */
.report-overlay {
    /* sit above the survey popup, which stays open underneath on submit error */
    z-index: 10000;
}

.report-popup {
    max-width: 40rem;
    padding-top: 1.5rem;
}

.report-popup__body {
    padding-top: 0.5rem;
}

.report-popup__title {
    font-size: 1.625rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.625rem;
}

.report-popup__sub {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    text-align: center;
    max-width: 32rem;
    margin: 0 auto 1.5rem;
}

/* ── Screen 1 CTA ── */
.report-cta {
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 1.75rem;
    margin-top: 0.5rem;
}

.report-cta__title {
    font-size: 1.3125rem;
    font-weight: 600;
    color: var(--color-text, #1a1a1a);
    margin: 0 0 0.5rem;
}

.report-cta__text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #666;
    margin: 0 0 1.25rem;
}

.report-btn--outline {
    display: block;
    width: 100%;
    background: #f5f9ff;
    color: var(--color-primary, #398BE6);
    border-color: #cfe0f5;
}

.report-btn--outline:hover {
    background: #eaf2fd;
    border-color: #b6d2f0;
}

/* ── Screen 2 form ── */
.report-field {
    margin-bottom: 1.5rem;
}

.report-field__label {
    display: block;
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--color-text, #1a1a1a);
    margin: 0 0 0.625rem;
    text-align: right;
}

.report-textarea {
    width: 100%;
    min-height: 7rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d0d5dd;
    border-radius: 0.625rem;
    font-family: var(--font-body, inherit);
    font-size: 1rem;
    line-height: 1.6;
    direction: rtl;
    resize: vertical;
    transition: border-color 0.2s;
}

.report-textarea:focus {
    outline: none;
    border-color: var(--color-primary, #398BE6);
}

.report-error {
    color: #d92d20;
    font-size: 0.9375rem;
    margin: 0 0 1rem;
    text-align: center;
}

/* Field-level validation error highlight */
.report-field--error .report-field__label {
    color: #d92d20;
}

.report-field--error .report-textarea {
    border-color: #d92d20;
}

.report-field--error .survey-answer__indicator {
    border-color: #d92d20;
}

.report-actions {
    text-align: center;
    margin-top: 1.5rem;
}

/* ── Screen 3 success ── */
.report-success {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.report-success__icon {
    margin-bottom: 1rem;
}

/* Mobile: keep the report popup a CENTERED floating card.
   The shared .survey-* mobile rules turn the overlay into a bottom sheet
   (align-items:flex-end + top-only radius) — override that for the report popup. */
@media (max-width: 48rem) {
    .report-overlay {
        padding: 1rem;
        align-items: center;
    }

    .report-popup {
        max-height: 90vh;
        border-radius: 1.25rem;
        padding-top: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .report-popup__title { font-size: 1.375rem; }
    .report-popup__sub { font-size: 0.9375rem; }
}