/* ===== ПАЛИТРА "ТЁПЛЫЙ ПЕСОК" ===== */
:root {
    --bg-page: #FDFBF7;
    --bg-page-gradient: linear-gradient(135deg, #FDFBF7 0%, #F5EDE0 100%);
    --bg-card: #FFFFFF;
    --bg-input: #FEFBF5;
    --primary: #B8956A;
    --primary-hover: #A68456;
    --primary-gradient: linear-gradient(135deg, #B8956A 0%, #A68456 100%);
    --secondary: #A89F91;
    --secondary-hover: #948B7D;
    --secondary-gradient: linear-gradient(135deg, #A89F91 0%, #948B7D 100%);
    --text-main: #4A3F35;
    --text-muted: #6B5D50;
    --text-label: #5C4B37;
    --border: #E8DDD0;
    --border-dashed: #D4C5B5;
    --accent: #C9A961;
    --shadow-card: 0 10px 30px rgba(74, 63, 53, 0.08);
    --shadow-btn: 0 4px 12px rgba(184, 149, 106, 0.25);
    --shadow-btn-hover: 0 6px 16px rgba(184, 149, 106, 0.35);
}

/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-page-gradient);
    min-height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    margin: 25px auto;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    max-width: 800px;
}

/* Списки внутри карточки */
.card ol,
.card ul {
    padding-left: 20px;
    margin: 10px 0;
}

.card ol li,
.card ul li {
    margin: 5px 0;
    line-height: 1.5;
}

.success-card {
    border-left: 6px solid var(--primary);
}

/* ===== ЗАГОЛОВКИ ===== */
h1, h2, h3 {
    color: var(--text-main);
    margin-bottom: 1rem;
}

h1 {
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
}

/* ===== ФОРМЫ ===== */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-label);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--bg-input);
    color: var(--text-main);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.15);
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 14px 28px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-btn);
}

.btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #947346 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn-hover);
}

.btn-secondary {
    background: var(--secondary-gradient);
    box-shadow: 0 4px 12px rgba(168, 159, 145, 0.25);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-hover) 0%, #827869 100%);
    box-shadow: 0 6px 16px rgba(168, 159, 145, 0.35);
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== НЕАКТИВНАЯ КНОПКА ===== */
.btn:disabled,
.btn-disabled {
    background: var(--secondary) !important;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn-disabled:hover {
    background: var(--secondary) !important;
    transform: none !important;
}

/* ===== PIN-ПОЛЯ ===== */
.pin-input {
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    padding: 15px;
    width: 250px;
    margin: 20px auto;
    display: block;
    font-family: monospace;
    border: 2px solid var(--border);
    background: var(--bg-input);
}

/* ===== БЭЙДЖИ ===== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-left: 10px;
}

.badge-male {
    background: #7A8B9C; /* Приглушённый серо-синий */
    color: white;
}

.badge-female {
    background: var(--accent); /* Тёплое золото */
    color: white;
}

.badge-success {
    background: #E8F4E8;
    color: #4A6B4A;
}

.badge-warning {
    background: #FFF8DC;
    color: #8B7355;
}

/* ===== ЧЕК-ЛИСТ ===== */
.checklist-item {
    background: var(--bg-input);
    padding: 20px;
    margin: 15px 0;
    border-radius: 10px;
    border-left: 5px solid var(--primary);
    box-shadow: 0 2px 4px rgba(74, 63, 53, 0.05);
}

.checklist-number {
    background: var(--primary-gradient);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
}

/* ===== ОШИБКИ И УВЕДОМЛЕНИЯ ===== */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.alert-error {
    background: #FDE8E8;
    color: #8B4545;
    border: 1px solid #F5C6CB;
}

.alert-success {
    background: #E8F4E8;
    color: #4A6B4A;
    border: 1px solid #C3E6CB;
}

/* ===== ГЕНДЕРНЫЕ СЕКЦИИ ===== */
.gender-section {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.gender-box {
    flex: 1;
    padding: 20px;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ===== URL-БОКСЫ ===== */
.url-box {
    background: #F5F0E8;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px dashed var(--border-dashed);
    word-break: break-all;
    font-family: monospace;
    font-size: 14px;
    position: relative;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .card {
        padding: 20px;
    }
    .gender-section {
        flex-direction: column;
    }
    .pin-input {
        width: 90%;
        font-size: 20px;
    }
}

/* ===== УТИЛИТЫ ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ===== ВОПРОСЫ АНКЕТЫ ===== */
.question-block {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(74, 63, 53, 0.05);
}

.question-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-main);
}

.question-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.option-label:hover {
    border-color: var(--primary);
    background: var(--bg-input);
}

.option-label input {
    margin-right: 10px;
}

.scale-container {
    margin: 20px 0;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 10px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
}

.range-value {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary);
    margin-top: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Контейнер кнопок */
.refresh-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* Время последней проверки */
.last-checked {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-left: 10px;
    font-style: italic;
}

/* Сообщение о загрузке */
.loading-message {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 5px;
}

/* ===== КЛИКАБЕЛЬНЫЕ ССЫЛКИ ===== */
.clickable-url {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
    display: block;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clickable-url:hover {
    color: var(--primary-hover);
    background: var(--bg-input);
    text-decoration: underline;
}

/* ===== КНОПКИ КОПИРОВАНИЯ ===== */
.copy-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.copy-btn.copied {
    background: var(--primary-hover);
    padding-right: 40px;
}

.copy-btn.copied::after {
    content: '✓';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
}

/* ===== ПОДСКАЗКИ ===== */
.tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-main);
}

.url-box:hover .tooltip {
    opacity: 1;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.pulse-text {
    animation: pulse 1.5s infinite;
}

/* ===== КНОПКА "СКАЗАТЬ СПАСИБО" ===== */
.btn.btn-thanks {
    background: linear-gradient(135deg, #C47B6B 0%, #A96354 100%) !important;
    color: white !important;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(196, 123, 107, 0.3);
    margin-top: 15px;
}

.btn.btn-thanks:hover {
    background: linear-gradient(135deg, #A96354 0%, #8A4E42 100%) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(196, 123, 107, 0.5);
}

/* ===== ПОЛЗУНКИ (RANGE SLIDER) ===== */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--border) 100%);
    outline: none;
    cursor: pointer;
}

/* Chrome, Safari, Opera, Edge */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(184, 149, 106, 0.4);
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(184, 149, 106, 0.4);
    transition: transform 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

/* Значение ползунка (output) */
output,
.range-value {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2em;
}

/* Подсветка незаполненных обязательных вопросов */
.question-block:has(.question[data-code].missing) {
    border-left-color: #dc3545 !important;
    background: #FDE8E8 !important;
}

.question.missing {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
