/*
 * Sales Assistant AI — Research Participation
 *
 * Responsibility:
 * - Research participation information gate
 * - participation card
 * - fixed participation heading
 * - scrollable participation information
 * - privacy link
 * - scroll instruction overlay
 * - fixed participation confirmation
 * - Start Research action
 * - responsive participation layout
 */

body[data-research-page="true"]
.research-participation-consent {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
    min-height: 0;
}

body[data-research-page="true"]
.research-participation-consent__card {
    display: flex;
    flex-direction: column;

    box-sizing: border-box;

    width: min(100%, 52rem);
    height: 100%;
    max-height: 100%;
    min-height: 0;

    overflow: hidden;

    border: 1px solid rgba(212, 175, 55, 0.34);
    border-radius: 1.4rem;

    background:
        radial-gradient(
            circle at 15% 0%,
            rgba(79, 140, 255, 0.11),
            transparent 24rem
        ),
        linear-gradient(
            145deg,
            rgba(18, 31, 51, 0.96),
            rgba(10, 21, 37, 0.98)
        );

    box-shadow:
        0 1.6rem 4.5rem rgba(0, 0, 0, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

/*
 * Fixed card header
 */

body[data-research-page="true"]
.research-participation-consent__header {
    flex: 0 0 auto;

    box-sizing: border-box;

    padding:
        clamp(1.6rem, 3vh, 2.4rem)
        clamp(1.5rem, 4vw, 3.5rem)
        1rem;
}

body[data-research-page="true"]
.research-participation-consent__eyebrow {
    margin: 0 0 0.8rem;

    color: #d4af37;

    font-size: 0.74rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: 0.12em;
}

body[data-research-page="true"]
.research-participation-consent__title {
    margin: 0;

    color: var(--color-text-primary);

    font-size: clamp(2rem, 4vw, 3.15rem);
    font-weight: var(--font-weight-bold);
    line-height: 1.04;
    letter-spacing: -0.035em;
}

/*
 * Scrollable information area
 */

body[data-research-page="true"]
.research-participation-consent__scroll-area {
    flex: 1 1 auto;

    box-sizing: border-box;

    min-height: 0;

    padding:
        0.3rem
        clamp(1.5rem, 4vw, 3.5rem)
        0.8rem;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
    scrollbar-gutter: stable;

    outline: none;
}

body[data-research-page="true"]
.research-participation-consent__scroll-area:focus-visible {
    box-shadow:
        inset 0 0 0 2px rgba(212, 175, 55, 0.24);
}

body[data-research-page="true"]
.research-participation-consent__scroll-area::-webkit-scrollbar {
    width: 0.65rem;
}

body[data-research-page="true"]
.research-participation-consent__scroll-area::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.025);
}

body[data-research-page="true"]
.research-participation-consent__scroll-area::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;

    background: rgba(212, 175, 55, 0.42);
    background-clip: padding-box;
}

body[data-research-page="true"]
.research-participation-consent__scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.62);
    background-clip: padding-box;
}

body[data-research-page="true"]
.research-participation-consent__text {
    max-width: 45rem;
    margin: 0 0 0.9rem;

    color: var(--color-text-secondary);

    font-size: 0.95rem;
    line-height: 1.58;
}

body[data-research-page="true"]
.research-participation-consent__text:last-child {
    margin-bottom: 0;
}

