/* ===== ОСНОВА ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --gold: #C9A96E;
    --gold-light: #E8D5A3;
    --gold-dark: #9A7340;
    --dark: #0D0B0E;
    --dark-2: #141117;
    --dark-3: #1C1820;
    --dark-4: #251F2D;
    --purple: #2A1F3D;
    --purple-mid: #3D2A5E;
    --text: #F0EBE3;
    --text-muted: #9B8EA0;
    --border: rgba(201, 169, 110, 0.2);
    --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Jost', sans-serif;
    background: var(--dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== ЧАСТИЦЫ ===== */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== ШАПКА ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(to bottom, rgba(13,11,14,0.95), transparent);
}

.logo { display: flex; align-items: center; gap: 10px; }

.logo-note {
    font-size: 28px;
    color: var(--gold);
    line-height: 1;
    animation: pulse-note 3s ease-in-out infinite;
}

@keyframes pulse-note {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--gold-light);
    letter-spacing: 0.05em;
}

.logo-tagline {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-left: auto;
}

/* ===== ГЕРОЙ ===== */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 100px 80px 60px;
    position: relative;
    z-index: 1;
    gap: 60px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 50%;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(42,31,61,0.6) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(52px, 6vw, 88px);
    font-weight: 300;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 24px;
}

.hero-title em {
    font-style: italic;
    color: var(--gold);
    display: block;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 48px;
    max-width: 420px;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--dark);
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(201,169,110,0.3);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(201,169,110,0.45);
}

.btn-arrow { font-size: 20px; transition: transform 0.3s; }
.btn-start:hover .btn-arrow { transform: translateX(4px); }

/* Бутылочка */
.hero-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bottle-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(201,169,110,0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

.bottle-shape {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bottle-float 5s ease-in-out infinite;
    z-index: 1;
}

@keyframes bottle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.bottle-cap {
    width: 40px;
    height: 20px;
    background: linear-gradient(135deg, #E8D5A3, #9A7340);
    border-radius: 4px 4px 0 0;
    margin-bottom: 2px;
}

.bottle-neck {
    width: 28px;
    height: 50px;
    background: linear-gradient(to right, rgba(201,169,110,0.4), rgba(232,213,163,0.6), rgba(201,169,110,0.4));
    border-radius: 4px;
}

.bottle-body {
    width: 120px;
    height: 180px;
    background: linear-gradient(135deg, rgba(42,31,61,0.9), rgba(61,42,94,0.7));
    border: 1px solid rgba(201,169,110,0.4);
    border-radius: 12px 12px 20px 20px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.bottle-liquid {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 65%;
    background: linear-gradient(180deg, rgba(201,169,110,0.3) 0%, rgba(154,115,64,0.5) 100%);
    animation: liquid-wave 3s ease-in-out infinite;
}

@keyframes liquid-wave {
    0%, 100% { height: 65%; }
    50% { height: 60%; }
}

.bottle-shine {
    position: absolute;
    top: 10px;
    left: 15px;
    width: 12px;
    height: 60px;
    background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
    border-radius: 6px;
}

.scent-waves {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.scent-waves span {
    display: block;
    width: 2px;
    height: 30px;
    background: linear-gradient(to top, var(--gold), transparent);
    border-radius: 1px;
    animation: wave-up 2s ease-in-out infinite;
}

.scent-waves span:nth-child(2) { animation-delay: 0.3s; height: 45px; }
.scent-waves span:nth-child(3) { animation-delay: 0.6s; height: 25px; }

@keyframes wave-up {
    0%, 100% { transform: scaleY(1); opacity: 0.6; }
    50% { transform: scaleY(1.3); opacity: 1; }
}

/* ===== КВИЗ ===== */
.quiz-section {
    display: none;
    min-height: 100vh;
    padding: 100px 20px 60px;
    position: relative;
    z-index: 1;
}

.quiz-section.visible { display: block; }

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Прогресс */
.progress-bar {
    margin-bottom: 60px;
    position: relative;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-muted);
    transition: all 0.3s;
    background: var(--dark-2);
}

.progress-step.active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,169,110,0.1);
    box-shadow: 0 0 12px rgba(201,169,110,0.3);
}

.progress-step.done {
    border-color: var(--gold-dark);
    background: var(--gold-dark);
    color: var(--dark);
}

.progress-fill {
    height: 2px;
    background: linear-gradient(to right, var(--gold-dark), var(--gold));
    border-radius: 1px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(201,169,110,0.4);
    margin-top: 6px;
}

/* Шаги */
.quiz-step {
    display: none;
    animation: step-in 0.5s ease;
}

.quiz-step.active { display: block; }

@keyframes step-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.step-header {
    margin-bottom: 40px;
}

.step-number {
    display: inline-block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 0.3em;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
}

.step-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 12px;
    color: var(--text);
}

