@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   RESET + МОБИЛЬНАЯ БАЗА
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

:root {
    --burgundy: #B8252A;
    --wine: #8B1E23;
    --rose: #E8979C;
    --cream: #FAF7F5;
    --charcoal: #2B2B2B;
    --gray: #8C8C8C;
    --light: #F5F1EE;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: linear-gradient(160deg, var(--wine) 0%, var(--burgundy) 50%, var(--rose) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    color: var(--charcoal);
    /* iPhone notch / Dynamic Island */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* Убираем резиновый bounce на iOS */
    overscroll-behavior-y: contain;
}

.app-container {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

/* ============================================
   ФОН — орбы
   ============================================ */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(55px);
    opacity: 0.22;
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(184, 37, 42, 0.6) 0%, transparent 70%);
    top: -70px;
    right: -70px;
    animation: float 8s ease-in-out infinite;
}

.orb-2 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(232, 151, 156, 0.4) 0%, transparent 70%);
    bottom: -30px;
    left: -30px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(10px, -18px); }
}

/* ============================================
   КОНТЕЙНЕР + АНИМАЦИЯ ВХОДА
   ============================================ */
.content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 20px 16px 48px;
    opacity: 0;
    animation: fadeIn 0.45s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================
   ХЕДЕР
   ============================================ */
/* Хедер */
.app-header {
    margin-bottom: 18px;
    color: white;
    padding-top: 6px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.brand-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    opacity: 0.92;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 300;
    opacity: 0.6;
    letter-spacing: 0.6px;
}

/* ============================================
   ПРОГРЕСС БАР
   ============================================ */
.progress-container {
    height: 3px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    overflow: hidden;
    margin: 14px 0 18px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, white 0%, var(--rose) 100%);
    border-radius: 10px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

/* ============================================
   КАРТОЧКИ
   ============================================ */
.card {
    background: white;
    border-radius: 22px;
    padding: 26px 18px 30px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--wine) 0%, var(--burgundy) 50%, var(--rose) 100%);
}

.hidden { display: none; }

/* ============================================
   WELCOME ЭКРАН
   ============================================ */
.welcome-screen { text-align: center; }

.welcome-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--charcoal);
}

.welcome-subtitle {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 18px;
    font-weight: 300;
}

.welcome-description {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--charcoal);
    margin-bottom: 28px;
    text-align: left;
}

/* ============================================
   КНОПКИ — минимум 44px tap target (Apple HIG)
   ============================================ */
.btn {
    width: 100%;
    min-height: 52px;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    font-family: 'Inter', sans-serif;
    -webkit-appearance: none;
    appearance: none;
    /* Убираем outline на iOS */
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--wine) 0%, var(--burgundy) 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(184, 37, 42, 0.4);
}

.btn-primary:active {
    transform: scale(0.96);
    box-shadow: 0 3px 10px rgba(184, 37, 42, 0.3);
}

/* ============================================
   ВОПРОСНЫЙ ЭКРАН
   ============================================ */
.question-screen { min-height: auto; }

.question-number {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.8rem;
    font-weight: 900;
    color: var(--burgundy);
    opacity: 0.09;
    position: absolute;
    top: 12px;
    left: 16px;
    line-height: 1;
    pointer-events: none;
}

.question-content {
    position: relative;
    z-index: 1;
}

.question-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 18px;
    line-height: 1.3;
}

.question-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--burgundy);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Подсказка о пропуске вопросов */
.question-hint {
    font-size: 0.8rem;
    color: var(--gray);
    background: var(--light);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    line-height: 1.5;
    border-left: 3px solid var(--rose);
}

/* ============================================
   ВАРИАНТЫ ОТВЕТОВ
   ============================================ */
.options {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 18px;
}

.option {
    background: var(--light);
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 15px 14px;
    min-height: 52px; /* 44px tap target + padding */
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    gap: 13px;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
}

.option:active {
    transform: scale(0.97);
}

.option.selected {
    background: linear-gradient(135deg, var(--wine) 0%, var(--burgundy) 100%);
    color: white;
    border-color: var(--wine);
    box-shadow: 0 5px 18px rgba(184, 37, 42, 0.3);
}

.option-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    flex-shrink: 0;
    position: relative;
}

.option.selected .option-checkbox {
    background: white;
    border-color: white;
}

