body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 40px auto;
    max-width: 800px;
    padding: 0 20px;
    color: #333;
    line-height: 1.6;
}

h1 {
    color: #1a1a1a;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    margin-top: 0;
    font-size: 1.1em;
}

.lab-section {
    margin: 30px 0;
}

.styled-form {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

fieldset {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

legend {
    font-weight: 600;
    padding: 0 10px;
    color: #0056b3;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.form-group label {
    width: 180px;
    min-width: 150px;
    font-weight: 500;
}

.form-group.textarea-group {
    align-items: flex-start;
}

.form-group.textarea-group label {
    padding-top: 5px;
}

input, textarea, select {
    font: 1em sans-serif;
    width: 100%;
    max-width: 350px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    height: 80px;
    resize: vertical;
}

.form-group-block {
    margin-bottom: 15px;
}

.group-title {
    font-weight: 500;
    margin-bottom: 5px;
    margin-top: 0;
}

.radio-checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.radio-checkbox-option input {
    width: auto;
    margin-right: 10px;
}

.radio-checkbox-option label {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

button, input[type="submit"], input[type="reset"], input[type="button"] {
    font: inherit;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

button[type="submit"] {
    background-color: #0056b3;
    color: white;
    border-color: #004085;
}

button[type="submit"]:hover {
    background-color: #004085;
}

.task2-paragraph::first-line {
    color: #0056b3;
    font-weight: bold;
    text-transform: uppercase;
}

.task2-paragraph::first-letter {
    font-size: 2.5em;
    font-weight: bold;
    color: #d9534f;
    float: left;
    line-height: 1;
    margin-right: 8px;
    margin-top: 4px;
}

.task2-decor::before {
    content: "🚀 [Початок контенту] — ";
    color: #28a745;
    font-weight: bold;
}

.task2-decor::after {
    content: " — [Кінець контенту] 🏁";
    color: #dc3545;
    font-weight: bold;
}

.link-container {
    margin: 15px 0;
}

a.custom-link:link {
    color: #007bff;
    text-decoration: underline;
}

a.custom-link:visited {
    color: #6f42c1;
}

a.custom-link:hover {
    color: #fd7e14;
    text-decoration: none;
}

a.custom-link:active {
    color: #dc3545;
    font-weight: bold;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

input:required:valid, textarea:required:valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

input:focus:invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

input[type="checkbox"]:checked + label,
input[type="radio"]:checked + label {
    color: #28a745;
    font-weight: bold;
}

.task4-list li:first-child {
    color: #d9534f;
    font-weight: bold;
    list-style-type: square;
}

.task4-list li:nth-of-type(even) {
    background-color: #f1f3f5;
    padding-left: 5px;
}