.step-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Карточки вариантов */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.options-gender { grid-template-columns: repeat(3, 1fr); }

.option-card {
    cursor: pointer;
    display: block;
}

.option-card input { display: none; }

.option-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--dark-2);
    transition: all 0.3s ease;
    text-align: center;
    min-height: 110px;
}

.option-icon {
    font-size: 28px;
    line-height: 1;
}

.option-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.03em;
}

.option-desc {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.option-card:hover .option-inner {
    border-color: rgba(201,169,110,0.4);
    background: var(--dark-3);
    transform: translateY(-2px);
}

.option-card input:checked ~ .option-inner {
    border-color: var(--gold);
    background: rgba(201,169,110,0.08);
    box-shadow: 0 0 20px rgba(201,169,110,0.15), inset 0 0 20px rgba(201,169,110,0.05);
}

.option-card input:checked ~ .option-inner .option-label {
    color: var(--gold-light);
}

/* Слайдер насыщенности */
.intensity-slider-wrap {
    padding: 20px 0;
}

.intensity-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.intensity-track {
    position: relative;
    padding: 12px 0;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: transparent;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--dark-4);
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    margin-top: -12px;
    box-shadow: 0 4px 16px rgba(201,169,110,0.4);
    border: 2px solid var(--dark);
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.intensity-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, var(--gold-dark), var(--gold));
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
    transition: width 0.1s;
}

.intensity-display {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--dark-2);
}

.intensity-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    color: var(--gold-light);
    letter-spacing: 0.05em;
}

/* Загрузка фото */
.photo-upload-area {
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: var(--dark-2);
    overflow: hidden;
    margin-bottom: 20px;
}

.photo-upload-area:hover,
.photo-upload-area.drag-over {
    border-color: var(--gold);
    background: rgba(201,169,110,0.04);
}

#photoInput {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    display: block;
    width: 100%;
    height: 100%;
}

.upload-icon { font-size: 48px; margin-bottom: 16px; }

