/* ============================================================
   ОПРОСНИК — СТИЛИ В СТИЛЕ САЙТА
   ============================================================ */

/* ===== ОБЩИЕ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: #faf8ff;
    color: #1A1A2E;
    line-height: 1.6;
}

/* ===== ШАПКА САЙТА (как в index.html) ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f8f8f8;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.logo img {
    width: 130px;
    height: auto;
}
.hamburger {
    display: none;
    cursor: pointer;
}
.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: #333;
    margin: 5px 0;
    border-radius: 2px;
}
.close-menu {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}
.nav-menu {
    display: flex;
}
.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 20px;
}
.nav-menu ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}
.nav-menu ul li a:hover {
    color: #ADD8E6;
}

/* Мобильное меню */
@media (max-width: 600px) {
    .hamburger { display: block; }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -260px;
        width: 250px;
        height: 100%;
        background: #fff;
        padding: 60px 20px;
        transition: right 0.3s;
        z-index: 999;
        box-shadow: -4px 0 20px rgba(0,0,0,0.08);
        flex-direction: column;
    }
    .nav-menu.active { right: 0; }
    .close-menu { display: block; }
    .nav-menu ul { flex-direction: column; gap: 16px; }
    .nav-menu ul li a { font-size: 16px; }
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.q-container {
    max-width: 680px;
    margin: 180px auto 40px;
    padding: 0 16px 120px;
}

