/* ============================================================
   TV Quiz Plugin — tv-quiz.css
   ============================================================ */

/* ---------- Reset inside quiz ---------- */
.tvq-wrap *,
.tvq-wrap *::before,
.tvq-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---------- Wrapper ---------- */
.tvq-wrap {
    font-family: 'Geologica', sans-serif;
    background: #1E1E1E;
    border: none;
    border-radius: 20px;
    width: 1200px;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Steps ---------- */
.tvq-step {
    display: none;
    width: 100%;
    min-height: 500px;
    padding: 36px 50px 40px;
    position: relative;
    flex-direction: column;
    gap: 20px;
}

.tvq-step--active {
    display: flex;
}

/* Form step — slightly different padding */
.tvq-step--form {
    padding-top: 28px;
}

/* ---------- Step counter ---------- */
.tvq-counter {
    position: absolute;
    top: 28px;
    left: 38px;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 0;
    pointer-events: none;
    user-select: none;
}

.tvq-counter__cur,
.tvq-counter__sep,
.tvq-counter__tot {
    font-family: 'Geologica', sans-serif;
    font-size: 89px;
    line-height: 1;
}

.tvq-counter__cur {
    font-weight: 800;
    color: #D4A000;
}

.tvq-counter__sep {
    font-weight: 400;
    color: #FFFFFF;
}

.tvq-counter__tot {
    font-weight: 800;
    color: #D4A000;
    opacity: 0.6;
}

/* ---------- Header ---------- */
.tvq-header {
    text-align: center;
    padding-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tvq-title {
    font-size: 48px;
    font-weight: 500;
    color: #FFFFFF;
    line-height: 1.1;
}

.tvq-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #DADADA;
    line-height: 1.4;
}

/* ---------- Options grid ---------- */
.tvq-options {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: stretch;
    flex: 1;
}

/* 4 карточки в ряд */
.tvq-options--4 {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    justify-content: center !important;
    align-items: stretch !important;
    flex: 1 !important;
    width: 100% !important;
}

.tvq-wrap .tvq-options--4 .tvq-option,
.tvq-wrap .tvq-options--4 button.tvq-option {
    width: 250px !important;
    min-width: 0 !important;
    max-width: 250px !important;
    height: 250px !important;
    min-height: 250px !important;
    max-height: 250px !important;
    flex: 1 1 0 !important;
}

/* ---------- Option card — квадрат, без бордера, Elementor override ---------- */
.tvq-wrap .tvq-option,
.tvq-wrap button.tvq-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    background: #252525 !important;
    background-color: #252525 !important;
    background-image: none !important;
    border: none !important;
    border-radius: 16px !important;
    cursor: pointer !important;
    transition: background 0.18s ease, transform 0.15s ease !important;
    padding: 0 !important;
    width: 250px !important;
    height: 250px !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    font-family: inherit !important;
    color: #DADADA !important;
    text-decoration: none !important;
}

.tvq-wrap .tvq-options--2 .tvq-option,
.tvq-wrap .tvq-options--2 button.tvq-option {
    width: 280px !important;
    height: 280px !important;
}

.tvq-wrap .tvq-option:hover,
.tvq-wrap button.tvq-option:hover,
.tvq-wrap .tvq-option:focus,
.tvq-wrap button.tvq-option:focus {
    background: #212020 !important;
    background-color: #212020 !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #DADADA !important;
    transform: translateY(-2px) !important;
    text-decoration: none !important;
}

.tvq-wrap .tvq-option:active,
.tvq-wrap button.tvq-option:active {
    background: #212020 !important;
    background-color: #212020 !important;
    transform: translateY(0) !important;
}

.tvq-wrap .tvq-option--clicked {
    background: #2a2400 !important;
    background-color: #2a2400 !important;
}

/* ---------- Icon inside card ---------- */
.tvq-option__icon {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tvq-option__icon img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    display: block;
}

/* ---------- Label under icon ---------- */
.tvq-option__label {
    font-family: 'Geologica', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #DADADA;
    text-align: center;
    line-height: 1.3;
}

/* ============================================================
   STEP 4 — FORM
   ============================================================ */

/* Honeypot — completely hidden */
.tvq-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.tvq-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

/* 2-column grid */
.tvq-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Message textarea spans same row height as phone */
.tvq-field--textarea {
    display: flex;
    flex-direction: column;
}

.tvq-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ---------- Label ---------- */
.tvq-label {
    font-family: 'Geologica', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #DADADA;
}

.tvq-req {
    color: #D4A000;
    margin-left: 2px;
}

