/* Guest survey take / thanks — visual overlay only. Keep #survey-* IDs intact. */

.sl-survey-take-shell,
#survey-shell {
    background:
        radial-gradient(ellipse 70% 40% at 50% -10%, color-mix(in srgb, var(--survey-accent, #ea580c) 16%, transparent), transparent 60%),
        #f6f4f1;
}

#survey-shell > header,
.sl-survey-take-shell header {
    height: auto;
    min-height: 3.75rem;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 12px 28px -22px rgba(28, 25, 23, 0.45);
}

#survey-shell header h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.survey-take-header {
    border-bottom: 1px solid rgba(28, 25, 23, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.survey-take-header__accent {
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--survey-accent, #ea580c),
        color-mix(in srgb, var(--survey-accent, #ea580c) 45%, #fbbf24)
    );
}

.survey-take-header__row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3.5rem;
    padding: 0.45rem 0.75rem 0.55rem;
}

.survey-take-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(28, 25, 23, 0.1);
    background: #fff;
    color: #44403c;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.survey-take-header__icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.survey-take-header__icon:hover {
    background: color-mix(in srgb, var(--survey-accent, #ea580c) 10%, #fff);
    border-color: color-mix(in srgb, var(--survey-accent, #ea580c) 35%, transparent);
    color: color-mix(in srgb, var(--survey-accent, #ea580c) 85%, #1c1917);
}

.survey-take-header__icon--wa {
    color: #fff;
    background: #25d366;
    border-color: #1ebe57;
    box-shadow: 0 6px 14px -8px rgba(37, 211, 102, 0.9);
}

.survey-take-header__icon--wa:hover {
    background: #1ebe57;
    border-color: #17a34a;
    color: #fff;
}

.survey-take-header__icon--wa svg {
    width: 1.45rem;
    height: 1.45rem;
    display: block;
}

.survey-take-header__spacer {
    width: 2.5rem;
    flex-shrink: 0;
}

.survey-take-header__titles {
    min-width: 0;
    flex: 1;
    text-align: center;
}

.survey-take-header__brand {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--survey-accent, #ea580c) 75%, #78716c);
}

.survey-take-header h1,
#survey-shell .survey-take-header h1 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.25;
    color: #1c1917;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .survey-take-header h1,
    #survey-shell .survey-take-header h1 {
        font-size: 1.05rem;
    }
}

#survey-shell [data-survey-step] > section,
#survey-shell section[data-qid] {
    border-radius: 1.25rem !important;
    border-color: rgba(28, 25, 23, 0.08) !important;
    box-shadow: 0 16px 36px -28px rgba(28, 25, 23, 0.35);
}

#survey-shell .survey-option-label,
#survey-shell label.flex {
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

#survey-shell label.flex:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -18px rgba(28, 25, 23, 0.35);
}

#survey-shell label:has(input:checked) {
    border-color: color-mix(in srgb, var(--survey-accent, #ea580c) 70%, transparent) !important;
    background: color-mix(in srgb, var(--survey-accent, #ea580c) 8%, #fff);
}

#survey-shell footer,
.sl-survey-take-shell footer {
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 -16px 40px -28px rgba(28, 25, 23, 0.35);
}

#survey-btn-prev,
#survey-btn-next,
#survey-btn-submit {
    border-radius: 9999px !important;
    font-weight: 700 !important;
}

.survey-banner-img {
    min-height: 12rem;
    object-fit: cover;
}

/* Disabled submit affordance */
#survey-btn-submit:disabled,
#survey-btn-submit.is-disabled {
    cursor: not-allowed !important;
    opacity: 0.42 !important;
    filter: grayscale(0.35);
    box-shadow: none !important;
}

body.survey-modal-open {
    overflow: hidden;
}

/* Respondent contact modal */
.survey-respondent-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
}

.survey-respondent-modal.is-open,
.survey-respondent-modal:not([hidden]) {
    display: flex !important;
}

.survey-respondent-modal[hidden] {
    display: none !important;
}

.survey-respondent-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
}

.survey-respondent-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 26rem);
    max-height: min(92vh, 40rem);
    overflow: auto;
    border-radius: 1.35rem 1.35rem 1.1rem 1.1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f4faf7 100%);
    border: 1px solid color-mix(in srgb, var(--survey-accent, #059669) 22%, #d6d3d1);
    box-shadow: 0 28px 60px -28px rgba(15, 23, 42, 0.55);
    padding: 1.25rem 1.2rem 1.1rem;
}

@media (min-width: 640px) {
    .survey-respondent-modal {
        align-items: center;
    }

    .survey-respondent-modal__panel {
        border-radius: 1.35rem;
    }
}

.survey-respondent-modal__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #14532d;
}

.survey-respondent-modal__hint {
    margin: 0.35rem 0 1rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #57534e;
}

.survey-respondent-modal__fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.survey-respondent-modal__fields label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #44403c;
}