/* ===== ШАПКА ОПРОСНИКА ===== */
.q-header {
    background: linear-gradient(135deg, #8B6FC4, #C9456A);
    color: #fff;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}
.q-user {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 2px;
}
.q-user i { margin-right: 6px; }
.q-user span { font-weight: 600; }

.q-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.q-title i { margin-right: 8px; }

.q-sub {
    font-size: 13px;
    opacity: 0.75;
    margin-top: 2px;
}

.day-badge {
    background: rgba(255,255,255,0.2);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    min-width: 90px;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.day-badge:hover {
    background: rgba(255,255,255,0.3);
}
.day-badge i { margin-right: 4px; }
.day-badge small {
    display: block;
    font-size: 10px;
    opacity: 0.7;
    font-weight: 400;
}

/* ===== ФАЗЫ ===== */
.phase-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
}
.pc {
    border-radius: 12px;
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.25s;
    line-height: 1.4;
    color: #fff;
}
.pc i {
    display: block;
    font-size: 20px;
    margin-bottom: 2px;
}
.pc .phase-days {
    font-size: 9px;
    font-weight: 400;
    opacity: 0.8;
}
.pc.on { opacity: 1; transform: scale(1.02); }
.pc1 { background: #C9456A; }
.pc2 { background: #D4882A; }
.pc3 { background: #3A9E78; }
.pc4 { background: #7055B8; }

/* ===== НАВИГАЦИЯ ПО ВКЛАДКАМ ===== */
.q-nav {
    display: flex;
    background: #fff;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0edf8;
    position: sticky;
    top: 80px;
    z-index: 10;
}
.qn {
    flex: 1;
    padding: 10px 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #9090B0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.qn i { margin-right: 5px; }
.qn:hover { background: #f5f2ff; }
.qn.on {
    background: #8B6FC4;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(139,111,196,0.3);
}

/* ===== ВКЛАДКИ ===== */
.qp { display: none; }
.qp.on { display: block; }

/* ===== КАРТОЧКИ ===== */
.q-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid #f0edf8;
    transition: all 0.2s;
}
.q-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.q-card-header {
    font-size: 16px;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
}
.q-card-header i {
    font-size: 20px;
}

/* ===== ПОЛЯ ===== */
.q-field { margin-bottom: 14px; }
.q-field:last-child { margin-bottom: 0; }

.q-field .fl {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1A1A2E;
    margin-bottom: 6px;
}
.q-field-hint {
    font-size: 12px;
    color: #9090B0;
    margin-bottom: 12px;
    font-style: italic;
}

/* ===== ШКАЛА (0–10) ===== */
.sc-row {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}
.sb {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #e4e0f0;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #9090B0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.sb:hover {
    border-color: #8B6FC4;
    color: #8B6FC4;
    transform: scale(1.05);
}
.sb.on {
    border-color: #8B6FC4;
    background: #8B6FC4;
    color: #fff;
    box-shadow: 0 2px 8px rgba(139,111,196,0.3);
}
.sc-hint {
    font-size: 10px;
    color: #b0b0c8;
    margin-left: 6px;
}

/* ===== ЭМОДЗИ (без эмодзи, используем иконки) ===== */
.em-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.eb {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #e4e0f0;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #9090B0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}
.eb i { font-size: 18px; }
.eb:hover {
    border-color: #C9456A;
    color: #C9456A;
}
.eb.on {
    border-color: #C9456A;
    background: #fef0f4;
    color: #C9456A;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(201,69,106,0.15);
}

/* ===== ПЕРЕКЛЮЧАТЕЛИ ===== */
.tg-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tb {
    flex: 1;
    min-width: 70px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid #e4e0f0;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    color: #9090B0;
    transition: all 0.15s;
}
.tb:hover {
    border-color: #8B6FC4;
    color: #8B6FC4;
}
.tb.on {
    border-color: #8B6FC4;
    background: #f5f0ff;
    color: #534AB7;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(139,111,196,0.12);
}

/* ===== ТЕКСТОВЫЕ ПОЛЯ ===== */
.fi {
    width: 100%;
    border: 2px solid #e4e0f0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: #1A1A2E;
    background: #fff;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.fi:focus {
    border-color: #8B6FC4;
}
.fi[type="number"] {
    width: 140px;
}

/* ===== КНОПКИ ===== */
.q-save-btn {
    width: 100%;
    padding: 14px;
    background: #ADD8E6;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}
.q-save-btn:hover {
    background: #87CEEB;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(173,216,230,0.4);
}
.q-save-btn:active {
    transform: scale(0.98);
}

.q-send-btn {
    width: 100%;
    padding: 16px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    box-shadow: 0 4px 14px rgba(76,175,80,0.3);
    margin: 12px 0 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.q-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76,175,80,0.4);
}
.q-send-btn:active { transform: scale(0.98); }
.q-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.q-export-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #8B6FC4;
    border: 2px solid #8B6FC4;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.q-export-btn:hover {
    background: #f5f0ff;
    transform: translateY(-2px);
}

/* ===== АНАЛИТИКА ===== */
.stat-g {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.stat {
    background: #f5f2ff;
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    border: 1px solid #ede8fa;
}
.stat-n { font-size: 24px; font-weight: 700; color: #8B6FC4; }
.stat-l { font-size: 11px; color: #9090B0; margin-top: 2px; }

.bar-item { margin-bottom: 10px; }
.bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.bar-name {
    font-size: 12px;
    color: #4A4A6A;
    font-weight: 600;
}
.bar-val {
    font-size: 12px;
    font-weight: 600;
    color: #1A1A2E;
}
.bar-track {
    height: 6px;
    background: #f0edf8;
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.craving-g {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.craving-cell {
    background: #f5f2ff;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid #ede8fa;
}
.craving-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #4A4A6A;
    margin-bottom: 4px;
}
.craving-bars { display: flex; flex-direction: column; gap: 3px; }
.cb-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.cb-phase {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cb-tr {
    flex: 1;
    height: 5px;
    background: #e4e0f0;
    border-radius: 3px;
    overflow: hidden;
}
.cb-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.cb-v {
    font-size: 10px;
    color: #9090B0;
    width: 18px;
    text-align: right;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: #1A1A2E;
    color: #fff;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 600px) {
    .q-container { margin-top: 80px; padding: 0 12px 100px; }
    .q-header { padding: 16px 18px; flex-direction: column; align-items: stretch; }
    .q-title { font-size: 18px; }
    .day-badge { align-self: flex-start; padding: 4px 14px; font-size: 13px; }
    .phase-strip { gap: 6px; }
    .pc { font-size: 10px; padding: 8px 2px; }
    .pc i { font-size: 18px; }
    .q-nav { top: 70px; padding: 3px; }
    .qn { font-size: 12px; padding: 8px 4px; }
    .qn i { margin-right: 3px; }
    .q-card { padding: 14px 16px; }
    .stat-g { grid-template-columns: 1fr 1fr; }
    .craving-g { grid-template-columns: 1fr 1fr; }
    .sb { width: 30px; height: 30px; font-size: 12px; }
    .eb { padding: 4px 12px; font-size: 12px; }
    .eb i { font-size: 16px; }
    .tb { min-width: 60px; padding: 6px 10px; font-size: 11px; }
    .fi[type="number"] { width: 120px; }
    .q-send-btn { font-size: 14px; padding: 14px; }
}