/* ============================================================
   Судебный полигон — стили
   Палитра: изумрудный #1F5C3D + салатовый #B5F0B5 + нейтрали
   ============================================================ */

:root {
    --primary: #1F5C3D;
    --primary-dark: #164429;
    --accent: #B5F0B5;
    --accent-soft: #E5F8E5;
    --bg: #FAFBF9;
    --bg-alt: #F2F6F1;
    --text: #1A1A1A;
    --text-muted: #5A5A5A;
    --border: #D8E0D5;
    --danger: #B33A3A;
    --danger-soft: #F8E5E5;
    --success: #1F5C3D;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(31,92,61,0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

/* === HEADER === */
.site-header {
    background: rgba(250,251,249,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark { font-size: 24px; color: var(--primary); }
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 28px; }
.nav a { color: var(--text-muted); text-decoration: none; font-size: 15px; transition: color 0.15s; }
.nav a:hover { color: var(--primary); }

/* === HERO === */
.hero { padding: 80px 0 64px; text-align: center; background: linear-gradient(180deg, var(--bg) 0%, var(--accent-soft) 100%); }
.hero-badge { display: inline-block; background: var(--accent); color: var(--primary-dark); padding: 5px 12px; border-radius: 100px; font-size: 13px; font-weight: 600; margin-bottom: 24px; }
.hero-title { font-size: 52px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; margin-bottom: 20px; }
.hero-title .accent { color: var(--primary); }
.hero-subtitle { font-size: 19px; color: var(--text-muted); max-width: 620px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 640px; margin: 0 auto; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* === BUTTONS === */
.btn { display: inline-block; padding: 14px 26px; border-radius: var(--radius); font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: all 0.15s; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* === SECTIONS === */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; text-align: center; }
.section-subtitle { font-size: 17px; color: var(--text-muted); text-align: center; margin-bottom: 48px; }

/* === SCENARIOS GRID === */
.scenarios-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.scenario-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s;
    display: flex; flex-direction: column;
}
.scenario-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.scenario-meta { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.scenario-tag { background: var(--accent-soft); color: var(--primary-dark); padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.scenario-tag.difficulty { background: #FFF3D6; color: #8A5A00; }
.scenario-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.scenario-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; flex: 1; }
.scenario-actions { display: flex; gap: 10px; }
.scenario-actions .btn { padding: 10px 18px; font-size: 14px; }

.loading, .empty, .error-msg { text-align: center; padding: 40px; color: var(--text-muted); }
.error-msg { color: var(--danger); }

/* === STEPS === */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--primary-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 14px; }

/* === FOOTER === */
.site-footer { background: var(--text); color: #C8C8C8; padding: 56px 0 24px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer .logo { color: #fff; margin-bottom: 12px; }
.site-footer .logo-mark { color: var(--accent); }
.footer-desc { font-size: 14px; color: #888; max-width: 320px; }
.site-footer h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #C8C8C8; text-decoration: none; font-size: 14px; transition: color 0.15s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid #333; padding-top: 24px; text-align: center; font-size: 13px; color: #777; }

/* === SESSION SCREEN === */
.session-container { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.session-header { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px; }
.session-scenario-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.session-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.session-situation { background: var(--accent-soft); border-left: 4px solid var(--primary); padding: 20px; border-radius: 8px; }
.session-situation h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-dark); margin-bottom: 8px; }
.session-situation p { color: var(--text); line-height: 1.7; }

.actions-list { margin: 24px 0; }
.action-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; }
.action-item .action-kind { display: inline-block; background: var(--accent-soft); color: var(--primary-dark); padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase; margin-bottom: 6px; }
.action-item .action-text { font-size: 15px; line-height: 1.5; }
.action-item .action-time { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.action-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-top: 24px; }
.action-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.action-form textarea { width: 100%; min-height: 120px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 15px; resize: vertical; }
.action-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.action-form .form-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.action-form select { padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 14px; background: #fff; }
.action-form .form-info { font-size: 13px; color: var(--text-muted); margin-left: auto; }

.analyze-block { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 24px; margin-top: 24px; text-align: center; }
.analyze-block h3 { font-size: 20px; margin-bottom: 8px; }
.analyze-block p { color: var(--text-muted); margin-bottom: 20px; }

/* === RESULT SCREEN === */
.result-container { max-width: 900px; margin: 40px auto; padding: 0 20px; }
.result-score-block { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: var(--radius-lg); padding: 48px; text-align: center; margin-bottom: 24px; }
.result-score { font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.result-score-label { font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; margin-top: 8px; }
.result-feedback { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px; }
.result-feedback h3 { font-size: 18px; margin-bottom: 12px; }
.result-feedback p { color: var(--text); line-height: 1.7; white-space: pre-wrap; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.result-action-block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.result-action-block.missed { background: var(--danger-soft); border-color: #E8B8B8; }
.result-action-block h4 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.result-action-block ul { list-style: none; }
.result-action-block li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 1.5; }
.result-action-block li:last-child { border-bottom: none; }
.result-action-block .icon { font-size: 18px; }
.result-usage { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 24px; padding: 12px; background: var(--bg-alt); border-radius: var(--radius); }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === MOBILE === */
@media (max-width: 768px) {
    .hero { padding: 56px 0 40px; }
    .hero-title { font-size: 34px; }
    .hero-subtitle { font-size: 16px; }
    .hero-stats { grid-template-columns: 1fr; gap: 16px; }
    .section { padding: 56px 0; }
    .section-title { font-size: 28px; }
    .steps, .footer-grid, .result-actions { grid-template-columns: 1fr; }
    .nav { display: none; }
    .result-score { font-size: 64px; }
}
