/* Бурение Сервис — Академия обучения. Локальные стили (без внешних CDN).
   Тёмная индустриальная тема: графит + янтарный. */

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

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    background-color: #0b0f17;
    background-image:
        linear-gradient(rgba(148,163,184,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148,163,184,.05) 1px, transparent 1px);
    background-size: 42px 42px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #cbd5e1;
    font-size: 15px;
}

.container { width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 16px; }
.main { flex-grow: 1; padding: 32px 0; }

/* --- Навигация --- */
.nav {
    background: rgba(18,25,38,.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #253043;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.nav-brand { display: flex; align-items: center; gap: 12px; }
.logo {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    display: flex; align-items: center; justify-content: center;
    color: #0b0f17; font-weight: 900; font-size: 18px;
    box-shadow: 0 4px 12px rgba(245,158,11,.3);
}
.brand-name { font-weight: 700; font-size: 17px; color: #f8fafc; line-height: 1.15; }
.brand-sub { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-user { text-align: right; }
.nav-user-label { font-size: 11px; color: #64748b; }
.nav-user-name { font-weight: 700; color: #e2e8f0; text-transform: capitalize; }
.btn-logout {
    background: rgba(244,63,94,.12); color: #fb7185; border: 1px solid rgba(244,63,94,.25);
    padding: 8px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
    text-decoration: none; transition: .2s;
}
.btn-logout:hover { background: rgba(244,63,94,.2); }

/* --- Карточки --- */
.card {
    background: #121926; border: 1px solid #253043; border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35); padding: 28px;
}
.card-hero {
    background: linear-gradient(120deg, #1e293b, #111827);
    border: 1px solid #334155; color: #fff; border-radius: 20px; padding: 28px;
    box-shadow: 0 12px 30px rgba(0,0,0,.4);
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    position: relative; overflow: hidden;
}
.card-hero::before {
    content: ""; position: absolute; inset: 0; opacity: .18;
    background: radial-gradient(circle at 85% 20%, rgba(245,158,11,.5), transparent 55%);
}
.card-hero > * { position: relative; }
.badge {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.badge-light { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.35); }
.badge-indigo { background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.35); }
.badge-emerald { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.35); }
.badge-rose { background: rgba(244,63,94,.15); color: #fb7185; border: 1px solid rgba(244,63,94,.35); }

h1 { font-size: 26px; font-weight: 800; color: #f8fafc; }
h2 { font-size: 20px; font-weight: 800; color: #f8fafc; }
h3 { font-size: 17px; font-weight: 700; color: #f8fafc; }
.muted { color: #94a3b8; }
.small { font-size: 12px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.bold { font-weight: 700; }

/* --- Кнопки --- */
.btn {
    display: inline-block; border: none; cursor: pointer; text-decoration: none;
    padding: 13px 22px; border-radius: 14px; font-size: 15px; font-weight: 700;
    text-align: center; transition: .2s; font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, #f59e0b, #f97316); color: #0b0f17;
    box-shadow: 0 8px 20px rgba(245,158,11,.28);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669); color: #022c22;
    box-shadow: 0 8px 20px rgba(16,185,129,.22);
}
.btn-success:hover { filter: brightness(1.08); }
.btn-ghost { background: #182233; color: #cbd5e1; border: 1px solid #334155; }
.btn-ghost:hover { background: #253043; }
.btn-danger-soft { background: rgba(244,63,94,.12); color: #fb7185; border: 1px solid rgba(244,63,94,.25); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 11px; }
.btn-block { display: block; width: 100%; }

/* --- Формы --- */
label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 6px; }
.input, .textarea, .select {
    width: 100%; background: #0b0f17; border: 1px solid #253043;
    padding: 12px 14px; border-radius: 12px; font-size: 15px; color: #e2e8f0;
    font-family: inherit; transition: .15s; outline: none;
}
.input:focus, .textarea:focus, .select:focus { background: #182233; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.input::placeholder, .textarea::placeholder { color: #475569; }
.textarea { min-height: 90px; resize: vertical; }
.select { cursor: pointer; }
.select option { background: #121926; color: #e2e8f0; }
.form-row { display: grid; gap: 12px; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }
.form-row-2 { grid-template-columns: 1fr 1fr; align-items: end; }
@media (max-width: 768px) { .form-row-4, .form-row-2 { grid-template-columns: 1fr; } }

/* --- Сетки --- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 768px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* --- Лестница категорий --- */
.step { border-radius: 20px; padding: 24px; position: relative; }
.step-done { background: rgba(16,185,129,.08); border: 2px solid rgba(16,185,129,.4); }
.step-current {
    background: linear-gradient(180deg, rgba(245,158,11,.14), rgba(245,158,11,.03));
    border: 2px solid #f59e0b; box-shadow: 0 12px 28px rgba(245,158,11,.12);
}
.step-locked { background: rgba(18,25,38,.6); border: 1px solid #253043; opacity: .6; }
.step-top { display: flex; justify-content: space-between; align-items: center; }
.step-num { font-size: 30px; font-weight: 900; }
.step-done .step-num { color: #34d399; }
.step-current .step-num { color: #fbbf24; }
.step-locked .step-num { color: #475569; }
.step-icon {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 16px;
}
.step-done .step-icon { background: #10b981; color: #022c22; box-shadow: 0 6px 14px rgba(16,185,129,.35); }
.step-current .step-icon { background: linear-gradient(135deg, #f59e0b, #f97316); color: #0b0f17; animation: pulse 1.8s infinite; }
.step-locked .step-icon { background: #182233; color: #64748b; }
.step-title { font-weight: 800; font-size: 17px; margin-top: 14px; }
.step-done .step-title { color: #6ee7b7; }
.step-current .step-title { color: #f8fafc; }
.step-locked .step-title { color: #64748b; }
.step-note { font-size: 12px; margin-top: 4px; }
.step-current .step-note { color: #d9a441; }
.step-locked .step-note { color: #475569; }
.step-badge {
    position: absolute; top: -12px; left: 24px;
    background: linear-gradient(135deg, #f59e0b, #f97316); color: #0b0f17;
    font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em;
    padding: 4px 12px; border-radius: 999px; box-shadow: 0 4px 10px rgba(245,158,11,.35);
}
.step-actions { display: flex; gap: 8px; margin-top: 16px; }
.step-actions .btn { flex: 1; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.5); } 50% { box-shadow: 0 0 0 10px rgba(245,158,11,0); } }

/* --- Материалы --- */
.material {
    background: rgba(18,25,38,.85); border: 1px solid #253043; border-radius: 20px;
    padding: 24px; margin-bottom: 16px; transition: .2s;
}
.material:hover { border-color: rgba(245,158,11,.4); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.material-num {
    width: 32px; height: 32px; border-radius: 10px; background: rgba(245,158,11,.15); color: #fbbf24;
    display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
}
.material h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: #f8fafc; }
.material .content { color: #94a3b8; white-space: pre-line; line-height: 1.65; padding-left: 42px; }

/* --- Алерты --- */
.alert { padding: 16px 20px; border-radius: 16px; font-size: 14px; font-weight: 600; margin-bottom: 20px; animation: fadeIn .4s ease; }
.alert-danger { background: rgba(244,63,94,.15); color: #fb7185; border: 1px solid rgba(244,63,94,.35); }
.alert-success { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.35); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* --- Тест --- */
.test-options { display: flex; flex-direction: column; gap: 14px; }
.option {
    display: flex; align-items: center; gap: 14px; padding: 16px;
    border: 2px solid #253043; border-radius: 16px; cursor: pointer;
    transition: .15s; background: #0b0f17;
}
.option:hover { border-color: #f59e0b; background: rgba(245,158,11,.06); }
.option.selected { border-color: #f59e0b; background: rgba(245,158,11,.1); }
.option input { width: 20px; height: 20px; accent-color: #f59e0b; flex-shrink: 0; }
.option span { font-weight: 500; color: #cbd5e1; }
.timer {
    display: flex; align-items: center; gap: 8px; color: #fbbf24;
    background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); padding: 10px 16px;
    border-radius: 16px; font-weight: 800; font-size: 16px;
}
.test-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid #253043; }
.question-text { font-size: 19px; font-weight: 700; color: #f1f5f9; line-height: 1.45; }
.question-img { margin-top: 14px; max-width: 100%; border-radius: 14px; border: 1px solid #253043; }
.big-percent { font-size: 52px; font-weight: 900; }

/* --- Результат --- */
.result-icon { font-size: 44px; margin-bottom: 14px; }
.result-box { max-width: 560px; margin: 40px auto 0; text-align: center; padding: 36px; }
.finish-box { border-radius: 16px; padding: 18px; margin: 18px 0; }
.finish-ok { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); }
.finish-ok p:first-child { color: #34d399; font-weight: 700; }
.finish-bad { background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.35); }
.finish-bad p:first-child { color: #fb7185; font-weight: 700; }

/* --- Админка --- */
.user-row { border: 1px solid #253043; border-radius: 20px; padding: 20px; background: rgba(11,15,23,.6); margin-bottom: 14px; }
.user-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.user-name { font-weight: 800; font-size: 17px; color: #f1f5f9; text-transform: capitalize; }
.user-meta { font-size: 12px; color: #64748b; margin-top: 4px; }
.user-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.percent { font-size: 20px; font-weight: 800; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 8px; border-radius: 10px; transition: .15s; color: #94a3b8; }
.icon-btn:hover { background: #182233; }
details.answers { margin-top: 16px; padding-top: 16px; border-top: 1px solid #253043; font-size: 14px; }
details.answers summary { cursor: pointer; color: #fbbf24; font-weight: 700; }
details.answers summary:hover { color: #f59e0b; }
.answer-item { border-radius: 14px; padding: 12px; margin-top: 8px; border: 1px solid; }
.answer-ok { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
.answer-bad { background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.3); color: #fda4af; }
.dropzone {
    border: 2px dashed #334155; border-radius: 14px; padding: 14px; text-align: center;
    cursor: pointer; transition: .15s; color: #94a3b8; font-size: 13px; font-weight: 500;
}
.dropzone:hover { border-color: #f59e0b; color: #fbbf24; }
.dropzone .file-name { font-size: 11px; color: #64748b; margin-top: 4px; }

/* --- Футер --- */
.footer { text-align: center; padding: 20px; font-size: 12px; color: #64748b; border-top: 1px solid #253043; background: rgba(18,25,38,.6); }

@media (max-width: 768px) {
    .card-hero { flex-direction: column; align-items: flex-start; }
    .nav-user { display: none; }
    .material .content { padding-left: 0; }
}