/* ---------- Input / Textarea ---------- */
.tvq-wrap .tvq-input {
    background: #4B4B4B !important;
    background-color: #4B4B4B !important;
    border: 1px solid #020101 !important;
    border-radius: 8px !important;
    color: #DADADA !important;
    font-family: 'Geologica', sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    padding: 13px 16px !important;
    width: 100% !important;
    height: 44px !important;
    outline: none !important;
    transition: border-color 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.tvq-wrap .tvq-input::placeholder {
    color: #888 !important;
    font-size: 12px !important;
}

.tvq-wrap .tvq-input:focus {
    border-color: #D4A000 !important;
    outline: none !important;
    box-shadow: none !important;
}

.tvq-wrap .tvq-input.tvq-input--error {
    border-color: #e05555 !important;
}

.tvq-wrap .tvq-textarea {
    resize: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    padding-top: 13px !important;
}

/* ---------- Footer: checkbox + button ---------- */
.tvq-form__footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------- Checkbox ---------- */
.tvq-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.tvq-checkbox {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #D4A000;
    cursor: pointer;
    flex-shrink: 0;
}

.tvq-checkbox-text {
    font-family: 'Geologica', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #DADADA;
    line-height: 1.4;
}

.tvq-pp-link {
    color: #D4A000;
    text-decoration: none;
    transition: opacity 0.15s;
}

.tvq-pp-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ---------- Error message ---------- */
.tvq-error {
    font-family: 'Geologica', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #e05555;
    display: none;
    line-height: 1.4;
}

/* ============================================================
   КНОПКИ — стили берутся из buttons.css сайта (.ybtn, .tvs-btn-wrap, .tvs-btn-icon-circle)
   Здесь принудительный сброс Elementor внутри квиза
   ============================================================ */

#tv-quiz-wrap .ybtn,
#tv-quiz-wrap button.ybtn {
    display: inline-flex !important;
    align-items: center !important;
    background: var(--tv-btn-primary-bg, #C9A227) !important;
    background-color: var(--tv-btn-primary-bg, #C9A227) !important;
    background-image: none !important;
    color: #121212 !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 0 28px !important;
    height: 50px !important;
    min-height: 50px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    white-space: nowrap !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#tv-quiz-wrap .ybtn:hover,
#tv-quiz-wrap button.ybtn:hover,
#tv-quiz-wrap .ybtn:focus,
#tv-quiz-wrap button.ybtn:focus {
    background: var(--tv-btn-primary-hover, #A07D10) !important;
    background-color: var(--tv-btn-primary-hover, #A07D10) !important;
    color: #121212 !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

/* Disabled для submit */
#tv-quiz-wrap .tvq-submit:disabled,
#tv-quiz-wrap .ybtn.tvq-submit:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ============================================================
   SUCCESS SCREEN
   ============================================================ */

.tvq-success {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tvq-success__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.tvq-success__title {
    font-size: 48px;
}

.tvq-success__cta {
    font-size: 40px;
    font-weight: 500;
    color: #FFFFFF;
    line-height: 1.2;
    margin-top: 8px;
}

/* ============================================================
   MOBILE  ≤ 768px
   ============================================================ */

@media (max-width: 768px) {

    .tvq-wrap {
        width: 360px;
        min-height: auto;
        border-radius: 16px;
    }

    /* Шаг: счётчик → заголовок → карточки (всё в потоке, колонка) */
    .tvq-step {
        min-height: auto;
        padding: 20px 16px 24px;
        gap: 14px;
        flex-direction: column;
        align-items: center;
    }

    .tvq-step--form {
        padding-top: 20px;
        align-items: flex-start;
    }

    /* Counter — из absolute в поток, прижат влево */
    .tvq-counter {
        position: static !important;
        top: auto !important;
        left: auto !important;
        align-self: flex-start;
    }

    .tvq-counter__cur,
    .tvq-counter__sep,
    .tvq-counter__tot {
        font-size: 64px;
    }

    /* Header */
    .tvq-header {
        width: 100%;
    }

    /* Typography */
    .tvq-title {
        font-size: 30px;
    }

    .tvq-subtitle {
        font-size: 16px;
    }

    .tvq-success__cta {
        font-size: 26px;
    }

    .tvq-success__title {
        font-size: 30px;
    }

    /* Options — перенос, карточки 150x150 строго квадратные */
    .tvq-options {
        gap: 10px;
        flex-wrap: wrap !important;
        justify-content: center;
        align-items: flex-start;
        width: 100%;
    }

    .tvq-options--2 {
        flex-wrap: wrap !important;
    }

    #tv-quiz-wrap .tvq-option,
    #tv-quiz-wrap button.tvq-option,
    #tv-quiz-wrap .tvq-options--2 .tvq-option,
    #tv-quiz-wrap .tvq-options--2 button.tvq-option {
        width: 150px !important;
        height: 150px !important;
        min-height: 150px !important;
        max-height: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
        flex: 0 0 150px !important;
        padding: 0 !important;
        gap: 8px !important;
        overflow: hidden !important;
    }

    .tvq-option__icon,
    .tvq-option__icon img {
        width: 90px !important;
        height: 90px !important;
    }

    /* 2x2 на мобиле — карточки на всю ширину колонки */
    .tvq-options--4 {
        grid-template-columns: 1fr 1fr !important;
        max-width: 100% !important;
        gap: 10px !important;
    }

    #tv-quiz-wrap .tvq-options--4 .tvq-option,
    #tv-quiz-wrap .tvq-options--4 button.tvq-option {
        width: 100% !important;
        height: 150px !important;
        min-height: 150px !important;
        max-height: 150px !important;
        min-width: unset !important;
        max-width: none !important;
        flex: none !important;
    }

    /* Form */
    .tvq-form__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tvq-textarea {
        min-height: 44px !important;
    }
}

/* ============================================================
   Works inside Elementor popup (no width override conflicts)
   ============================================================ */

.elementor-popup-modal .tvq-wrap,
.dialog-widget-content .tvq-wrap {
    width: 100%;
    max-width: 900px;
}
