/* style.css */

/* ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ */
body { 
    font-family: Arial, sans-serif; 
    background: #3d3d3d; /* Темный фон */
    margin:0; 
    padding:20px; 
    color: #ffffff; /* Светлый текст */
}

h1 {
    text-align: center; 
    margin-bottom: 20px; 
}

/* КОНТЕЙНЕРЫ */
.container, .chat-container, .form-container { 
    max-width:800px; 
    margin:20px auto; 
    background:transparent; 
    padding:20px; 
    border-radius:10px; 
    box-shadow:0 2px 8px rgba(0,0,0,0.08); 
}

/* --- СТИЛИ ДЛЯ СПОЙЛЕРА/ПЕРЕКЛЮЧЕНИЯ ВИДИМОСТИ --- */

/* Стили для кнопки спойлера (Открытие) */
.spoiler-toggle {
    background: #5e5e5e; 
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    display: block; 
    margin: 20px auto 0;
    max-width: 250px; 
    transition: opacity 0.3s;
}

/* Скрываем кнопку, когда инструкции открыты */
.spoiler-toggle.hidden {
    display: none; 
}


/* --- СТИЛИ ДЛЯ ТАЙМЕРА И КНОПКИ СВОРАЧИВАНИЯ --- */

/* Контейнер для таймера и кнопки */
.header-controls {
    display: flex;
    justify-content: flex-end; /* Выравнивание вправо */
    align-items: center;
    gap: 10px;
    /* Немного уменьшаем внешние отступы, чтобы поднять блок выше */
    margin: -10px -10px 10px 0; 
    padding: 0 10px;
}

/* Стили для кнопки "Свернуть" */
.collapse-btn {
    background: none;
    border: none;
    color: #999; 
    font-size: 13px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.collapse-btn:hover {
    color: #ffffff; 
}

/* Стили для отображения оставшегося времени */
.timer-display {
    position: static; 
    font-size: 11px;
    color: #999; 
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 6px;
    border-radius: 4px;
    display: none; 
    /* Убираем лишние стили позиционирования */
}


/* --- СТИЛИ ДЛЯ ОБЩЕГО БЛОКА ИНСТРУКЦИЙ (.typing-container) --- */

.typing-container {
    /* Фон для карточки сообщения */
    background: #4a4a4a; 
    padding: 20px;
    border-radius: 10px;
    margin: 20px auto 5px auto; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); 
    
    /* position: relative удален */

    /* Управляет плавным появлением и скрытием всего блока */
    max-height: 0;
    opacity: 0;
    overflow: hidden; 
    transition: max-height 3s ease-in-out, opacity 3s ease-in-out; 
}

/* Класс, который добавляется JS, чтобы показать блок */
.typing-container.active {
    max-height: 1500px; 
    opacity: 1;
}

/* --- СТИЛИ ДЛЯ ТЕКСТА ВНУТРИ (БЕЗ ПОСТРОЧНОЙ АНИМАЦИИ) --- */

/* Стили для параграфов внутри блока: */
.line-by-line-text p {
    margin: 0;
    font-size: 16px;
    font-weight: normal; 
    line-height: 1.5; 
    padding-bottom: 5px; 
}


/* БЛОК КНОПОК И ССЫЛОК */

/* Выделение ключевых слов цветом */
strong {
    color: #2b8aef; 
    font-weight: 700;
}

.buttons {
  display: flex;
  flex-direction: column; 
  gap: 12px;              
  align-items: center;    
  margin-top: 8px;
}

.btn {
  width: 100%;           
  max-width: 300px;      
  text-align: center;
  padding: 12px 18px;
  background: #2b8aef;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  display: inline-block;
}

/* СТИЛИ ФОТО-КАРУСЕЛИ */

.photo-title {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff; 
}

.photo-carousel {
    display: flex;
    overflow-x: scroll;
    overflow-y: hidden;
    border-radius: 10px;
    padding: 5px 0; 
    -webkit-overflow-scrolling: touch;
}

.photo-item {
    flex-shrink: 0; 
    height: 150px; 
    width: auto; 
    margin-right: 15px; 
    border-radius: 8px;
    object-fit: cover;
}

/* СТИЛИ ЧАТА И ФОРМ */
.chat-window { height:360px; overflow:auto; border:1px solid #eee; padding:12px; border-radius:8px; background:#3d3d3d; }
.input-row { display:flex; gap:8px; margin-top:12px; }
.input-row input { flex:1; padding:10px; border-radius:6px; border:1px solid #ccc; }
.input-row button { padding:10px 14px; border-radius:6px; border:none; background:#2b8aef; color:#fff; cursor:pointer; }
.msg { margin:8px 0; padding:8px 12px; border-radius:8px; max-width:80%; }
.msg.user { margin-left:auto; background:#dcf8c6; text-align:right; }
.msg.bot { margin-right:auto; background:#fff; border:1px solid #eee; color: #333; } 
form label { display:block; margin:8px 0; }
form input { width:100%; padding:8px; box-sizing:border-box; border-radius:6px; border:1px solid #ccc; }
.sig-buttons { margin:8px 0; }
.form-actions { margin-top:12px; }
.small { font-size:12px; color:#aaa; margin-top:12px; } 
#signature-pad {
    width: 100%;       
    max-width: 600px;  
    height: 160px;     
    display: block;    
    
}

/* ================ ДОПОЛНЕНИЯ ДЛЯ КНОПОК ФОРМЫ ================ */

/* Контейнер для кнопок в форме */
.form-actions {
  display: flex; /* Располагаем кнопки в ряд */
  flex-direction: column; /* Ставим их друг под другом */
  gap: 10px; /* Добавляем отступ между ними */
  align-items: center; /* Центрируем по горизонтали */
  margin-top: 20px; /* Увеличиваем отступ от блока с подписью */
}

/* Стиль для второстепенной (серой) кнопки */
.btn.btn-secondary {
  background: #6c757d; /* Серый цвет фона */
}

/* Эффект при наведении на второстепенную кнопку */
.btn.btn-secondary:hover {
  background: #5a6268; /* Более темный серый при наведении */
}

/* Уточнение для основной кнопки, если она не синяя */
.form-actions .btn[type="submit"] {
  background: #2b8aef; /* Синий цвет, как у остальных кнопок .btn */
}

.form-actions .btn[type="submit"]:hover {
  background: #1a73d1; /* Более темный синий при наведении */
}