@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Oranienbaum&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-warm: #f5f1f0;
    --bg-dark: #202f2e;
    --bg-dark-overlay: rgba(32, 47, 46, 0.85);
    --text-dark: #2c3e3d;
    --text-light: #ffffff;
    --text-muted: #8a9695;
    --accent: #5a7a78;
    --accent-hover: #4a6a68;
    --border-light: rgba(255, 255, 255, 0.3);
    --font-heading: 'Oranienbaum', 'Playfair Display', serif;
    --font-body: 'Playfair Display', Georgia, serif;
    --shadow-soft: 0 2px 20px rgba(32, 47, 46, 0.08);
}

body {
    font-family: var(--font-body);
    background: var(--bg-warm);
    color: var(--text-dark);
    line-height: 1.6;
    letter-spacing: 0.02em;
}

/* --- Captcha --- */
.captcha-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 20px;
    background: var(--bg-dark);
    background-image: linear-gradient(135deg, var(--bg-dark) 0%, #1a2625 100%);
}
.captcha-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 2px; padding: 48px 40px;
    max-width: 440px; width: 100%;
    box-shadow: var(--shadow-soft);
    text-align: center;
}
.captcha-card h2 {
    font-family: var(--font-heading);
    font-size: 28px; font-weight: 400;
    margin-bottom: 8px; color: var(--text-dark);
    letter-spacing: 0.05em;
}
.captcha-description {
    color: var(--text-muted); margin-bottom: 24px;
    font-size: 14px; letter-spacing: 0.03em;
}
.captcha-question {
    background: var(--bg-warm); border-radius: 2px; padding: 20px;
    font-size: 18px; font-weight: 500; margin-bottom: 20px;
    color: var(--text-dark); letter-spacing: 0.02em;
}
.captcha-input {
    width: 100%; padding: 14px 18px; border: 1px solid #d5cdc9;
    border-radius: 2px; font-size: 16px; margin-bottom: 20px;
    outline: none; transition: border-color 0.3s;
    font-family: var(--font-body); letter-spacing: 0.02em;
    background: #fff;
}
.captcha-input:focus { border-color: var(--accent); }
.error-message {
    background: #fef0ef; color: #8b3a3a; padding: 12px;
    border-radius: 2px; margin-bottom: 20px; font-size: 14px;
    border: 1px solid #e8c5c5;
}
.btn-primary {
    width: 100%; padding: 14px; background: var(--bg-dark);
    color: var(--text-light); border: 1px solid var(--border-light);
    border-radius: 2px; font-size: 15px; cursor: pointer;
    transition: all 0.3s; font-family: var(--font-body);
    letter-spacing: 0.1em; text-transform: uppercase;
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

/* --- Chat --- */
.chat-container {
    max-width: 720px; margin: 0 auto; height: 100vh;
    display: flex; flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-soft);
}
.chat-header {
    padding: 20px 24px;
    background: var(--bg-dark);
    color: var(--text-light);
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.chat-header h3 {
    font-family: var(--font-heading);
    font-size: 22px; font-weight: 400;
    letter-spacing: 0.08em;
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 24px;
    display: flex; flex-direction: column; gap: 14px;
    background: var(--bg-warm);
}
.message { display: flex; }
.user-message { justify-content: flex-end; }
.assistant-message { justify-content: flex-start; }
.message-bubble {
    max-width: 75%; padding: 12px 18px; border-radius: 2px;
    font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word;
    letter-spacing: 0.01em;
}
.user-message .message-bubble {
    background: var(--bg-dark); color: var(--text-light);
}
.assistant-message .message-bubble {
    background: #ffffff; color: var(--text-dark);
    border: 1px solid #e5dfdc;
}
.assistant-wrapper { display: flex; flex-direction: column; align-items: flex-start; max-width: 75%; }
.assistant-wrapper .message-bubble { max-width: 100%; }
.options-container {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 10px; width: 100%;
}
.option-btn {
    padding: 12px 18px; background: #ffffff; color: var(--text-dark);
    border: 1px solid var(--accent); border-radius: 2px;
    font-family: var(--font-body); font-size: 14px;
    letter-spacing: 0.02em; cursor: pointer; text-align: left;
    transition: all 0.2s;
}
.option-btn:hover:not(:disabled) {
    background: var(--accent); color: var(--text-light);
}
.option-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.typing-indicator {
    padding: 10px 24px; display: flex; gap: 6px; align-items: center;
    background: var(--bg-warm);
}
.typing-indicator .typing-label {
    font-size: 13px; color: var(--text-muted);
    letter-spacing: 0.02em; margin-right: 4px;
    font-style: italic;
}
.typing-indicator .typing-dot {
    width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.typing-indicator .typing-dot:nth-child(3) { animation-delay: 0.2s; }
.typing-indicator .typing-dot:nth-child(4) { animation-delay: 0.4s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

.chat-input-area {
    padding: 16px 24px; border-top: 1px solid #e5dfdc;
    background: #fff;
}
.input-row { display: flex; gap: 10px; }
.input-row input {
    flex: 1; padding: 12px 18px; border: 1px solid #d5cdc9;
    border-radius: 2px; font-size: 15px; outline: none;
    font-family: var(--font-body); letter-spacing: 0.01em;
    transition: border-color 0.3s;
}
.input-row input:focus { border-color: var(--accent); }
.input-row button {
    padding: 12px 24px; background: var(--bg-dark); color: var(--text-light);
    border: 1px solid var(--border-light); border-radius: 2px;
    font-size: 14px; cursor: pointer; font-family: var(--font-body);
    letter-spacing: 0.08em; text-transform: uppercase;
    transition: all 0.3s;
}
.input-row button:hover { background: var(--accent); }
.input-row button:disabled { background: #b0bab9; border-color: #b0bab9; cursor: not-allowed; }
.chat-finished {
    padding: 20px 18px;
    background: var(--bg-warm);
}

/* Finished card (post-Finished marker in chat) */
.finished-card {
    background: #fff;
    border-radius: 6px;
    padding: 24px 22px;
    box-shadow: 0 2px 16px rgba(32,47,46,0.08);
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}
.finished-icon {
    width: 48px; height: 48px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    color: var(--accent);
    font-size: 22px;
    font-weight: 600;
}
.finished-title {
    font-family: var(--font-heading);
    font-size: 22px; font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}
.finished-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}
.finished-privacy {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    border-top: 1px solid #ece6e3;
    margin: 14px -22px 0;
    padding-left: 22px; padding-right: 22px;
}
.finished-actions {
    display: flex; flex-direction: column; gap: 10px;
    margin: 18px 0 10px;
}
.finished-action {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 14px;
    text-align: left;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}
.finished-action-primary {
    background: var(--bg-dark);
    color: var(--text-light);
    border-color: var(--bg-dark);
}
.finished-action-primary:hover { background: var(--accent); border-color: var(--accent); }
.finished-action-secondary {
    background: #fff;
    color: var(--text-dark);
    border-color: #e5dfdc;
}
.finished-action-secondary:hover { border-color: var(--accent); background: var(--bg-warm); }
.finished-action-arrow {
    font-size: 16px;
    color: var(--text-muted);
}
.finished-action-primary .finished-action-arrow { color: var(--text-light); opacity: 0.7; }
.finished-link-icon { margin-right: 6px; }
.finished-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 12px;
    letter-spacing: 0.02em;
}
.finished-copy-status {
    display: block;
    min-height: 16px;
    font-size: 11px;
    color: var(--accent);
    margin-top: 6px;
}

/* --- Admin --- */
.admin-container {
    max-width: 1200px; margin: 0 auto; padding: 24px;
}
.admin-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.admin-header h2 {
    font-family: var(--font-heading); font-size: 26px; font-weight: 400;
    letter-spacing: 0.05em;
}
.admin-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-nav a {
    padding: 8px 18px; background: #fff; border: 1px solid #d5cdc9;
    border-radius: 2px; text-decoration: none; color: var(--text-dark);
    font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase;
    font-family: var(--font-body); transition: all 0.3s;
}
.admin-nav a:hover, .admin-nav a.active {
    background: var(--bg-dark); color: var(--text-light); border-color: var(--bg-dark);
}
.card {
    background: #fff; border-radius: 2px; padding: 24px;
    box-shadow: var(--shadow-soft); margin-bottom: 16px;
    overflow-x: auto;
}
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card {
    background: #fff; border-radius: 2px; padding: 20px 24px;
    box-shadow: var(--shadow-soft); flex: 1; min-width: 180px;
}
.stat-card .label { font-size: 12px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.stat-card .value { font-size: 28px; font-weight: 600; margin-top: 6px; color: var(--text-dark); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #ece6e3; font-size: 14px; }
th { font-weight: 500; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
tr:hover { background: var(--bg-warm); }

/* Classic tests table: keep "score + badge" cells on a single line so the
   table stays tight and doesn't wrap the badge onto a second row. */
#testsTable td { white-space: nowrap; }

.badge {
    display: inline-block; padding: 3px 12px; border-radius: 2px;
    font-size: 11px; font-weight: 500; letter-spacing: 0.05em;
}
.badge-success { background: #e8f0e8; color: #2d5a2d; }
.badge-danger { background: #f5e5e5; color: #6b2c2c; }
.badge-warning { background: #f5f0e0; color: #6b5c1a; }
.badge-info { background: #e5eef0; color: #2c4a6b; }

.btn {
    padding: 8px 16px; border: 1px solid #d5cdc9; border-radius: 2px;
    cursor: pointer; font-size: 13px; font-family: var(--font-body);
    letter-spacing: 0.03em; transition: all 0.3s; background: #fff;
}
.btn-success { background: #3a6b3a; color: #fff; border-color: #3a6b3a; }
.btn-success:hover { background: #2d5a2d; }
.btn-danger { background: #6b2c2c; color: #fff; border-color: #6b2c2c; }
.btn-danger:hover { background: #5a2424; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.login-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    background: var(--bg-dark);
    background-image: linear-gradient(135deg, var(--bg-dark) 0%, #1a2625 100%);
}
.login-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 48px 40px; border-radius: 2px;
    box-shadow: var(--shadow-soft); max-width: 380px; width: 100%;
}
.login-card h2 {
    text-align: center; margin-bottom: 28px;
    font-family: var(--font-heading); font-weight: 400;
    font-size: 26px; letter-spacing: 0.05em;
}
.login-card input {
    width: 100%; padding: 12px 16px; border: 1px solid #d5cdc9;
    border-radius: 2px; margin-bottom: 14px; font-size: 14px;
    font-family: var(--font-body); letter-spacing: 0.02em;
    outline: none; transition: border-color 0.3s;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button { width: 100%; }
.login-error { color: #8b3a3a; font-size: 13px; text-align: center; margin-bottom: 14px; }

.dialog-messages { display: flex; flex-direction: column; gap: 12px; }
.dialog-messages .message-bubble { max-width: 80%; }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.filter-tabs button {
    padding: 7px 16px; border: 1px solid #d5cdc9; border-radius: 2px;
    background: #fff; cursor: pointer; font-size: 12px;
    font-family: var(--font-body); letter-spacing: 0.05em;
    text-transform: uppercase; transition: all 0.3s;
}
.filter-tabs button.active { background: var(--bg-dark); color: var(--text-light); border-color: var(--bg-dark); }
.filter-tabs button:hover { border-color: var(--accent); }

/* --- Pager for paginated lists --- */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0 8px;
    font-size: 13px;
}
.pager button {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #d5cdc9;
    border-radius: 2px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-dark);
    transition: all 0.2s;
}
.pager button:hover:not(:disabled) {
    background: var(--bg-dark);
    color: var(--text-light);
    border-color: var(--bg-dark);
}
.pager button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pager-info {
    color: var(--text-muted);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* --- Psychometric test (bot2) --- */
.test-progress {
    padding: 16px 24px; background: #fff; border-bottom: 1px solid #e5dfdc;
}
.progress-bar-wrap {
    width: 100%; height: 6px; background: #e5dfdc; border-radius: 2px; overflow: hidden;
}
.progress-bar {
    height: 100%; background: var(--accent); width: 0%;
    transition: width 0.3s ease;
}
.progress-text {
    text-align: center; margin-top: 8px; font-size: 12px;
    color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase;
}
.test-instruction {
    padding: 14px 18px; background: #fff; border: 1px solid #e5dfdc;
    border-radius: 2px; color: var(--text-muted); font-size: 13px;
    letter-spacing: 0.02em; font-style: italic;
}
.test-question {
    padding: 20px 22px; background: #fff; border: 1px solid #e5dfdc;
    border-radius: 2px; font-size: 17px; line-height: 1.5;
    color: var(--text-dark); font-weight: 500;
}

/* --- Result page --- */
.result-container {
    max-width: 720px; margin: 0 auto; padding: 32px 24px;
}
.result-header h2 {
    font-family: var(--font-heading); font-size: 32px; font-weight: 400;
    text-align: center; margin-bottom: 24px; letter-spacing: 0.05em;
}
.result-section {
    background: #fff; border-radius: 2px; padding: 24px 28px;
    box-shadow: var(--shadow-soft); margin-bottom: 20px;
}
.result-section h3 {
    font-family: var(--font-heading); font-weight: 400;
    font-size: 22px; margin-bottom: 16px; letter-spacing: 0.03em;
    border-bottom: 1px solid #ece6e3; padding-bottom: 10px;
}
.score-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #f5f1f0;
}
.score-row:last-child { border-bottom: none; }
.score-label { font-size: 15px; color: var(--text-dark); }
.score-value { font-size: 16px; font-weight: 600; color: var(--text-dark); }
.score-level {
    display: inline-block; margin-left: 10px; padding: 3px 12px;
    border-radius: 2px; font-size: 11px; font-weight: 500;
    letter-spacing: 0.05em; text-transform: uppercase;
}
.score-level-low { background: #e8f0e8; color: #2d5a2d; }
.score-level-medium { background: #f5f0e0; color: #6b5c1a; }
.score-level-high { background: #f5e5e5; color: #6b2c2c; }

/* Small hint next to intro-form labels (e.g. "(необязательно)") */
.intro-hint {
    color: var(--text-muted);
    font-size: 11px;
    font-style: italic;
    margin-left: 4px;
    font-weight: normal;
}

/* Compact big-number ρ cell inside /admin/tests table */
.rho-cell {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 3px;
    letter-spacing: 0.02em;
    line-height: 1;
}
.rho-cell-low    { background: #e8f0e8; color: #2d5a2d; }
.rho-cell-medium { background: #f5f0e0; color: #6b5c1a; }
.rho-cell-high   { background: #f5e5e5; color: #6b2c2c; }

/* Hero block for burnout index (ρ) shown first, large, emphasised */
.score-rho-hero {
    text-align: center;
    padding: 24px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1.5px solid transparent;
}
.score-rho-hero-low    { background: #f0f7f0; border-color: #d0e8d0; }
.score-rho-hero-medium { background: #faf5e8; border-color: #e8dcb8; }
.score-rho-hero-high   { background: #faeaea; border-color: #e8c5c5; }
.score-rho-label {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.score-rho-value {
    font-family: var(--font-heading);
    font-size: 64px;
    font-weight: 400;
    line-height: 1;
    color: var(--text-dark);
    letter-spacing: 0.02em;
}
.score-rho-hero-high .score-rho-value   { color: #6b2c2c; }
.score-rho-hero-medium .score-rho-value { color: #6b5c1a; }
.score-rho-hero-low .score-rho-value    { color: #2d5a2d; }
.score-rho-level {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-dark);
}
.score-rho-hint {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}
.program-text {
    white-space: pre-wrap; font-size: 15px; line-height: 1.7;
    color: var(--text-dark); padding: 4px 0;
}

/* --- Admin: answers-per-question view on test detail --- */
.answers-section {
    border: 1px solid #ece6e3; border-radius: 2px;
    margin-bottom: 10px; background: #fff;
}
.answers-section:last-child { margin-bottom: 0; }
.answers-section > summary {
    padding: 12px 16px; cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-body); font-size: 14px;
    letter-spacing: 0.02em; color: var(--text-dark);
    user-select: none;
}
.answers-section > summary::-webkit-details-marker { display: none; }
.answers-section > summary::before {
    content: '▸'; display: inline-block; margin-right: 10px;
    color: var(--accent); font-size: 12px;
    transition: transform 0.2s;
}
.answers-section[open] > summary::before { transform: rotate(90deg); }
.answers-section > summary:hover { background: var(--bg-warm); }
.answers-title { flex: 1; font-weight: 500; }
.answers-count {
    font-size: 12px; color: var(--text-muted);
    background: var(--bg-warm); padding: 2px 10px; border-radius: 2px;
    letter-spacing: 0.05em;
}
.answers-list {
    padding: 4px 16px 12px;
    border-top: 1px solid #ece6e3;
}
.answer-row {
    display: grid; grid-template-columns: 32px 1fr auto;
    gap: 12px; align-items: baseline;
    padding: 10px 0; border-bottom: 1px solid #f5f1f0;
    font-size: 14px;
}
.answer-row:last-child { border-bottom: none; }
.answer-num { color: var(--text-muted); font-size: 13px; text-align: right; }
.answer-text { color: var(--text-dark); line-height: 1.5; }
.answer-choice { white-space: nowrap; text-align: right; }
.answer-value {
    display: inline-block; min-width: 18px; padding: 2px 8px;
    background: var(--bg-dark); color: var(--text-light);
    border-radius: 2px; font-size: 12px; font-weight: 500;
    text-align: center;
}
.answer-label {
    color: var(--text-muted); font-size: 13px;
    font-style: italic; margin-left: 6px;
}
.answer-empty { color: var(--text-muted); }

/* --- Expert notes on dialog review --- */
.notes-label {
    display: block; margin-bottom: 8px;
    font-size: 13px; color: var(--text-dark);
    letter-spacing: 0.02em;
}
.notes-hint {
    color: var(--text-muted); font-size: 12px;
    font-style: italic; margin-left: 4px;
}
.notes-textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid #d5cdc9; border-radius: 2px;
    font-family: var(--font-body); font-size: 14px;
    letter-spacing: 0.01em; line-height: 1.5;
    color: var(--text-dark); background: #fff;
    outline: none; resize: vertical;
    transition: border-color 0.3s;
}
.notes-textarea:focus { border-color: var(--accent); }
.notes-textarea::placeholder {
    color: #b0bab9; font-style: italic;
}

/* --- Prompt editor textarea --- */
.prompt-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d5cdc9;
    border-radius: 2px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-dark);
    background: #fff;
    outline: none;
    resize: vertical;
    min-height: 400px;
    transition: border-color 0.3s;
}
.prompt-textarea:focus { border-color: var(--accent); }

/* =========================================================
   LANDING PAGE v2 — full-width layout per client visual
   ========================================================= */

.page-landing {
    background: var(--bg-warm);
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Site header */
.site-header {
    background: var(--bg-warm);
    border-bottom: 1px solid rgba(32,47,46,0.06);
    padding: 20px 48px;
}
.site-header-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    gap: 24px;
}
.logo {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: var(--text-dark);
}
.logo-mark { width: 44px; height: 44px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name {
    font-family: var(--font-heading);
    font-size: 22px; font-weight: 400;
    letter-spacing: 0.04em;
}
.logo-tagline {
    font-size: 11px; color: var(--text-muted);
    letter-spacing: 0.03em; font-style: italic;
    margin-top: 2px;
}
.header-right { display: flex; align-items: center; }
.header-privacy {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: 24px;
    padding: 8px 16px;
    font-size: 12px; color: var(--text-dark);
    line-height: 1.3;
    box-shadow: 0 1px 6px rgba(32,47,46,0.06);
}
.header-privacy-icon { color: var(--accent); font-size: 15px; }

/* Hero section */
.hero {
    max-width: 1280px; margin: 0 auto;
    padding: 40px 48px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: 52px; font-weight: 400;
    color: var(--text-dark);
    line-height: 1.1;
    letter-spacing: 0.02em;
    margin-bottom: 22px;
}
.hero-description {
    font-size: 16px;
    /* Darker than var(--text-muted) so it's actually readable against
       the warm beige background — per client feedback. */
    color: #3d4e4c;
    line-height: 1.65;
    margin-bottom: 26px;
    max-width: 480px;
    font-weight: 500;
}
.hero-trust {
    display: flex; gap: 14px; flex-wrap: wrap;
}
.trust-pill {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 64px;
}
.trust-pill-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(90,122,120,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: var(--accent);
}
.trust-pill > span:last-child {
    font-size: 11px; color: var(--text-muted);
    letter-spacing: 0.02em;
}
.hero-right {
    text-align: center;
    position: relative;
    /* Let the image visually flow under the title on the left.
       On desktop this creates a subtle overlap with the hero text. */
    margin-left: -60px;
}
.hero-image {
    /* Make the picture bigger and feather its edges with a radial mask
       so the JPEG rectangle disappears into the page background.
       Client asked: "by edges — blur, borders not visible, can go
       under the heading". mix-blend-mode helps multiply onto the warm
       beige so white frame pixels blend away. */
    width: 620px; max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    mix-blend-mode: multiply;
    -webkit-mask-image: radial-gradient(ellipse 75% 75% at center, black 55%, transparent 95%);
            mask-image: radial-gradient(ellipse 75% 75% at center, black 55%, transparent 95%);
}

/* CTA grid: two side-by-side cards */
.cta-grid {
    max-width: 1280px; margin: 0 auto;
    padding: 0 48px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.cta-card {
    border-radius: 8px;
    padding: 28px 30px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 12px rgba(32,47,46,0.06);
    min-height: 260px;
}
.cta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(32,47,46,0.1);
}
.cta-card-primary {
    background: var(--bg-dark);
    color: var(--text-light);
}
.cta-card-secondary {
    background: #fff;
    color: var(--text-dark);
    border: 1px solid #ece6e3;
}
.cta-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}
.cta-icon-light { background: rgba(255,255,255,0.1); color: var(--text-light); }
.cta-icon-dark { background: var(--bg-warm); color: var(--text-dark); }
.cta-title {
    font-family: var(--font-heading);
    font-size: 22px; font-weight: 400;
    color: var(--text-light);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}
.cta-title-dark {
    font-family: var(--font-heading);
    font-size: 22px; font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}
.cta-description {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.55;
    margin-bottom: 22px;
    flex: 1;  /* push button to the bottom */
}
.cta-description-dark {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 22px;
    flex: 1;
}
.cta-button {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 22px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    align-self: flex-start;  /* don't stretch across full card width */
}
.cta-button-light {
    background: #a8c0a6;
    color: var(--bg-dark);
}
.cta-button-outline {
    background: #fff;
    border: 1px solid var(--accent);
    color: var(--text-dark);
}
.cta-arrow { font-size: 14px; font-weight: 400; }

/* Features section */
.features {
    max-width: 1184px;  /* 1280 - 2×48 */
    margin: 0 auto 24px;
    padding: 20px 48px 32px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 12px rgba(32,47,46,0.04);
    box-sizing: border-box;
}
.features-title {
    font-family: var(--font-heading);
    font-size: 22px; font-weight: 400;
    color: var(--text-dark);
    text-align: center;
    margin: 20px 0 26px;
    letter-spacing: 0.04em;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    padding: 0 16px 16px;
}
.feature-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; text-align: center;
}
.feature-icon-svg {
    width: 42px; height: 42px;
    color: var(--accent);
    display: block;
}
.feature-label {
    font-size: 12px; color: var(--text-dark);
    line-height: 1.35;
    letter-spacing: 0.02em;
}

/* Wellbeing / shield footer */
.wellbeing {
    max-width: 1184px;  /* 1280 - 2×48, matches other sections */
    margin: 0 auto;     /* center horizontally */
    padding: 36px 48px;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 32px;
    align-items: center;
    background: var(--bg-dark);
    background-image: linear-gradient(135deg, var(--bg-dark) 0%, #1a2625 100%);
    border-radius: 10px;
    color: var(--text-light);
    box-sizing: border-box;
}
.wellbeing-shield {
    display: flex; justify-content: center; align-items: center;
    min-width: 0;  /* allow flex item to shrink if needed */
}
.shield-icon-svg {
    width: 160px;
    height: 160px;
    max-width: 100%;
    display: block;
}
.wellbeing-title {
    font-family: var(--font-heading);
    font-size: 24px; font-weight: 400;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    color: var(--text-light);
}
.wellbeing-description {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin-bottom: 20px;
}
.wellbeing-footer {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 8px;
}
.wellbeing-lock-svg {
    width: 22px; height: 22px;
    flex-shrink: 0; margin-top: 2px;
}
.wellbeing-footer-text {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
}
.wellbeing-signature {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-style: italic;
    text-align: right;
    letter-spacing: 0.03em;
}

/* Mobile landing */
@media (max-width: 820px) {
    .site-header { padding: 16px 18px; }
    .site-header-inner { flex-wrap: wrap; }
    .header-privacy { font-size: 10px; padding: 6px 12px; }
    .hero {
        grid-template-columns: 1fr;
        padding: 20px 18px;
        gap: 20px;
        text-align: left;
    }
    .hero-title { font-size: 32px; margin-bottom: 14px; }
    .hero-description { font-size: 14px; margin-bottom: 18px; }
    .hero-trust { gap: 8px; justify-content: space-between; }
    .trust-pill { min-width: 52px; }
    .hero-image { width: 100%; max-width: 420px; }
    .hero-right { margin-left: 0; }  /* no desktop overlap on mobile */
    .cta-grid {
        grid-template-columns: 1fr;
        padding: 0 18px 20px;
    }
    .features {
        margin-left: 18px; margin-right: 18px;
        padding: 14px 10px;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .wellbeing {
        grid-template-columns: 1fr;
        margin: 0 18px;
        padding: 24px 22px;
        gap: 18px;
    }
    .shield-icon-svg { width: 100px; height: 100px; }
    .wellbeing-title { font-size: 20px; }
    .wellbeing-signature { text-align: left; }
}

/* =========================================================
   CHAT PAGE v2 — new header with logo + bottom nav
   ========================================================= */

.chat-page {
    max-width: 640px; margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-warm);
    display: flex; flex-direction: column;
    box-shadow: 0 0 24px rgba(32,47,46,0.04);
}

.chat-header-v2 {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px;
    background: #fff;
    border-bottom: 1px solid #ece6e3;
    gap: 12px;
}
.chat-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text-dark);
}
.chat-logo-mark { width: 38px; height: 38px; flex-shrink: 0; }
.chat-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.chat-logo-name {
    font-family: var(--font-heading);
    font-size: 17px; font-weight: 400;
    letter-spacing: 0.03em;
}
.chat-logo-tagline {
    font-size: 10px; color: var(--text-muted);
    font-style: italic; letter-spacing: 0.02em;
    margin-top: 1px;
}
.chat-header-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: var(--bg-warm);
    border-radius: 16px;
    font-size: 10px; color: var(--text-dark);
    line-height: 1.2; flex-shrink: 0;
}
.chat-header-badge-icon { color: var(--accent); font-size: 13px; }

/* Bottom navigation with 4 actions */
.chat-bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;
    border-top: 1px solid #ece6e3;
    padding: 8px 0;
    flex-shrink: 0;
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 6px; gap: 4px;
    border: none; background: none;
    text-decoration: none; color: var(--text-muted);
    font-family: var(--font-body);
    cursor: pointer;
    border-right: 1px solid #f0ebe8;
    transition: color 0.2s;
}
.bottom-nav-item:last-child { border-right: none; }
.bottom-nav-item:hover { color: var(--accent); }
.bottom-nav-item.active { color: var(--text-dark); }
.bottom-nav-item.active .bottom-nav-icon {
    background: var(--bg-dark);
    color: var(--text-light);
}
.bottom-nav-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-warm);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
}
.bottom-nav-label {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-dark);
    letter-spacing: 0.02em;
}
.bottom-nav-sub {
    font-size: 10px;
    line-height: 1.3;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.01em;
}

/* chat-messages inside new chat-page must flex-grow */
.chat-page .chat-messages {
    flex: 1;
    min-height: 400px;
    padding: 22px;
}
.chat-page .chat-input-area {
    border-top: 1px solid #ece6e3;
    background: #fff;
}
.chat-page .typing-indicator {
    background: #fff;
    border-top: 1px solid transparent;
}

/* --- Legacy (still used by admin + captcha flows) --- */
.landing-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh; padding: 24px;
    background: var(--bg-dark);
    background-image: linear-gradient(135deg, var(--bg-dark) 0%, #1a2625 100%);
}
.landing-card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 4px; padding: 56px 48px;
    max-width: 520px; width: 100%;
    box-shadow: 0 4px 40px rgba(0,0,0,0.15);
    text-align: center;
}
.landing-title {
    font-family: var(--font-heading);
    font-size: 38px; font-weight: 400;
    color: var(--text-dark); letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.landing-subtitle {
    font-size: 15px; color: var(--accent);
    letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 28px;
}
.landing-description {
    color: var(--text-muted); font-size: 14px;
    line-height: 1.6; margin-bottom: 24px;
}
.landing-trust {
    display: flex; justify-content: space-around; align-items: flex-start;
    gap: 12px; margin-bottom: 28px; padding: 14px 0;
    border-top: 1px solid #ece6e3;
    border-bottom: 1px solid #ece6e3;
}
.landing-trust-item {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; flex: 1;
}
.landing-trust-icon { font-size: 18px; color: var(--accent); }
.landing-trust-label {
    font-size: 11px; color: var(--text-muted);
    letter-spacing: 0.04em; text-align: center;
    line-height: 1.2;
}
.landing-buttons {
    display: flex; flex-direction: column; gap: 14px;
    margin-bottom: 32px;
}
.landing-btn {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 24px; border-radius: 3px;
    text-decoration: none; transition: all 0.25s;
    text-align: left;
}
.landing-btn-primary {
    background: var(--bg-dark); color: var(--text-light);
    border: 1px solid var(--border-light);
}
.landing-btn-primary:hover { background: var(--accent); }
.landing-btn-secondary {
    background: #fff; color: var(--text-dark);
    border: 1px solid #d5cdc9;
}
.landing-btn-secondary:hover { border-color: var(--accent); background: var(--bg-warm); }
.landing-btn-icon { font-size: 28px; flex-shrink: 0; }
.landing-btn-label {
    font-size: 16px; font-weight: 500;
    letter-spacing: 0.02em; display: block;
}
.landing-btn-desc {
    font-size: 12px; opacity: 0.7;
    display: block; margin-top: 2px;
}
.landing-footer {
    color: var(--text-muted); font-size: 11px;
    letter-spacing: 0.02em; line-height: 1.5;
    font-style: italic;
}
.result-footer {
    text-align: center; color: var(--text-muted); font-size: 13px;
    padding: 16px; font-style: italic;
}

/* --- Intro form (name/age before test) --- */
.intro-form {
    display: flex; flex-direction: column; gap: 12px;
    max-width: 400px; margin: 0 auto; padding: 8px 0;
}
.intro-label {
    font-size: 13px; color: var(--text-muted);
    letter-spacing: 0.05em; text-transform: uppercase;
}
.intro-input {
    width: 100%; padding: 14px 18px; border: 1px solid #d5cdc9;
    border-radius: 2px; font-size: 16px;
    outline: none; transition: border-color 0.3s;
    font-family: var(--font-body); letter-spacing: 0.02em;
    background: #fff;
}
.intro-input:focus { border-color: var(--accent); }
