/* ==========================================================================
   QUIET LUXURY DESIGN SYSTEM • MAYA BELOVA AESTHETIC
   АРХИТЕКТУРА И ДИЗАЙН: КАРТА ТВОЕЙ ОПОРЫ • ЖАННА
   Референс: mayabelova.com/about_youtube (Cashmere Ivory, Dark Espresso, Terracotta Rose)
   ========================================================================== */

:root {
    /* Цветовая палитра сайта Майи Беловой */
    --bg-canvas: #f5efe4;
    --bg-surface: #faf6f0;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8f3eb;

    --text-primary: #452c1c;      /* Глубокий горький шоколад / эспрессо */
    --text-secondary: #7a6659;    /* Мягкий теплый кофе / тауп */
    --text-muted: #9e8c81;        /* Приглушенный песочно-серый */
    --text-light: #ffffff;

    --border-color: rgba(69, 44, 28, 0.12);
    --border-strong: rgba(69, 44, 28, 0.22);
    --border-accent: rgba(244, 132, 107, 0.35);

    --accent-terracotta: #f4846b;  /* Фирменный терракотовый коралл Майи Беловой */
    --accent-hover: #e27258;
    --accent-active: #d6654d;
    --accent-soft: rgba(244, 132, 107, 0.10);

    --shadow-card: 0 10px 30px -8px rgba(69, 44, 28, 0.08), 0 2px 8px -2px rgba(69, 44, 28, 0.04);
    --shadow-elevated: 0 16px 40px -10px rgba(69, 44, 28, 0.12);
    --shadow-button: 0 4px 14px rgba(69, 44, 28, 0.12);

    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;
}

/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

input {
    user-select: auto;
    -webkit-user-select: auto;
}

html, body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   КОНТЕЙНЕР ПРИЛОЖЕНИЯ
   ========================================================================== */

.app-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 14px 18px calc(24px + env(safe-area-inset-bottom));
}

/* ==========================================================================
   ВЕРХНИЙ БАР (СТИЛЬ МАЙИ БЕЛОВОЙ: ЛАКОНИЧНОСТЬ, СТАТУС)
   ========================================================================== */

.maya-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 18px;
}

.header-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-name {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.header-separator {
    font-size: 10px;
    color: var(--accent-terracotta);
}

.header-tag {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.header-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--accent-terracotta);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-accent);
}

/* ==========================================================================
   ЭКРАНЫ И ПЕРЕХОДЫ
   ========================================================================== */

.screen {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    animation: luxuryFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screen.active {
    display: flex;
}

.screen-content {
    flex: 1;
}

.screen-footer {
    padding-top: 18px;
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: linear-gradient(to top, var(--bg-canvas) 85%, rgba(245, 239, 228, 0));
    padding-bottom: env(safe-area-inset-bottom);
}

@keyframes luxuryFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   КАРТОЧКА АВТОРА (ФОТО, ТАБЫ)
   ========================================================================== */

.author-frame-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 20px;
}

.author-img-container {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    background-color: var(--bg-surface);
}

.author-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.author-photo-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(69, 44, 28, 0.08);
}

.dot-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-terracotta);
}

.author-tab-row {
    display: flex;
    padding: 6px;
    background: var(--bg-card-subtle);
    border-top: 1px solid var(--border-color);
    gap: 6px;
}

.author-tab {
    flex: 1;
    padding: 9px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: center;
}

.author-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    border-color: var(--border-color);
    box-shadow: 0 2px 6px rgba(69, 44, 28, 0.06);
}

/* ==========================================================================
   ТИПОГРАФИКА И ВСТУПИТЕЛЬНЫЙ БЛОК
   ========================================================================== */

.intro-text-box {
    margin-bottom: 18px;
    text-align: center;
}

