/* static/css/site/chat/create.css */
.create-character-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 20px;
}

.create-heading {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0;
}
.create-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: -12px;
    margin-bottom: 8px;
}

.steps-bar {
    background: var(--glass-bg);
    border-radius: 12px;
    height: 6px;
    position: relative;
    border: 1px solid var(--glass-border);
    overflow: visible;
    margin-bottom: 8px;
}
.steps-progress {
    height: 100%;
    background: linear-gradient(135deg, #D63384, #E91E63);
    border-radius: 12px;
    transition: width 0.3s;
}
.steps-label {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.form-scroll {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.step-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}
.step-panel.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.input-with-example {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.input-with-example .form-input {
    flex: 1;
    min-width: 0;
}
.example-btn {
    align-self: flex-end;
}

.form-input {
    background: var(--bg-card);
    border: 1px solid rgba(214, 51, 132, 0.15);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: "Inter", sans-serif;
    resize: vertical;
    outline: none;
    transition: 0.2s;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.1);
}
.form-input.error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}
textarea.form-input {
    min-height: 90px;
}

/* Кастомный селект */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}
.custom-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 40px;
    width: 100%;
}
.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.9rem;
}

/* Счётчик символов */
.char-counter {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Ошибка */
.error-message {
    font-size: 0.75rem;
    color: #e53e3e;
    display: none;
    margin-top: 2px;
}

/* Кнопка Пример */
.example-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
    font-size: 1.2rem;
}
.example-btn:hover {
    background: rgba(214, 51, 132, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* Возраст слайдер */
.age-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
}
.age-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(214, 51, 132, 0.15);
    border-radius: 3px;
    outline: none;
}
.age-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(214, 51, 132, 0.3);
}
.age-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    min-width: 30px;
    text-align: center;
}

/* Генерация изображения */
.image-generation-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}
.image-preview {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(214, 51, 132, 0.2);
    box-shadow: 0 8px 25px rgba(214, 51, 132, 0.1);
    position: relative;
    background: var(--bg-card);
    cursor: pointer;
}
.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    font-weight: 600;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.generating-text { font-size: 0.9rem; }
.generate-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(214, 51, 132, 0.3);
    transition: 0.2s;
}
.generate-btn:hover { background: var(--accent-hover); }
.generate-btn:disabled { background: #ccc; color: #888; cursor: not-allowed; box-shadow: none; }
.generate-hint { font-size: 0.75rem; color: var(--text-secondary); }

/* Кнопки навигации */
.form-footer {
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--glass-border);
    padding-top: 16px;
}
.nav-btn {
    flex: 1;
    padding: 14px 0;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}
