* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #4a6cf7, #8e54e9);
    min-height: 100vh;
    margin: 0;
    padding: 30px;
    color: #333;
}

.container {
    max-width: 700px;
    margin: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 25px 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    animation: fadeIn 0.5s ease;
}

h1, h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #222;
}

a {
    color: #4a6cf7;
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

input[type=text] {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: 0.2s;
    font-size: 14px;
}

input[type=text]:focus {
    border-color: #4a6cf7;
    outline: none;
}

button {
    background: #4a6cf7;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #324fda;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #4a6cf7;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.button-link:hover {
    background: #324fda;
    color: white;
}

.secondary-button {
    background: #eef1ff;
    color: #3652d5;
}

.secondary-button:hover {
    background: #dde4ff;
    color: #2943b7;
}

.danger-button {
    background: #e14b5a;
}

.danger-button:hover {
    background: #c73b49;
}

.list-card {
    background: #f7f8fc;
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: 0.2s;
}

.list-card:hover {
    background: #eef1ff;
}

.list-link {
    font-size: 16px;
    flex: 1;
}

.list-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    margin-bottom: 10px;
}

.task-item input[type=checkbox] {
    transform: scale(1.2);
}

.task-toggle-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.completed {
    text-decoration: line-through;
    color: #888;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-header h1,
.page-header h2 {
    margin: 0;
}

.list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
}

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

.task-editor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.task-editor input[type=text] {
    margin-bottom: 0;
}

.task-editor label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.form-error {
    color: #c73b49;
    margin-bottom: 14px;
    font-weight: 600;
}

.helper-text,
.empty-state {
    color: #666;
    margin-top: 0;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(10px);}
    to {opacity: 1; transform: translateY(0);}
}

@media (max-width: 640px) {
    body {
        padding: 18px;
    }

    .container {
        padding: 20px;
    }

    .list-card,
    .task-editor,
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .list-actions,
    .form-actions {
        width: 100%;
    }

    .list-actions > *,
    .form-actions > * {
        width: 100%;
    }

    .inline-form button,
    .list-actions .button-link,
    .form-actions .button-link,
    .form-actions button {
        width: 100%;
    }
}
