:root{
    --red:#c62828;
    --red-dark:#8e0000;
    --blue:#1565c0;
    --green:#2e7d32;
    --orange:#f59e0b;
    --bg:#f4f6f9;
    --card:#ffffff;
    --text:#1f2937;
    --muted:#6b7280;
    --border:#dfe3ea;
    --shadow:0 12px 30px rgba(15,23,42,.08);
}

*{box-sizing:border-box}

body{
    margin:0;
    background:
        radial-gradient(circle at top left, rgba(198,40,40,.10), transparent 32%),
        var(--bg);
    font-family:Segoe UI, Arial, sans-serif;
    color:var(--text);
}

.container{
    max-width:1200px;
    margin:auto;
    padding:20px;
}

.site-header{
    background:linear-gradient(135deg,var(--red),var(--red-dark));
    color:white;
    box-shadow:0 2px 12px rgba(0,0,0,.18);
}

.header-inner{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:15px;
}

.logo{
    color:white;
    text-decoration:none;
    font-size:28px;
    font-weight:800;
}

.subtitle{
    font-size:14px;
    opacity:.9;
}

.main-nav{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.main-nav a{
    color:white;
    text-decoration:none;
    font-weight:700;
    padding:9px 12px;
    border-radius:999px;
}

.main-nav a:hover,
.main-nav a.active{
    background:rgba(255,255,255,.18);
}

.hero{
    background:linear-gradient(135deg,#ffffff,#fff7f7);
    border:1px solid var(--border);
    border-radius:26px;
    padding:30px;
    margin:22px 0;
    box-shadow:var(--shadow);
}

.hero h1{
    margin:14px 0 8px;
    font-size:34px;
}

.topline{
    display:flex;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    align-items:center;
}

.badge,
.pill{
    display:inline-flex;
    align-items:center;
    gap:6px;
    background:#fff1f1;
    color:var(--red);
    padding:8px 12px;
    border-radius:999px;
    font-size:14px;
    font-weight:800;
}

.pill{
    background:#eef2ff;
    color:#3730a3;
    margin-left:8px;
    font-size:12px;
}

.card{
    background:white;
    border:1px solid var(--border);
    border-radius:22px;
    padding:22px;
    box-shadow:var(--shadow);
}

.login-card{margin-bottom:20px}

.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr 1fr auto;
    gap:12px;
    align-items:end;
}

label{
    display:block;
    margin-bottom:5px;
    font-weight:700;
}

input{
    width:100%;
    padding:12px;
    border:1px solid #ccc;
    border-radius:12px;
}

.btn,
button{
    background:var(--red);
    color:white;
    border:none;
    border-radius:14px;
    padding:12px 18px;
    cursor:pointer;
    text-decoration:none;
    display:inline-block;
    font-weight:800;
    font-size:15px;
}

.btn:hover,
button:hover{
    opacity:.92;
}

.secondary{
    background:#546e7a;
}

.section{
    margin:25px 0;
}

.notice{
    background:#fff8e1;
    border-left:6px solid #ffb300;
    padding:16px;
    border-radius:14px;
}

.grid.three{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
    gap:20px;
}

.catalog{
    display:flex;
    flex-direction:column;
}

.catalog-head{
    display:flex;
    gap:15px;
    align-items:center;
}

.icon{
    font-size:42px;
}

.meta{
    font-size:14px;
    color:var(--muted);
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.progress{
    height:14px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
    margin:15px 0;
}

.progress span{
    display:block;
    height:100%;
    background:linear-gradient(90deg,var(--green),#4caf50);
}

.stats{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
}

.stat{
    background:#f9fafb;
    border:1px solid var(--border);
    border-radius:18px;
    padding:15px;
    text-align:center;
}

.stat b{
    display:block;
    font-size:26px;
}

.stat span{
    color:var(--muted);
    font-size:13px;
}

.question{
    margin-bottom:20px;
    position:relative;
    overflow:hidden;
}

.question::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    width:6px;
    height:100%;
    background:linear-gradient(var(--red),var(--red-dark));
}

.question h3{
    margin:0 0 18px 0;
    font-size:22px;
    line-height:1.35;
    padding-left:8px;
}

.answers{
    display:grid;
    gap:12px;
}

.answer{
    display:flex;
    align-items:flex-start;
    gap:12px;
    background:#f9fafb;
    border:1px solid var(--border);
    border-radius:16px;
    padding:15px;
    margin-bottom:0;
    transition:.15s ease;
}

label.answer{
    cursor:pointer;
}

label.answer:hover{
    border-color:var(--red);
    background:#fff7f7;
    transform:translateY(-1px);
}

.answer input{
    width:auto;
    margin-top:3px;
    accent-color:var(--red);
    transform:scale(1.2);
}

.answer.correct{
    background:#ecfdf5;
    border-color:#22c55e;
}

.answer.wrong{
    background:#fef2f2;
    border-color:#ef4444;
}

.answer.missed{
    background:#fffbeb;
    border-color:#f59e0b;
}

.footer-actions{
    margin-top:20px;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.site-footer{
    margin-top:40px;
    background:#1f2937;
    color:white;
    padding:30px 0;
}

.site-footer a{
    color:white;
    text-decoration:none;
    margin-right:15px;
}

.site-footer a:hover{
    text-decoration:underline;
}

.userbar{
    margin-top:20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
}

.muted{color:var(--muted)}
.small{font-size:14px}

@media(max-width:900px){
    .form-grid,
    .stats{
        grid-template-columns:1fr;
    }

    .header-inner{
        flex-direction:column;
        align-items:flex-start;
    }

    .hero h1{
        font-size:28px;
    }
}

.question-meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:14px;
    padding-left:8px;
}

.question-meta span{
    display:inline-flex;
    background:#f1f5f9;
    color:#475569;
    border:1px solid #e2e8f0;
    border-radius:999px;
    padding:6px 10px;
    font-size:12px;
    font-weight:800;
}

.answer-list{
    gap:14px;
}

.option-card{
    display:grid;
    grid-template-columns:32px 42px 1fr auto;
    align-items:center;
    gap:12px;
    padding:16px 18px;
}

.option-check{
    width:22px;
    height:22px;
    margin:0;
    accent-color:var(--red);
}

.option-letter{
    width:38px;
    height:38px;
    border-radius:12px;
    background:#eef2f7;
    color:#334155;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
    font-size:16px;
    flex-shrink:0;
}

.option-text{
    line-height:1.45;
    font-size:16px;
}

.option-state{
    font-size:22px;
    width:32px;
    text-align:center;
}

.option-result{
    font-size:13px;
    font-weight:800;
    color:var(--muted);
    white-space:nowrap;
}

label.option-card:hover .option-letter{
    background:#ffe4e6;
    color:var(--red);
}

.answer.correct .option-letter{
    background:#dcfce7;
    color:#166534;
}

.answer.wrong .option-letter{
    background:#fee2e2;
    color:#991b1b;
}

.answer.missed .option-letter{
    background:#fef3c7;
    color:#92400e;
}

@media(max-width:700px){
    .option-card{
        grid-template-columns:30px 38px 1fr;
    }

    .option-result{
        grid-column:3;
        white-space:normal;
    }
}