/* Базовые стили и сброс */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0d0a07; /* Глубокий темно-коричневый */
    color: #e0d4c5; /* Мягкий кремовый цвет текста */
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Градиент для заголовков */
.gold-text-gradient {
    background: linear-gradient(135deg, #ffe0a3 0%, #c5a059 50%, #9e7a3d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-align: center;
}

.subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #8c7b6c;
    text-align: center;
    margin-top: 5px;
    margin-bottom: 25px;
}

/* Кнопка "Назад" */
.back-btn {
    align-self: flex-start;
    color: #c5a059;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* Управление экранами */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Стили формы */
.form-container {
    background: rgba(26, 20, 15, 0.6);
    border: 1px solid rgba(197, 160, 89, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.input-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8c7b6c;
    margin-bottom: 8px;
}

.input-group input[type="text"] {
    background-color: #17120e;
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 8px;
    color: #f5efe6;
    padding: 12px;
    font-size: 15px;
    outline: none;
    transition: border 0.3s;
}

.input-group input[type="text"]:focus {
    border-color: #c5a059;
    box-shadow: 0 0 8px rgba(197, 160, 89, 0.2);
}

/* Выбор пола */
.gender-selector {
    display: flex;
    gap: 10px;
}

.gender-btn {
    flex: 1;
    cursor: pointer;
}

.gender-btn input {
    display: none;
}

.gender-btn span {
    display: block;
    text-align: center;
    background-color: #17120e;
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    color: #8c7b6c;
    transition: all 0.3s;
}

.gender-btn input:checked + span {
    border-color: #c5a059;
    background: rgba(197, 160, 89, 0.1);
    color: #ffe0a3;
}

/* Главная кнопка */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #c5a059 0%, #9e7a3d 100%);
    border: none;
    border-radius: 8px;
    color: #0d0a07;
    font-weight: bold;
    padding: 15px;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.3s;
}

.submit-btn:active {
    transform: scale(0.98);
}

/* Экран загрузки */
.loading-box {
    background: rgba(26, 20, 15, 0.6);
    border: 1px solid rgba(197, 160, 89, 0.15);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.loading-title {
    font-size: 14px;
    color: #a89685;
    margin-bottom: 15px;
    line-height: 1.5;
}

.status-label {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #8c7b6c;
    margin-bottom: 30px;
}

.text-gold {
    color: #c5a059;
    font-weight: bold;
}

/* Анимация круга (Loader) */
.loader-circle {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(197, 160, 89, 0.1);
    border-top: 3px solid #c5a059;
    border-radius: 50%;
    margin: 0 auto 30px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-subtext {
    font-size: 11px;
    color: #615449;
}

/* Отображение текста отчета */
.report-content {
    background: rgba(26, 20, 15, 0.8);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 12px;
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    color: #f5efe6;
    margin-bottom: 30px;
    white-space: pre-wrap; /* Сохраняем переносы строк от ИИ */
}

/* Стилизация истории */
.history-container {
    margin-top: auto;
}

.history-title {
    font-size: 12px;
    letter-spacing: 1.5px;
    color: #8c7b6c;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: #17120e;
    border: 1px solid rgba(197, 160, 89, 0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: border 0.3s;
}

.history-item:hover {
    border-color: rgba(197, 160, 89, 0.3);
}

.history-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-name {
    font-size: 14px;
    font-weight: bold;
    color: #ffe0a3;
}

.history-dob {
    font-size: 11px;
    color: #8c7b6c;
}

/* Цветовые метки статусов */
.status-badge {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-badge.generating { color: #c5a059; }
.status-badge.failed { color: #d9534f; }
.status-badge.delivered { color: #5cb85c; }

/* Раздельные поля ввода даты */
.dob-split-container {
    display: flex;
    gap: 12px;
}

/* Раздельные поля ввода даты — исправленная адаптивная верстка */
.dob-split-container {
    display: flex;
    gap: 10px; /* Уменьшили зазор между ячейками для мобильных */
    width: 100%;
}

.dob-split-container input {
    flex: 1;
    width: 100%;       /* Заставляем поле занимать всю выделенную колонку */
    min-width: 0;      /* Сбрасываем ограничение браузера на минимальный размер */
    text-align: center;
    background-color: #17120e;
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-radius: 8px;
    color: #f5efe6;
    padding: 12px 5px;  /* Оптимизировали внутренние отступы */
    font-size: 16px;    /* Комфортный размер шрифта для телефона */
    outline: none;
    transition: border 0.3s;
}

.dob-split-container input:focus {
    border-color: #c5a059;
    box-shadow: 0 0 8px rgba(197, 160, 89, 0.2);
}

/* Ячейка года под 4 цифры */
.dob-split-container input#dob-year {
    flex: 1.4; /* Делаем поле года чуть шире по пропорции */
}

/* Кнопка примера отчета — полное соответствие размерам главной кнопки */
.example-btn {
    width: 100%;
    background-color: #1a140f;
    border: 1px solid #c5a059;
    border-radius: 8px;
    color: #ffe0a3;
    font-weight: bold;
    padding: 15px; /* Точно такой же внутренний отступ, как у главной кнопки */
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase; /* Все буквы заглавные */
    margin-top: 12px;
    transition: transform 0.1s, opacity 0.3s;
}

.example-btn:active {
    transform: scale(0.98); /* Такая же анимация нажатия */
}