/* ===== BASE ===== */

* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #0f111c;
    color: white;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.4;
}

a {
    color: #6b6cff;
    text-decoration: none;
}

a:hover {
    color: #5758ff;
}

/* ===== LAYOUT ===== */

.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
}

/* ===== BUTTONS ===== */

button {
    padding: 12px 20px;
    border: none;
    background: #6b6cff;
    color: white;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #5758ff;
}

.primary-btn {
    display: block;
    margin-top: 25px;
    padding: 14px;
    background: #222;
    color: white;
    border-radius: 10px;
    text-align: center;
}

.primary-btn:hover {
    background: #000;
}

/* ===== LOGIN ===== */

.login-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: #151824;
    padding: 35px;
    width: 100%;
    max-width: 360px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.6);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 25px;
}

.login-card input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: none;
    background: #1f2233;
    color: white;
}

.login-card input::placeholder {
    color: #aaa;
}

.login-card input:focus {
    outline: 2px solid #6b6cff;
}

.login-card button {
    width: 100%;
}

/* ===== TOPBAR ===== */

.topbar {
    background: #151824;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.back-btn {
    color: white;
}

.logout-btn {
    background: none;
    border: 1px solid #6b6cff;
    color: #6b6cff;
    padding: 8px 14px;
    border-radius: 6px;
}

.logout-btn:hover {
    background: #6b6cff;
    color: white;
}

/* ===== TESTS ===== */

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 20px;
}

.test-card {
    background: #1a1d2b;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    color: white;
    
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* ключевое */
    min-height: 160px; /* можно подстроить */
}

.test-card button {
    width: 100%;
}

/* ===== BADGES ===== */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
}

.passed { background: #6b6cff; }
.closed { background: #d9534f; }
.locked { background: #6c757d; }

/* ===== QUESTION ===== */

.timer {
    font-size: 20px;
    text-align: right;
    color: #6b6cff;
}

.question-card {
    background: #1a1d2b;
    border-radius: 12px;
    padding: 25px;
}

.question-text {
    margin-bottom: 20px;
    font-size: 20px;
}

.options label {
    display: block;
    background: #252938;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
}

.options label:hover {
    background: #3a3f5c;
}

.submit-btn {
    margin-top: 20px;
}

/* ===== MEDIA ===== */

.media {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

.media img {
    max-width: 480px;
    max-height: 480px;
    border-radius: 10px;
}

/* ===== RESULT ===== */

.result-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.result-card {
    max-width: 420px;
    background: #222;
    border-radius: 14px;
    padding: 25px;
    text-align: center;
}

.score-box {
    font-size: 28px;
    font-weight: bold;
    padding: 15px;
    border-radius: 10px;
}

.success {
    font-size: 20px;
    color: #6b6cff;
}

.error-box {
    background-color: #ffe6e6;
    color: #c62828;
    padding: 10px;
    border-radius: 8px;
}

/* ===== ADMIN ===== */

.admin-page {
    background:#f4f6f9;
    color:#222;
}

.admin-page .card,
.admin-page .students-table,
.admin-page .admin-card {
    background:white;
    color:#222;
}

.admin-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
    margin-top:25px;
}

.admin-card {
    border-radius:14px;
    padding:35px;
    box-shadow:0 10px 30px rgba(0,0,0,.1);
}

.admin-card:hover {
    transform:translateY(-4px);
}

/* ===== TABLE ===== */

.students-table {
    width:100%;
    border-collapse:collapse;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 4px 12px rgba(0,0,0,.08);
}

.students-table th {
    background:#f3f4f6;
    padding:14px;
    text-align:left;
}

.students-table td {
    padding:12px;
    border-top:1px solid #eee;
}

.students-table tr:hover {
    background:#f9fafb;
}

/* ===== COURSE SWITCH ===== */

.course-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.course-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: #e9ecef;
    color: #333;
}

.course-btn:hover {
    background: #dee2e6;
}

.course-btn.active {
    background: #6b6cff;
    color: white;
}

/* ===== RATING BUTTON ===== */

.rating-btn {
    background: #6b6cff;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
}

.rating-btn:hover {
    background: #5758ff;
}

/* ===== MOBILE ===== */

@media(max-width:700px){
    .students-table th:nth-child(2),
    .students-table td:nth-child(2){
        display:none;
    }
}
ul {
    list-style: none;
    padding: 0;
}

li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border-bottom: 1px solid #eee;
}
li button {
    white-space: nowrap;
}
.test-info {
    display: flex;
    flex-direction: column;
}

.test-title {
    font-weight: 600;
}

.test-status {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}
.admin-tests {
    margin-top: 20px;
}

.admin-test-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