.option-checkbox::after {
    content: '✓';
    color: var(--burgundy);
    font-weight: bold;
    font-size: 14px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.option.selected .option-checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.option-text {
    font-size: 0.88rem;
    line-height: 1.42;
    flex: 1;
}

/* ============================================
   НАВИГАЦИЯ
   ============================================ */
.navigation {
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    gap: 9px;
}

.btn-nav {
    width: 100%;
    min-height: 52px;
    padding: 15px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.1s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.btn-nav:active { transform: scale(0.96); }

.btn-back {
    background: var(--light);
    color: var(--charcoal);
    order: 2;
}

.btn-next {
    background: var(--burgundy);
    color: white;
    order: 1;
    box-shadow: 0 6px 18px rgba(184, 37, 42, 0.35);
}

/* ============================================
   ЭКРАН РЕЗУЛЬТАТОВ
   ============================================ */
.results-screen { text-align: center; }

.results-score {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--wine) 0%, var(--burgundy) 50%, var(--rose) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    line-height: 1;
    animation: scaleIn 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.75); }
    to   { opacity: 1; transform: scale(1); }
}

.results-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 10px;
}

.results-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray);
    margin-bottom: 22px;
    text-align: left;
}

.results-blocks {
    text-align: left;
    background: var(--light);
    padding: 18px 14px;
    border-radius: 16px;
    margin: 22px 0;
}

.results-blocks-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 14px;
    text-align: center;
}

.block-item {
    background: white;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 9px;
    border-left: 4px solid var(--burgundy);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.block-item-title {
    font-weight: 700;
    color: var(--burgundy);
    margin-bottom: 5px;
    font-size: 0.87rem;
}

.block-item-signs {
    font-size: 0.78rem;
    color: var(--gray);
    line-height: 1.5;
}

.block-item-sign {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3px;
}

.block-item-sign::before {
    content: '→';
    color: var(--burgundy);
    margin-right: 6px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Правильная версия утверждения */
.block-item-correct {
    margin-top: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    border-radius: 10px;
    border-left: 3px solid #4caf50;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #2e7d32;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.correct-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
    flex-shrink: 0;
    line-height: 1;
}

/* ============================================
   CTA БЛОК — TELEGRAM
   ============================================ */
.results-cta {
    background: linear-gradient(150deg, #0077b6 0%, #00a8e0 100%);
    padding: 26px 18px 26px;
    border-radius: 22px;
    margin: 26px 0;
    box-shadow: 0 12px 40px rgba(0, 119, 182, 0.3);
}

/* ============================================
   ВИДЕОКРУЖОЧЕК — 220px, play оверлей,
   пульсация кольца, тап для воспроизведения
   ============================================ */
.video-circle-wrapper {
    width: 220px;
    height: 220px;
    margin: 0 auto 22px;
    position: relative;
}

/* Пульсация: 2 кольца по очереди — явная подсказка "тапни" */
.video-circle-wrapper::before,
.video-circle-wrapper::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 1;
}

.video-circle-wrapper::before {
    animation: pulse-ring 2.2s ease-out infinite;
}

.video-circle-wrapper::after {
    animation: pulse-ring 2.2s ease-out 1.1s infinite;
}

@keyframes pulse-ring {
    0%   { transform: scale(1);    opacity: 0.6; }
    100% { transform: scale(1.22); opacity: 0; }
}

/* Само кружок */
.video-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: 3.5px solid rgba(255, 255, 255, 0.75);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    /* Чёткий тап-отклик */
    transition: transform 0.12s ease;
}

.video-circle:active {
    transform: scale(0.93);
}

/* Видео тег — стоит на паузе до тапа, показываем первый кадр */
.video-circle video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    /* Убираем контроллы на iOS Safari */
    -webkit-controls-paced: none;
}

/* ---- PLAY ОВЕРЛЕЙ ---- */
/* Полупрозрачный слой + play + текст "Нажмите для просмотра" */
.video-play-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(155deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.6) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 2;
    /* pointer-events: none — тап идёт на .video-circle */
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Скрываем оверлей после тапа через JS класс */
.video-play-overlay.hidden {
    opacity: 0;
}

/* Белый круг с иконкой play */
.play-btn {
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}

/* Треугольник play */
.play-btn::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent var(--burgundy);
    margin-left: 5px;
}

/* Текст под play — однозначно говорит "тапни" */
.play-label {
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.55);
    text-align: center;
    line-height: 1.3;
}

/* Кнопка скорости 1x/2x — справа снизу от кружочка */
.speed-toggle {
    position: absolute;
    bottom: -8px;
    right: -8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid rgba(0, 119, 182, 0.3);
    border-radius: 22px;
    color: #0077b6;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    min-width: 52px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.speed-toggle:active {
    transform: scale(0.92);
    background: white;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

/* ============================================
   CTA ТЕКСТ + КНОПКА
   ============================================ */
.cta-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 7px;
    line-height: 1.3;
}

.cta-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-telegram {
    width: 100%;
    min-height: 52px;
    background: white;
    color: #0077b6;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.btn-telegram:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Сметка под CTA */
.results-cta-note {
    margin-top: 18px;
    color: var(--gray);
    font-size: 0.76rem;
    line-height: 1.5;
    text-align: center;
}