.tag-pill {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.tag-success {
    background: #edf7ed;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 0 4px;
}

.page-subtitle b {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   ФРЕЙМЫ И КАРТОЧКИ С РАМКАМИ (TILDA ZERO-BLOCK СТИЛЬ)
   ========================================================================== */

.framed-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    padding: 18px 16px;
    margin-bottom: 14px;
}

.input-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.frame-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.frame-counter {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group {
    margin-bottom: 8px;
}

.clean-input {
    width: 100%;
    padding: 13px 14px;
    background: var(--bg-canvas);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.clean-input:focus {
    border-color: var(--accent-terracotta);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.clean-input::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

.frame-footer-note {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
}

/* Блок бонусов (стиль «Сразу после заполнения...») */
.bonus-framed-box {
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.bonus-accent-bar {
    width: 3px;
    height: 34px;
    background: var(--accent-terracotta);
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    margin-top: 2px;
}

.bonus-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.bonus-text {
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ==========================================================================
   КНОПКИ В СТИЛЕ MAYA BELOVA
   ========================================================================== */

.btn-primary-terracotta {
    width: 100%;
    padding: 16px 22px;
    background: var(--accent-terracotta);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-light);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-button);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-terracotta:hover {
    background: var(--accent-hover);
}

.btn-primary-terracotta:active {
    transform: scale(0.985);
    background: var(--accent-active);
}

.btn-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.btn-primary-terracotta:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-outline-warm {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-outline-warm:active {
    background: var(--bg-card-subtle);
    transform: scale(0.985);
}

.btn-ghost-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.2s;
}

.btn-ghost-back:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   ЭКРАН 2: ТЕСТИРОВАНИЕ (QUIZ)
   ========================================================================== */

.quiz-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.quiz-sphere-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(69, 44, 28, 0.04);
}

#sphere-num {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--accent-terracotta);
}

.quiz-counter {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Прогресс-бар цвета терракот */
.tilda-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(69, 44, 28, 0.08);
    border-radius: var(--radius-pill);
    margin-bottom: 20px;
    overflow: hidden;
}

.tilda-progress-bar {
    height: 100%;
    width: 4.16%;
    background: var(--accent-terracotta);
    border-radius: var(--radius-pill);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Карточка вопроса */
.framed-question-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-card);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-meta-lead {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-terracotta);
    margin-bottom: 10px;
    font-weight: 600;
}

.question-body {
    font-family: var(--font-serif);
    font-size: 21px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

/* 4 Варианта ответа */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tilda-option-card {
    width: 100%;
    padding: 15px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(69, 44, 28, 0.03);
}

.tilda-option-card:hover {
    border-color: var(--accent-terracotta);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(69, 44, 28, 0.06);
    transform: translateY(-1px);
}

.tilda-option-card:active {
    transform: scale(0.985);
    background: var(--accent-soft);
}

.opt-text-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.opt-num {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tilda-option-card:hover .opt-num {
    background: var(--accent-terracotta);
    color: #ffffff;
    border-color: var(--accent-terracotta);
}

.opt-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.opt-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.tilda-option-card:hover .opt-circle {
    border-color: var(--accent-terracotta);
}

.quiz-footer {
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   ЭКРАН 3: РЕЗУЛЬТАТЫ
   ========================================================================== */

.results-lead-box {
    text-align: center;
    margin-bottom: 20px;
}

.results-title {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.results-subtitle {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* Карточки 4 сфер */
.spheres-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.sphere-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
}

.sphere-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sphere-name-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sphere-num-roman {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-terracotta);
}

.sphere-title-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sphere-score-badge {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-terracotta);
}

.sphere-meter-track {
    width: 100%;
    height: 6px;
    background: rgba(69, 44, 28, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 10px;
}

.sphere-meter-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-terracotta);
    border-radius: var(--radius-pill);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.sphere-meta-row {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.sphere-status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.3px;
    margin-right: 6px;
}

.status-resilient {
    background: #edf7ed;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status-attention {
    background: #fff8e1;
    color: #8d5b00;
    border: 1px solid #ffe082;
}

.status-growth {
    background: #fdf2f0;
    color: #c94c34;
    border: 1px solid #f8c5bc;
}

.status-support {
    background: #fdebee;
    color: #a81c30;
    border: 1px solid #f9b8c3;
}

/* Рекомендационный блок (Hero Card) */
.recommendation-hero-card {
    background: var(--bg-card);
    border: 1.5px solid var(--accent-terracotta);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px -6px rgba(69, 44, 28, 0.08);
}

.rec-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.rec-status-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-terracotta);
    background: var(--accent-soft);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

.rec-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-terracotta);
}

.rec-program-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.25;
}

.rec-program-desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.btn-full {
    width: 100%;
}

.about-method-box {
    background: var(--bg-surface);
}

.about-method-p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Стили для свободного ввода и мультиселекта в квизе */
.clean-textarea {
    width: 100%;
    min-height: 130px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
    margin-bottom: 14px;
    user-select: auto;
    -webkit-user-select: auto;
}

.clean-textarea:focus {
    border-color: var(--accent-terracotta);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.tilda-option-card.selected {
    border-color: var(--accent-terracotta);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(244, 132, 107, 0.15);
}

.tilda-option-card.selected .opt-circle {
    border-color: var(--accent-terracotta);
    background: var(--accent-terracotta);
}

.tilda-option-card.selected .opt-circle::after {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

.quiz-action-btn {
    margin-top: 14px;
    width: 100%;
}