:root {
    --bg-color: #2c2a4a; /* Deep purple background */
    --font-color: #eAEAEA;
    --primary-color: #F92C85; /* Vibrant pink for accents */
    --secondary-color: #FF9A8B; /* Warm orange/peach */
    --card-bg: #4f4c7a;
    --grey: #a09dc0;
    --shadow: 0 10px 20px rgba(0,0,0,0.2);
    --font-heading: 'Anta', serif;
    --font-body: 'Poppins', sans-serif;
}

/* Keyframe Animations */
@keyframes fall-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.8);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 60px; /* Adjust to fit task height */
    }
}

@keyframes sweep-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--font-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--card-bg);
    background-image: url("pixels-ud.png");
    background-blend-mode: multiply;
    background-repeat: no-repeat;
    background-size: 480px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 25px;
    box-sizing: border-box;
    border: 1px solid #5a578e;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

.header-controls a, .header-controls button {
    margin-left: 18px;
    color: var(--grey);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}
.header-controls a:hover, .header-controls button:hover {
    color: var(--secondary-color);
}
.header-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
}
.header-controls a {
    font-weight: 500;
}


/* Add Task Form */
#add-task-form {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

#add-task-form input[type="text"] {
    flex-grow: 1;
    background-color: #2c2a4a;
    border: 1px solid #5a578e;
    color: var(--font-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-family: var(--font-body);
}
#add-task-form input[type="text"]::placeholder {
    color: var(--grey);
}
#add-task-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

#add-task-form button, #login-form button {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    line-height: 1;
}
#add-task-form button:hover, #login-form button:hover {
    background-color: #e01a70;
}

/* Task List */
#task-list, #archive-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    /* For smooth re-sizing */
    transition: all 0.5s ease-in-out;
}

#task-list li, #archive-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 5px;
    border-bottom: 1px solid #5a578e;
    overflow: hidden;
}

/* Animation Classes */
#task-list li.new-task {
    animation: fall-in 0.4s ease-out forwards;
}

#task-list li.sweeping {
    animation: sweep-out 0.4s ease-in forwards;
}

#task-list li.sweeping-collapsing {
    border-bottom-width: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    max-height: 0;
    transition: max-height 0.4s ease-in, 
                padding 0.4s ease-in, 
                margin 0.4s ease-in, 
                border-width 0.4s ease-in;
}

.task-handle {
    color: var(--grey);
    cursor: grab;
    transition: color 0.2s ease;
}
.task-handle:hover {
    color: var(--font-color);
}
li.sortable-ghost {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.task-text {
    flex-grow: 1;
    transition: color 0.3s ease;
    font-weight: 500;
}

li.completed .task-text {
    text-decoration: line-through;
    color: var(--grey);
}

.archive-date {
    font-size: 12px;
    color: var(--grey);
    margin-left: auto;
    white-space: nowrap;
}

/* Checkbox */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    margin: 0;
    font: inherit;
    color: var(--grey);
    width: 1.25em;
    height: 1.25em;
    border: 0.15em solid var(--grey);
    border-radius: 4px;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
input[type="checkbox"]:hover {
    border-color: var(--secondary-color);
}
input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: var(--primary-color);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="checkbox"]:checked {
    border-color: var(--primary-color);
}
input[type="checkbox"]:checked::before {
    transform: scale(1.2);
}

/* Login Form */
#login-container h1 { font-family: var(--font-heading); text-align: center; }
#login-form input {
    width: 100%;
    background-color: #2c2a4a;
    border: 1px solid #5a578e;
    color: var(--font-color);
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 15px;
    font-family: var(--font-body);
}
.error { color: var(--secondary-color); text-align: center; min-height: 1.2em; }