/* ========== ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ ТЕСТОВ ========== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #f4f9f4, #e8f0e8);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

h1 {
    text-align: center;
    font-size: clamp(1.5em, 6vw, 2.2em);
    margin-bottom: 15px;
    word-break: break-word;
}

h2 {
    text-align: center;
    font-size: clamp(1.1em, 5vw, 1.4em);
    margin-top: 0;
    margin-bottom: 20px;
    word-break: break-word;
}

.back-link {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.back-link a {
    text-decoration: none;
    font-size: 16px;
    padding: 10px 22px;
    border: 2px solid;
    border-radius: 40px;
    transition: all 0.3s;
    display: inline-block;
    background: rgba(255,255,255,0.8);
    font-weight: 500;
    margin: 5px 0;
}

.back-link a:hover {
    background: #1e4a6b;
    color: white;
    border-color: #1e4a6b;
}

.auth-panel {
    background: white;
    border-radius: 24px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-top: 8px solid;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
}

.auth-field {
    flex: 1 1 250px;
}

.auth-field label {
    display: block;
    font-weight: bold;
    color: #024d6e;
    margin-bottom: 8px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-field input {
    width: 100%;
    height: 50px;
    font-size: 18px;
    padding: 0 20px;
    border: 2.5px solid #b8d3d9;
    border-radius: 30px;
    background: white;
}

.auth-field button {
    width: 100%;
    height: 50px;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-field button:active {
    transform: scale(0.97);
}

.user-info {
    background: linear-gradient(145deg, #d4eaf0, #c2dce3);
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-left: 8px solid;
    gap: 12px;
}

.user-info span {
    font-size: 18px;
    color: #024d6e;
}

.user-name {
    font-weight: bold;
    color: white;
    padding: 8px 18px;
    border-radius: 40px;
    display: inline-block;
}

.lesson {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    font-size: 18px;
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-left: 8px solid;
    line-height: 1.6;
}

.question {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.08);
}

.question h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
    text-align: left;
}

.options {
    margin-left: 5px;
    font-size: 18px;
}

.radio-square-container {
    display: block;
    position: relative;
    padding-left: 45px;
    margin-bottom: 18px;
    cursor: pointer;
    color: #1a4c5c;
    font-size: 18px;
    min-height: 30px;
}

.radio-square {
    position: absolute;
    top: 0;
    left: 0;
    height: 28px;
    width: 28px;
    background-color: #fff;
    border: 2.5px solid;
    border-radius: 8px;
    transition: all 0.15s;
}

.radio-square-container input:checked ~ .radio-square {
    background-color: #028090;
    border-color: #028090;
}

.radio-square:after {
    content: "";
    position: absolute;
    display: none;
    left: 9px;
    top: 4px;
    width: 7px;
    height: 14px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.radio-square-container input:checked ~ .radio-square:after {
    display: block;
}

input[type="radio"] {
    display: none;
}

button {
    padding: 16px 28px;
    color: white;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    font-size: 18px;
    margin: 8px 5px;
    font-weight: bold;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    transition: all 0.2s;
    min-width: 200px;
    max-width: 350px;
    width: calc(100% - 20px);
}

button:active:not(:disabled) {
    transform: scale(0.97);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.score-box {
    background: #e9f2f5;
    padding: 18px;
    border-radius: 20px;
    margin-top: 20px;
    font-size: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

input[readonly] {
    background-color: #f0f7fa;
    border: 2px solid #a0c0c5;
    color: #024d6e;
    font-weight: bold;
    text-align: center;
    max-width: 70px;
    height: 50px;
    font-size: 20px;
    border-radius: 30px;
    padding: 0 10px;
}

.test-blocked {
    filter: blur(2px) grayscale(40%);
    pointer-events: none;
    opacity: 0.6;
}

.block-message {
    background: linear-gradient(145deg, #fff3cd, #ffe69b);
    border: 2px solid #ffb74d;
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    font-size: 20px;
    color: #b3512b;
    font-weight: bold;
}

.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    z-index: 10000;
    text-align: center;
    max-width: 90%;
    width: 400px;
    background: white;
    border-top: 10px solid;
    animation: fadeIn 0.25s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.alert-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
}

.alert-message {
    font-size: 18px;
    margin-bottom: 25px;
    line-height: 1.5;
    white-space: pre-line;
}

.alert-button {
    padding: 16px 40px;
    color: white;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    width: 100%;
    max-width: 250px;
    border: none;
}

@media (max-width: 768px) {
    body { padding: 15px; }
    .auth-panel { padding: 20px; }
    .auth-field { flex: 1 1 100%; }
    .user-info { flex-direction: column; align-items: flex-start; }
    .back-link { flex-direction: column; }
    .back-link span { float: none !important; display: block; margin-top: 10px; }
    .radio-square-container { padding-left: 50px; }
    button { width: 100%; max-width: 100%; }
}