/* Simple Quiz Public Styles */

.sq-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.sq-quiz-title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
    color: #1d2327;
}

/* Прогресс-бар */
.sq-progress-bar-container {
    margin-bottom: 30px;
}

.sq-progress-bar {
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.sq-progress-fill {
    height: 100%;
    background: #e94560;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.sq-progress-text {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: #646970;
    font-weight: 500;
}

/* Вопросы */
.sq-question-step {
    animation: sqFadeIn 0.3s ease;
}

@keyframes sqFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.sq-question-header {
    margin-bottom: 25px;
}

.sq-question-counter {
    display: block;
    font-size: 14px;
    color: #e94560;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sq-question-text {
    font-size: 22px;
    color: #1d2327;
    margin: 0;
    line-height: 1.4;
}

/* Сетка ответов */
.sq-answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.sq-answers-grid.sq-no-images {
    grid-template-columns: 1fr;
}

.sq-answer-card {
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sq-answer-card:hover {
    border-color: #e94560;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.15);
    transform: translateY(-2px);
}

.sq-answer-card.sq-selected {
    background: #fff1f3;
    border-color: #e94560;
}

.sq-answer-image {
    width: 100%;
    height: 150px;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.sq-answer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sq-answer-text {
    font-size: 16px;
    color: #1d2327;
    font-weight: 500;
}

.sq-answer-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: #e94560;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.sq-answer-card.sq-selected .sq-answer-check {
    opacity: 1;
    transform: scale(1);
}

/* Навигация */
.sq-question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.sq-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.sq-btn-next,
.sq-btn-submit {
    background: #e94560;
    color: #fff;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.sq-btn-next:hover:not(:disabled),
.sq-btn-submit:hover {
    background: #d63d56;
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
    transform: translateY(-2px);
}

.sq-btn-prev {
    background: #f0f0f1;
    color: #646970;
}

.sq-btn-prev:hover {
    background: #e5e5e5;
    color: #3c434a;
}

/* Финальный шаг */
.sq-final-step {
    text-align: center;
    animation: sqFadeIn 0.4s ease;
}

.sq-final-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.sq-final-title {
    font-size: 24px;
    color: #1d2327;
    margin-bottom: 25px;
}

/* Мессенджеры - центрирование */
.sq-messengers {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

/* Центрирование для разного количества контактов */
.sq-messengers.sq-count-1 {
    justify-content: center;
}

.sq-messengers.sq-count-1 .sq-messenger-item {
    min-width: 120px;
}

.sq-messengers.sq-count-2 {
    justify-content: center;
}

.sq-messengers.sq-count-2 .sq-messenger-item {
    min-width: 100px;
}

.sq-messengers.sq-count-3 {
    justify-content: center;
}

.sq-messengers.sq-count-4 {
    justify-content: center;
}

.sq-messenger-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    background: #f6f7f7;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.sq-messenger-item:hover {
    background: #fff;
    border-color: #e94560;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.sq-messenger-item.sq-active {
    background: #fff1f3;
    border-color: #e94560;
}

.sq-messenger-icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.sq-messenger-name {
    font-size: 13px;
    color: #646970;
    font-weight: 500;
}

/* Форма */
.sq-final-form {
    max-width: 400px;
    margin: 0 auto 20px;
}

.sq-form-group {
    margin-bottom: 15px;
}

.sq-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.sq-input:focus {
    outline: none;
    border-color: #e94560;
}

.sq-input::placeholder {
    color: #a7aaad;
}

.sq-phone-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #646970;
}

.sq-btn-submit {
    width: 100%;
    justify-content: center;
    padding: 16px 30px;
    font-size: 18px;
}

.sq-policy-text {
    font-size: 13px;
    color: #646970;
    margin-top: 15px;
}

.sq-policy-link {
    color: #e94560;
    text-decoration: underline;
}

.sq-btn-prev-final {
    margin-top: 15px;
}

/* Сообщение об успехе */
.sq-success-message {
    text-align: center;
    padding: 40px 20px;
    animation: sqFadeIn 0.4s ease;
}

.sq-success-icon {
    width: 80px;
    height: 80px;
    background: #00a32a;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.sq-success-message h3 {
    font-size: 28px;
    color: #1d2327;
    margin-bottom: 10px;
}

.sq-success-message p {
    color: #646970;
    font-size: 16px;
}

/* Ошибки валидации */
.sq-input.sq-error {
    border-color: #d63638;
    background: #ffebee;
}

/* Адаптивность */
@media screen and (max-width: 600px) {
    .sq-quiz-container {
        padding: 15px;
    }

    .sq-quiz-title {
        font-size: 22px;
    }

    .sq-question-text {
        font-size: 18px;
    }

    .sq-answers-grid {
        grid-template-columns: 1fr;
    }

    .sq-answer-image {
        height: 120px;
    }

    .sq-messengers {
        gap: 10px;
    }

    .sq-messenger-item {
        padding: 12px 15px;
        min-width: 70px;
    }

    .sq-messenger-icon {
        font-size: 24px;
    }

    .sq-question-nav {
        flex-direction: column-reverse;
        gap: 10px;
    }

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

    .sq-btn-prev {
        order: 1;
    }
}

/* Анимация загрузки */
.sq-loading {
    position: relative;
    pointer-events: none;
}

.sq-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: sqSpin 1s linear infinite;
}

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