.back-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.next-btn {
    background: var(--accent);
    color: white;
}
.next-btn:disabled, .create-btn:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}
.create-btn {
    background: linear-gradient(135deg, #D63384, #E91E63);
    color: white;
}

/* Лайтбокс */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

/* Равные колонки на третьем шаге */
.row-flex {
    display: flex;
    gap: 16px;
    align-items: stretch;
}
.half-width {
    flex: 1;
    min-width: 0;
}

/* Адаптив */
@media (max-width: 600px) {
    .row-flex {
        flex-direction: column;
    }
    .half-width {
        width: 100%;
    }
    .input-with-example {
        flex-wrap: wrap;
    }
    .input-with-example .example-btn {
        align-self: flex-end;
    }
}

@media (max-width: 768px) {
    .create-heading { font-size: 1.8rem; }
    .example-btn { width: 40px; height: 40px; }
}

/* ... (весь предыдущий CSS без изменений) ... */

/* Пол персонажа – стильные радио-кнопки */
.gender-toggle {
    display: flex;
    gap: 12px;
}
.gender-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 14px;
    background: var(--bg-card);
    border: 1px solid rgba(214, 51, 132, 0.15);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.gender-option i {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.gender-option input[type="radio"] {
    display: none;
}
.gender-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(214, 51, 132, 0.08);
    box-shadow: 0 0 0 3px rgba(214, 51, 132, 0.1);
}
.gender-option:has(input:checked) i {
    color: var(--accent);
}
.gender-radio {
    display: none; /* кастомная точка не нужна, используем иконку */
}
/* Creator V2: ИИ-черновик */
.ai-draft {
    background: linear-gradient(135deg, rgba(214, 51, 132, 0.14), rgba(156, 39, 176, 0.08));
    border: 1px solid rgba(214, 51, 132, 0.35);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-draft-title { font-weight: 700; color: var(--text-primary); }
.ai-draft-title i { color: var(--accent); margin-right: 6px; }
.ai-draft textarea { resize: none; font-size: 16px; }
.ai-draft-btn {
    background: linear-gradient(135deg, #D63384, #E91E63);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 46px;
}
.ai-draft-btn:disabled { opacity: 0.7; cursor: default; }
.ai-draft-note { font-size: 0.8rem; color: var(--text-secondary); }
.ai-draft-note.error { color: #ff6b6b; }

/* Простое создание персонажа */
.step-panel.ai-only > *:not(.ai-draft) { display: none !important; }
.steps-bar { display: none; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-chip {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid rgba(214, 51, 132, 0.4);
    border-radius: 18px;
    padding: 9px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 40px;
}
.ai-chip:active { background: var(--accent); color: #fff; }
.ai-manual-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    font-size: 0.9rem;
    padding: 8px;
    cursor: pointer;
}
.ai-draft-btn { font-size: 1.1rem; min-height: 54px; }
.draft-summary {
    background: linear-gradient(135deg, rgba(214, 51, 132, 0.16), rgba(156, 39, 176, 0.08));
    border: 1px solid rgba(214, 51, 132, 0.4);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 16px;
}
.draft-summary-head { display: flex; gap: 10px; align-items: center; }
.draft-summary-head > i { color: #2ecc71; font-size: 1.5rem; }
.draft-summary-name { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }
.draft-summary-meta { color: var(--text-secondary); font-size: 0.85rem; }
.draft-summary-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.4; margin: 10px 0; }
.draft-edit {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
    min-height: 40px;
}
@media (max-width: 768px) {
    .form-footer {
        position: sticky;
        bottom: 0;
        z-index: 20;
        background: var(--bg-card, #1b1b20);
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -8px 18px rgba(0, 0, 0, 0.35);
    }
    .create-heading { font-size: 1.5rem; margin-bottom: 4px; }
    .create-subtitle { font-size: 0.95rem; margin-bottom: 14px; }
}
.step-panel.simple .row-flex { display: none; }

/* Интрига до генерации: лицо скрыто в дымке, а не «сломанная» заглушка */
.image-preview.not-generated .preview-img {
    filter: blur(9px) brightness(0.4) saturate(1.3);
    transform: scale(1.12);
}
.image-preview.not-generated {
    animation: teaserGlow 2.4s ease-in-out infinite;
}
@keyframes teaserGlow {
    0%, 100% { box-shadow: 0 8px 25px rgba(214, 51, 132, 0.15), 0 0 0 0 rgba(214, 51, 132, 0.35); }
    50% { box-shadow: 0 8px 30px rgba(214, 51, 132, 0.3), 0 0 0 6px rgba(214, 51, 132, 0.08); }
}
.image-teaser {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 16px;
    background: linear-gradient(180deg, rgba(20,10,20,0.15), rgba(20,10,20,0.55));
}
.image-preview.not-generated .image-teaser { display: flex; }
.teaser-icon {
    font-size: 1.7rem;
    color: #fff;
    opacity: 0.92;
    text-shadow: 0 0 14px rgba(214, 51, 132, 0.9);
}
.teaser-text {
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.teaser-sub {
    color: rgba(255,255,255,0.75);
    font-size: 0.76rem;
}
