* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    overflow: hidden;
}

header {
    background: #fff;
    color: #333;
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

header h1 {
    font-size: 22px;
    font-weight: 600;
}

main {
    padding: 20px;
}

.task-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #666;
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 0;
}

.btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.btn-primary {
    background: #333;
    color: white;
    border-color: #333;
}

.btn-primary:hover {
    background: #555;
    border-color: #555;
}

.btn-primary:active {
    background: #222;
}

.btn-secondary {
    background: #fff;
    color: #333;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.message {
    margin: 20px 0;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    text-align: center;
    font-weight: 500;
    width: 100%;
    clear: both;
}

.message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    display: block;
}

.message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    display: block;
}

.message.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
    display: block;
}

.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* File upload styles */
.file-input-wrapper {
    position: relative;
}

.form-file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.btn-file {
    padding: 10px 20px;
    background: white;
    color: #333;
    border: 2px dashed #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

.btn-file:hover {
    border-color: #666;
    background: #f9f9f9;
}

.field-hint {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.file-preview-area {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.file-preview-area .no-files {
    color: #999;
    font-size: 13px;
    text-align: center;
    margin: 10px 0;
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    margin-bottom: 8px;
    gap: 10px;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    word-break: break-all;
}

.file-size {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.btn-remove-file {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-file:hover {
    background: #cc0000;
}

/* Field error styles */
.field-error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 5px;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea,
.form-group.has-error .btn-file {
    border-color: #d32f2f;
}

.required {
    color: #d32f2f;
}

/* Responsive design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    main {
        padding: 20px;
    }

    header h1 {
        font-size: 22px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