body[data-research-page="true"]
.research-participation-consent__privacy-link {
    color: #d4af37;

    font-weight: var(--font-weight-semibold);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

body[data-research-page="true"]
.research-participation-consent__privacy-link:hover {
    color: #f1d779;
}

/*
 * Confirmation gate
 *
 * The real confirmation remains underneath.
 * The scroll instruction covers it 1:1 until reading is complete.
 */

body[data-research-page="true"]
.research-participation-consent__confirmation-gate {
    position: relative;

    width: 100%;
}

/*
 * Fixed card footer
 */

body[data-research-page="true"]
.research-participation-consent__footer {
    flex: 0 0 auto;

    box-sizing: border-box;

    padding:
        1rem
        clamp(1.5rem, 4vw, 3.5rem)
        clamp(1.4rem, 2.5vh, 2rem);

    border-top: 1px solid rgba(255, 255, 255, 0.07);

    background:
        linear-gradient(
            180deg,
            rgba(10, 21, 37, 0.9),
            rgba(10, 21, 37, 0.98)
        );

    box-shadow:
        0 -0.8rem 2rem rgba(0, 0, 0, 0.08);
}

body[data-research-page="true"]
.research-participation-consent__confirmation {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;

    box-sizing: border-box;

    width: 100%;
    margin: 0;
    padding: 0.9rem 1rem;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.9rem;

    background: rgba(255, 255, 255, 0.035);

    cursor: pointer;

    transition:
        border-color var(--transition-fast),
        background-color var(--transition-fast),
        box-shadow var(--transition-fast),
        opacity var(--transition-fast);
}

body[data-research-page="true"]
.research-participation-consent__confirmation:hover {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

body[data-research-page="true"]
.research-participation-consent__confirmation:has(
    .research-participation-consent__checkbox:disabled
) {
    opacity: 0.52;
    cursor: not-allowed;
}

body[data-research-page="true"]
.research-participation-consent__confirmation:has(
    .research-participation-consent__checkbox:disabled
):hover {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.035);
}

body[data-research-page="true"]
.research-participation-consent__confirmation:has(
    .research-participation-consent__checkbox:checked
) {
    border-color: rgba(212, 175, 55, 0.52);
    background: rgba(212, 175, 55, 0.065);

    box-shadow:
        inset 0 0 0 1px rgba(212, 175, 55, 0.045);
}

/*
 * Scroll instruction overlay
 */

body[data-research-page="true"]
.research-participation-consent__scroll-hint {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: flex;
    align-items: center;

    box-sizing: border-box;

    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0.9rem 1rem;

    border: 2px solid #f3c623;
    border-radius: 0.9rem;

    background: #ffffff;
    color: #c8102e;

    font-size: 0.82rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.35;

    box-shadow:
        inset 0 0 0 1px #c8102e;

    cursor: default;
}

body[data-research-page="true"]
.research-participation-consent__scroll-hint[hidden] {
    display: none;
}

body[data-research-page="true"]
.research-participation-consent__checkbox {
    flex: 0 0 auto;

    width: 1.15rem;
    height: 1.15rem;
    margin: 0.12rem 0 0;

    accent-color: #d4af37;

    cursor: pointer;
}

body[data-research-page="true"]
.research-participation-consent__checkbox:disabled {
    cursor: not-allowed;
}

body[data-research-page="true"]
.research-participation-consent__confirmation-text {
    color: var(--color-text-primary);

    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.5;
}

body[data-research-page="true"]
.research-participation-consent__actions {
    display: flex;
    justify-content: flex-end;

    width: 100%;
    margin-top: 0.9rem;
}

body[data-research-page="true"]
.research-participation-consent__start {
    min-width: 10rem;
    min-height: 3rem;
}

body[data-research-page="true"]
.research-participation-consent__start:disabled {
    opacity: 0.42;

    cursor: not-allowed;
    transform: none;
}

/*
 * Responsive
 */

@media (max-width: 768px) {
    body[data-research-page="true"]
    .research-participation-consent {
        align-items: stretch;

        height: 100%;
        min-height: 0;
    }

    body[data-research-page="true"]
    .research-participation-consent__card {
        height: 100%;
        max-height: 100%;

        border-radius: 1.1rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__header {
        padding:
            1.4rem
            1.25rem
            0.85rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__title {
        font-size: clamp(1.85rem, 8vw, 2.5rem);
    }

    body[data-research-page="true"]
    .research-participation-consent__scroll-area {
        padding:
            0.2rem
            1.25rem
            0.7rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__text {
        font-size: 0.9rem;
        line-height: 1.52;
    }

    body[data-research-page="true"]
    .research-participation-consent__footer {
        padding:
            0.85rem
            1.25rem
            1.15rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__confirmation {
        padding: 0.85rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__scroll-hint {
        padding: 0.85rem;

        font-size: 0.78rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__actions {
        justify-content: stretch;
    }

    body[data-research-page="true"]
    .research-participation-consent__start {
        width: 100%;
    }
}

@media (max-width: 520px) {
    body[data-research-page="true"]
    .research-participation-consent__card {
        border-radius: 1rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__header {
        padding:
            1.15rem
            1rem
            0.75rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__eyebrow {
        margin-bottom: 0.6rem;

        font-size: 0.68rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__title {
        font-size: 1.75rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__scroll-area {
        padding:
            0.15rem
            1rem
            0.6rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__footer {
        padding:
            0.75rem
            1rem
            0.95rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__confirmation-text {
        font-size: 0.84rem;
    }

    body[data-research-page="true"]
    .research-participation-consent__scroll-hint {
        border-width: 1px;

        font-size: 0.74rem;
        line-height: 1.3;
    }
}