/**
 * Self-Qualification Checklist Styles
 * PurpleLab Context Engine
 *
 * Every color routes through a custom property so the Elementor style controls
 * can override a single token instead of fighting specificity.
 */

.plce-qualifier {
    --plce-q-accent: #7c3aed;
    --plce-q-accent-soft: rgba(124, 58, 237, 0.12);
    --plce-q-surface: #ffffff;
    --plce-q-border: #e6e2dc;
    --plce-q-border-checked: var(--plce-q-accent);
    --plce-q-text: #1c1a1f;
    --plce-q-muted: #6b6670;

    box-sizing: border-box;
    /* Transparent by design: the section/row owns the background. Set one on
       the widget with the Card > Background control if you need it. */
    background-color: transparent;
    padding: 0;
    font-family: inherit;
    color: var(--plce-q-text);
}

.plce-qualifier *,
.plce-qualifier *::before,
.plce-qualifier *::after {
    box-sizing: border-box;
}

/* ===== Head ===== */

.plce-qualifier-head {
    text-align: center;
    margin-bottom: 20px;
}

.plce-qualifier-title {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--plce-q-text);
}

.plce-qualifier-subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--plce-q-muted);
}

/* ===== Statements ===== */

.plce-qualifier-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plce-qualifier-item {
    background-color: var(--plce-q-surface);
    border: 1px solid var(--plce-q-border);
    border-radius: 10px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.plce-qualifier-item:hover {
    border-color: #cfc8be;
}

.plce-qualifier-item.is-checked {
    border-color: var(--plce-q-border-checked);
    box-shadow: 0 0 0 1px var(--plce-q-border-checked);
}

.plce-qualifier-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    margin: 0;
    cursor: pointer;
    font-weight: inherit;
}

/* The real input stays focusable but visually replaced by .plce-qualifier-box */
.plce-qualifier-check {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.plce-qualifier-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border: 1.5px solid #cfc8be;
    border-radius: 6px;
    background-color: #ffffff;
    position: relative;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.plce-qualifier-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0.6);
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.plce-qualifier-check:checked + .plce-qualifier-box {
    background-color: var(--plce-q-accent);
    border-color: var(--plce-q-accent);
}

.plce-qualifier-check:checked + .plce-qualifier-box::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.plce-qualifier-check:focus-visible + .plce-qualifier-box {
    outline: 2px solid var(--plce-q-accent);
    outline-offset: 2px;
}

.plce-qualifier-text {
    font-size: 14px;
    line-height: 1.45;
    color: var(--plce-q-text);
}

/* ===== Counter ===== */

.plce-qualifier-meter {
    text-align: center;
    margin-top: 20px;
}

.plce-qualifier-count {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background-color: var(--plce-q-accent-soft);
    color: var(--plce-q-accent);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.plce-qualifier-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--plce-q-muted);
}

/* ===== CTA ===== */

.plce-qualifier-cta {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.plce-qualifier-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 8px;
    background-color: var(--plce-q-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease,
                background-color 0.18s ease, opacity 0.18s ease;
}

.plce-qualifier-btn:hover,
.plce-qualifier-btn:focus {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.plce-qualifier-btn .plce-whatsapp-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
}

/*
 * Qualified state: the button was already there, it just gets louder once the
 * visitor has recognized enough of the statements.
 */
.plce-qualifier.is-qualified .plce-qualifier-btn {
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35);
    animation: plce-q-pulse 0.45s ease;
}

@keyframes plce-q-pulse {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.045); }
    100% { transform: scale(1); }
}

/* Reveal mode: button hidden until the threshold is met */
.plce-qualifier--reveal .plce-qualifier-cta {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.plce-qualifier--reveal.is-qualified .plce-qualifier-cta {
    max-height: 140px;
    opacity: 1;
    margin-top: 16px;
}

/* Without JavaScript nothing can qualify, so always show the fallback link */
.plce-qualifier--reveal:not([data-plce-ready]) .plce-qualifier-cta {
    max-height: none;
    opacity: 1;
    margin-top: 16px;
    overflow: visible;
}

/* ===== Editor-only notice ===== */

.plce-qualifier-notice {
    padding: 12px 16px;
    border: 1px dashed #dc3545;
    border-radius: 6px;
    color: #dc3545;
    font-size: 13px;
}

/* ===== Motion preferences ===== */

@media (prefers-reduced-motion: reduce) {
    .plce-qualifier *,
    .plce-qualifier *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== Small screens ===== */

@media (max-width: 480px) {
    .plce-qualifier-title {
        font-size: 22px;
    }

    .plce-qualifier-label {
        padding: 14px 14px;
    }

    .plce-qualifier-btn {
        width: 100%;
        justify-content: center;
    }
}
