* {
    box-sizing: border-box;
}

/* Запрет выделения текста на страницах для студентов */
body.no-copy {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
body.no-copy input,
body.no-copy textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 1rem;
    background: #f0f2f5;
    color: #1a1a1a;
    line-height: 1.5;
}
.container {
    max-width: 720px;
    margin: 0 auto;
}
header {
    margin-bottom: 2rem;
}
header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 700;
}
.subtitle {
    margin: 0;
    color: #555;
}
.back-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #2563eb;
    text-decoration: none;
}
.back-link:hover {
    text-decoration: underline;
}

/* Cards on index */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.card {
    display: block;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.card-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}
.card h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
}
.card p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

/* Form */
#test-form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.student-info {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}
.student-info h2,
.part h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #333;
}
.student-info label {
    display: block;
    margin-bottom: 1rem;
}
.student-info label span {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #555;
}
.student-info input[type="text"],
.student-info input[type="email"] {
    width: 100%;
    max-width: 320px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}
.part {
    margin-bottom: 2rem;
}
.part h2 {
    margin-bottom: 1rem;
}
.question {
    margin-bottom: 1.25rem;
}
.q-text {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}
.options {
    margin-left: 0.5rem;
}
.option {
    display: block;
    margin-bottom: 0.35rem;
    cursor: pointer;
}
.option input {
    margin-right: 0.5rem;
}
.options-checkboxes .option span {
    display: inline;
}
.match-table {
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.match-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f5f5f5;
    padding: 0.5rem 1rem;
    font-weight: 600;
}
.match-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0.5rem 1rem;
    border-top: 1px solid #eee;
    align-items: center;
    gap: 1rem;
}
.match-row select {
    padding: 0.4rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}
.part3-options-ref {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}
.part3-options-ref span {
    display: inline-block;
    margin-right: 1rem;
}
.part3-desc {
    margin: 0 0 0.5rem 0;
    color: #555;
}
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}
.form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover {
    background: #1d4ed8;
}
.btn-submit {
    font-weight: 600;
}
.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
}

/* Result page */
.result-box {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.result-score {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Admin */
.admin-list {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.results-table {
    width: 100%;
    border-collapse: collapse;
}
.results-table th,
.results-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.results-table th {
    background: #f5f5f5;
    font-weight: 600;
}
.results-table tr:hover {
    background: #fafafa;
}
.admin-detail {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.student-meta {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.student-meta p {
    margin: 0.25rem 0;
}
.admin-detail section {
    margin-bottom: 1.5rem;
}
.admin-detail h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #333;
}
.review-q {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid #ccc;
}
.review-q.correct {
    border-left-color: #16a34a;
    background: #f0fdf4;
}
.review-q.wrong {
    border-left-color: #dc2626;
    background: #fef2f2;
}
.review-q.open {
    border-left-color: #2563eb;
    background: #f8fafc;
}
.review-q p {
    margin: 0.25rem 0;
}
.open-answer {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fff;
    border-radius: 4px;
    white-space: pre-wrap;
}