.survey-respondent-modal__fields input {
    height: 2.65rem;
    border-radius: 0.85rem;
    border: 1px solid #d6d3d1;
    background: #fff;
    padding: 0 0.85rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1c1917;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.survey-respondent-modal__fields input:focus {
    border-color: color-mix(in srgb, var(--survey-accent, #059669) 70%, #a8a29e);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--survey-accent, #059669) 18%, transparent);
}

.survey-respondent-modal__captcha {
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #d6d3d1;
}

.survey-mix-captcha {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 0.65rem;
    user-select: none;
}

.survey-mix-captcha span {
    display: inline-flex;
    width: 2rem;
    height: 2.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    background: linear-gradient(145deg, #064e3b, #047857);
    color: #ecfdf5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transform: rotate(calc((var(--r, 2) - 3) * 3deg));
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.survey-mix-captcha span:nth-child(1) { --r: 1; }
.survey-mix-captcha span:nth-child(2) { --r: 4; color: #fde68a; }
.survey-mix-captcha span:nth-child(3) { --r: 2; }
.survey-mix-captcha span:nth-child(4) { --r: 5; color: #99f6e4; }
.survey-mix-captcha span:nth-child(5) { --r: 3; }

.survey-respondent-modal__captcha label em {
    font-style: normal;
    font-weight: 500;
    color: #78716c;
}

.survey-respondent-modal__actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 1.1rem;
}

.survey-respondent-modal__btn {
    flex: 1;
    height: 2.85rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.survey-respondent-modal__btn:hover {
    opacity: 0.92;
}

.survey-respondent-modal__btn--ghost {
    background: #fff;
    border: 1.5px solid #d6d3d1;
    color: #44403c;
}

.survey-respondent-modal__btn--primary {
    background: var(--survey-accent, #059669);
    color: #fff;
    box-shadow: 0 12px 24px -16px color-mix(in srgb, var(--survey-accent, #059669) 80%, #000);
}

/* Leader strip gap + phone country code */
.survey-leader-strip {
    margin-top: 1.15rem;
    padding-top: 0.25rem;
}

.survey-leader-strip__card {
    position: relative;
    padding: 1.15rem 0.85rem 0.85rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(28, 25, 23, 0.1);
    background: #fff;
    box-shadow: 0 10px 24px -20px rgba(28, 25, 23, 0.35);
}

.survey-leader-strip__badge {
    display: inline-flex;
    margin-bottom: 0.75rem;
    padding: 0.22rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--survey-accent, #059669) 85%, #44403c);
    background: color-mix(in srgb, var(--survey-accent, #059669) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--survey-accent, #059669) 22%, transparent);
}

.survey-req {
    color: #e11d48;
    font-style: normal;
    font-weight: 800;
}

.survey-phone-row {
    display: flex;
    gap: 0.45rem;
    align-items: stretch;
}

.survey-phone-row select,
.survey-phone-row input {
    height: 2.65rem;
    border-radius: 0.85rem;
    border: 1px solid #d6d3d1;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1c1917;
    outline: none;
}

.survey-phone-row select {
    flex: 0 0 auto;
    width: 6.75rem;
    padding: 0 0.35rem 0 0.55rem;
    cursor: pointer;
}

.survey-phone-row input {
    flex: 1;
    min-width: 0;
    padding: 0 0.85rem;
}

.survey-phone-row select:focus,
.survey-phone-row input:focus {
    border-color: color-mix(in srgb, var(--survey-accent, #059669) 70%, #a8a29e);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--survey-accent, #059669) 18%, transparent);
}

.survey-respondent-modal {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.survey-respondent-modal__panel {
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.survey-modal-alert {
    margin: -0.35rem 0 0.9rem;
    border: 1px solid #fecdd3;
    border-radius: 0.8rem;
    background: #fff1f2;
    padding: 0.55rem 0.75rem;
    color: #be123c;
    font-size: 0.82rem;
    font-weight: 600;
}

.survey-field-error {
    color: #be123c;
    font-size: 0.74rem;
    font-weight: 600;
}

.survey-respondent-modal__fields label.has-error input {
    border-color: #fb7185;
    background: #fff7f8;
}

.survey-respondent-modal__captcha label em.survey-req {
    color: #e11d48;
    font-weight: 800;
}

.survey-take-footer {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Compact respondent modal: fits a laptop screen without scrolling */
.survey-respondent-modal--compact .survey-respondent-modal__panel {
    width: min(100%, 28rem);
    padding: 1rem 1.1rem 0.95rem;
}

.survey-respondent-modal--compact .survey-respondent-modal__title {
    font-size: 1.05rem;
}

.survey-respondent-modal--compact .survey-respondent-modal__hint {
    margin: 0.2rem 0 0.7rem;
    font-size: 0.8rem;
}

.survey-respondent-modal--compact .survey-respondent-modal__fields {
    gap: 0.55rem;
}

.survey-respondent-modal--compact .survey-respondent-modal__fields label {
    gap: 0.22rem;
    font-size: 0.74rem;
}

.survey-respondent-modal--compact .survey-respondent-modal__fields input,
.survey-respondent-modal--compact .survey-phone-row select,
.survey-respondent-modal--compact .survey-phone-row input {
    height: 2.4rem;
    font-size: 0.9rem;
}

.survey-respondent-modal__pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

@media (max-width: 380px) {
    .survey-respondent-modal__pair {
        grid-template-columns: 1fr;
    }
}

.survey-respondent-modal--compact .survey-respondent-modal__captcha {
    margin-top: 0.1rem;
    padding-top: 0.55rem;
}

.survey-respondent-modal--compact .survey-mix-captcha {
    margin-bottom: 0.45rem;
}

.survey-respondent-modal--compact .survey-mix-captcha span {
    width: 1.8rem;
    height: 2.05rem;
    font-size: 0.95rem;
}

.survey-respondent-modal--compact .survey-respondent-modal__actions {
    margin-top: 0.8rem;
}

.survey-respondent-modal--compact .survey-respondent-modal__btn {
    height: 2.6rem;
}

/* Error toast (top-right, auto-hides) */
.sl-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(calc(100vw - 2rem), 22rem);
    pointer-events: none;
}

.sl-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    overflow: hidden;
    padding: 0.8rem 2.3rem 0.95rem 0.85rem;
    border-radius: 0.95rem;
    background: #fff;
    border: 1px solid #fecdd3;
    border-left: 4px solid #e11d48;
    box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.45), 0 2px 6px rgba(15, 23, 42, 0.06);
    color: #1c1917;
    pointer-events: auto;
    animation: sl-toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.sl-toast.is-leaving {
    animation: sl-toast-out 0.26s ease forwards;
}

.sl-toast__icon {
    flex: 0 0 auto;
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #ffe4e6;
    color: #e11d48;
    font-size: 0.85rem;
    font-weight: 800;
}

.sl-toast__body {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
}

.sl-toast__body p {
    margin: 0;
}

.sl-toast__body p + p {
    margin-top: 0.25rem;
}

.sl-toast__close {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    width: 1.6rem;
    height: 1.6rem;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: #78716c;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.sl-toast__close:hover {
    background: #f5f5f4;
    color: #1c1917;
}

.sl-toast__bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: #fb7185;
    transform-origin: left;
    animation: sl-toast-bar var(--sl-toast-ms, 8000ms) linear forwards;
}

@keyframes sl-toast-in {
    from { opacity: 0; transform: translateX(1.5rem); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes sl-toast-out {
    to { opacity: 0; transform: translateX(1.5rem); }
}

@keyframes sl-toast-bar {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 480px) {
    .sl-toast-stack {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}

/* "Add your own candidate" option on survey MCQ questions */
.survey-custom-pick {
    border-color: color-mix(in srgb, var(--survey-accent, #059669) 45%, #d6d3d1);
    background: color-mix(in srgb, var(--survey-accent, #059669) 5%, #fff);
}

.survey-custom-pick:hover,
.survey-custom-pick:has(input:checked) {
    border-style: solid;
    border-color: var(--survey-accent, #059669);
}

.survey-custom-pick__plus {
    display: inline-flex;
    flex: 0 0 auto;
    width: 2.6rem;
    height: 2.6rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--survey-accent, #059669) 14%, #fff);
    color: var(--survey-accent, #059669);
    font-size: 1.4rem;
    font-weight: 700;
}

.survey-custom-panel {
    margin-top: 0.25rem;
    padding: 0.95rem;
    border-radius: 1rem;
    border: 1px solid color-mix(in srgb, var(--survey-accent, #059669) 25%, #e7e5e4);
    background: #fafaf9;
}

.survey-custom-panel[hidden] {
    display: none !important;
}

.survey-custom-panel__title {
    margin: 0 0 0.7rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1c1917;
}

.survey-custom-panel__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.survey-custom-panel__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #44403c;
}

.survey-custom-panel__field em {
    color: #e11d48;
    font-style: normal;
}

.survey-custom-panel__field--wide {
    grid-column: 1 / -1;
}

.survey-custom-panel__field input[type="text"],
.survey-custom-panel__field textarea {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #d6d3d1;
    background: #fff;
    padding: 0.55rem 0.75rem;
    font-size: 16px;
    font-weight: 500;
    color: #1c1917;
    outline: none;
}

.survey-custom-panel__field input[type="text"]:focus,
.survey-custom-panel__field textarea:focus {
    border-color: var(--survey-accent, #059669);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--survey-accent, #059669) 16%, transparent);
}

.survey-custom-panel__field input[type="file"] {
    font-size: 0.78rem;
    font-weight: 500;
}

@media (max-width: 420px) {
    .survey-custom-panel__grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile: whole overlay scrolls as one page (keyboard-safe), no clipped top/bottom */
@media (max-width: 639px) {
    .survey-respondent-modal {
        align-items: flex-start !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem calc(1rem + env(safe-area-inset-bottom));
    }

    .survey-respondent-modal__backdrop {
        position: fixed;
    }

    .survey-respondent-modal__panel {
        margin: auto 0;
        width: 100%;
        max-height: none;
        overflow: visible;
        border-radius: 1.2rem;
    }

    .survey-respondent-modal__fields input,
    .survey-respondent-modal__fields textarea,
    .survey-phone-row select,
    .survey-phone-row input,
    .survey-respondent-modal--compact .survey-respondent-modal__fields input,
    .survey-respondent-modal--compact .survey-phone-row select,
    .survey-respondent-modal--compact .survey-phone-row input {
        font-size: 16px;
    }

    .survey-phone-row select {
        width: 5.9rem;
    }

    .survey-respondent-modal__actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding: 0.6rem 0 0.2rem;
        background: #f4faf7;
        box-shadow: 0 -10px 14px -12px rgba(15, 23, 42, 0.25);
    }
}
