/* tareas — minimal no-framework styling for the server-rendered UI. */

:root {
    --line: #d5d9de;
    --muted: #6b7280;
    --danger: #b91c1c;
    --accent: #2563eb;
}

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    color: #1f2937;
    background: #f9fafb;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: .75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

nav .inline { margin-left: auto; }

main { max-width: 40rem; margin: 0 auto; padding: 1rem; }

a { color: var(--accent); text-decoration: none; }

a.button, button {
    font: inherit;
    padding: .4rem .8rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    background: #fff;
    cursor: pointer;
}

button.danger { color: var(--danger); border-color: #f3c1c1; }
button.secondary { color: var(--muted); }

h1 { font-size: 1.25rem; }
h2 { font-size: .95rem; color: var(--muted); margin: 1.25rem 0 .25rem; }

.tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
}

.tabs a {
    padding: .5rem .75rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
}

.tabs a[aria-current="page"] {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

form.create { display: flex; gap: .5rem; margin-bottom: 1rem; }
form.create input[name="title"] { flex: 2 1 30%; }
form.create input[name="notes"] { flex: 2 1 30%; }

input, textarea {
    font: inherit;
    padding: .4rem .6rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    background: #fff;
}

form.stack { display: grid; gap: .5rem; max-width: 30rem; }
form.stack label { font-size: .875rem; color: var(--muted); }

.row { display: flex; gap: .5rem; align-items: center; }

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

li.todo {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--line);
}

li.todo .title { flex: 1; color: inherit; overflow-wrap: anywhere; }
li.todo.done .title { color: var(--muted); text-decoration: line-through; }

/* The toggle button styled as a checkbox: an empty square that fills with a
   checkmark once the todo is completed. */
button.checkbox {
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 2px solid var(--muted);
    border-radius: .25rem;
    background: #fff;
    flex: none;
    display: grid;
    place-items: center;
}

li.todo.done button.checkbox { border-color: var(--accent); background: var(--accent); }
li.todo.done button.checkbox::after { content: "✓"; color: #fff; font-size: .8rem; line-height: 1; }

button.remove {
    border: none;
    background: none;
    color: var(--muted);
    padding: .25rem .4rem;
}

button.remove:hover { color: var(--danger); }

span.overdue { color: var(--danger); font-size: .875rem; white-space: nowrap; }
span.done { color: var(--muted); font-size: .875rem; white-space: nowrap; }

p.error { color: var(--danger); }

p.flash {
    max-width: calc(40rem - 2rem);
    margin: .75rem auto 0;
    padding: .5rem .75rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: .375rem;
}

.empty { color: var(--muted); }