.upload-text {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.upload-preview {
    position: relative;
    display: inline-block;
}

.upload-preview img {
    max-height: 280px;
    max-width: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.remove-photo {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--dark);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.remove-photo:hover {
    background: #3d1a1a;
    border-color: #c05;
    color: #ff4466;
}

.photo-privacy {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.03em;
}

/* Кнопка отправить */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: 32px;
    padding: 20px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #3D2A5E, #6B3FA0, #9A7340, #C9A96E);
    background-size: 300% 100%;
    background-position: 0% 50%;
    color: white;
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 8px 32px rgba(107,63,160,0.3);
}

.btn-submit:hover {
    background-position: 100% 50%;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(201,169,110,0.35);
}

.btn-submit-icon {
    font-size: 18px;
    animation: spin-star 6s linear infinite;
}

@keyframes spin-star {
    to { transform: rotate(360deg); }
}

/* Навигация */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-prev, .btn-next {
    padding: 12px 28px;
    border-radius: 50px;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
}

.btn-prev:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.btn-next {
    background: rgba(201,169,110,0.1);
    border-color: var(--border);
    color: var(--gold-light);
}

.btn-next:hover {
    background: rgba(201,169,110,0.2);
    border-color: var(--gold);
}

.btn-prev:disabled, .btn-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ===== ЗАГРУЗКА ===== */
.loading-section {
    display: none;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.loading-section.visible { display: flex; }

.loading-content {
    text-align: center;
    max-width: 400px;
}

.loading-bottle {
    width: 80px;
    height: 120px;
    border: 2px solid rgba(201,169,110,0.3);
    border-radius: 10px 10px 16px 16px;
    margin: 0 auto 40px;
    position: relative;
    overflow: hidden;
    background: var(--dark-2);
}

.loading-liquid {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 0%;
    background: linear-gradient(180deg, rgba(201,169,110,0.4), rgba(107,63,160,0.6));
    animation: fill-up 3s ease-in-out infinite;
}

@keyframes fill-up {
    0% { height: 0%; }
    50% { height: 80%; }
    100% { height: 0%; }
}

.loading-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 300;
    color: var(--gold-light);
    margin-bottom: 32px;
    letter-spacing: 0.03em;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.loading-step {
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
    background: var(--dark-2);
    transition: all 0.5s;
    position: relative;
    overflow: hidden;
}

.loading-step::before {
    content: '○';
    margin-right: 12px;
    font-size: 10px;
}

.loading-step.active {
    border-color: var(--gold);
    color: var(--gold-light);
    background: rgba(201,169,110,0.06);
}

.loading-step.active::before { content: '◉'; color: var(--gold); }

.loading-step.done {
    border-color: var(--gold-dark);
    color: var(--text-muted);
}

.loading-step.done::before { content: '✓'; color: var(--gold-dark); }

/* ===== РЕЗУЛЬТАТ ===== */
.result-section {
    display: none;
    min-height: 100vh;
    padding: 100px 20px 60px;
    position: relative;
    z-index: 1;
}

.result-section.visible { display: block; }

.result-container {
    max-width: 860px;
    margin: 0 auto;
    animation: step-in 0.8s ease;
}

.result-header {
    text-align: center;
    margin-bottom: 60px;
}

.result-badge {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.3em;
    color: var(--gold);
    border: 1px solid var(--border);
    padding: 6px 20px;
    border-radius: 20px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.result-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 16px;
}

.result-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Карточки духов */
.perfume-card {
    background: linear-gradient(135deg, var(--dark-2), var(--dark-3));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    margin-bottom: 24px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.perfume-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.perfume-card:hover {
    border-color: rgba(201,169,110,0.4);
    transform: translateY(-3px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.perfume-rank {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(201,169,110,0.1);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    color: var(--gold);
}

.perfume-brand {
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}

.perfume-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 16px;
}

.perfume-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.note-tag {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--dark-4);
}

.note-tag.top { border-color: rgba(201,169,110,0.4); color: var(--gold-light); }

.perfume-description {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.perfume-match {
    display: flex;
    align-items: center;
    gap: 12px;
}

.match-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.match-bar {
    flex: 1;
    height: 4px;
    background: var(--dark-4);
    border-radius: 2px;
    overflow: hidden;
}

.match-fill {
    height: 100%;
    background: linear-gradient(to right, var(--gold-dark), var(--gold));
    border-radius: 2px;
    transition: width 1s ease;
}

.match-percent {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    color: var(--gold-light);
    white-space: nowrap;
}

/* Общее описание */
.result-analysis {
    background: linear-gradient(135deg, rgba(42,31,61,0.5), rgba(13,11,14,0.5));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.result-analysis::before {
    content: '✦';
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 24px;
    color: rgba(201,169,110,0.3);
}

.analysis-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    color: var(--gold-light);
    margin-bottom: 12px;
}

.analysis-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Кнопка рестарт */
.result-footer { text-align: center; padding-top: 40px; }

.btn-restart {
    padding: 14px 40px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-restart:hover {
    border-color: var(--gold);
    color: var(--gold-light);
}

/* ===== ОШИБКА ===== */
.error-block {
    background: rgba(200, 30, 60, 0.08);
    border: 1px solid rgba(200, 30, 60, 0.25);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    color: #ff6680;
    margin-bottom: 24px;
}

.error-block p { font-size: 15px; line-height: 1.6; }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 100px 24px 60px;
        text-align: center;
    }

    .hero-visual { order: -1; }

    .hero-subtitle { margin: 0 auto 40px; }

    .header { padding: 16px 24px; }

    .logo-tagline { display: none; }

    .options-gender { grid-template-columns: repeat(3, 1fr); }

    .options-grid { grid-template-columns: repeat(2, 1fr); }

    .quiz-section { padding: 80px 16px 40px; }

    .perfume-card { padding: 24px; }

    .result-section { padding: 80px 16px 40px; }
}

@media (max-width: 480px) {
    .options-grid { grid-template-columns: 1fr 1fr; }
    .options-gender { grid-template-columns: 1fr; }
    .intensity-labels span:nth-child(2),
    .intensity-labels span:nth-child(3) { display: none; }
}
