/* Tasaki — cream, greys, one dark violet. Apple-like restraint. */

:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --line: #e6e1d6;
  --hairline: #edeae2;
  --ring: #c9c3b6;
  --accent: #55308f;
  --accent-soft: #9c7ad1;
  --accent-press: #432570;
  --danger-bg: #efe9f6;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: calc(1.25rem + env(safe-area-inset-top))
           max(1.25rem, env(safe-area-inset-right))
           calc(2.5rem + env(safe-area-inset-bottom))
           max(1.25rem, env(safe-area-inset-left));
}

@media (min-width: 40rem) {
  main { padding-top: 3rem; }
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Hollow letter: violet outline, background showing through the inside. */
h1 .accent-letter {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* The cleaver, framed like an iOS app-icon tile. */
.app-icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.app-icon.large {
  width: 84px;
  height: 84px;
  border-radius: 19px;
  margin: 0 auto 1rem;
  box-shadow: 0 2px 10px rgba(29, 29, 31, 0.06);
}

button { font: inherit; }

.logout {
  background: none;
  border: none;
  padding: 0.5rem 0;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  cursor: pointer;
}

.logout:hover { color: var(--accent); }

/* --- flash messages --- */

.flash {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--danger-bg);
  color: var(--accent);
  border-radius: 12px;
  font-size: 0.9375rem;
}

/* --- add form --- */

form.add {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

form.add input[name="text"],
form.login input {
  font-size: 1rem; /* ≥16px so iOS Safari doesn't zoom on focus */
  padding: 0.75rem 1rem;
  min-height: 48px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  appearance: none;
  width: 100%;
}

form.add input[name="text"] { flex: 1; width: auto; }

form.add input:focus,
form.login input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(85, 48, 143, 0.12);
}

form.add input::placeholder,
form.login input::placeholder { color: #a9a49a; }

form.add button,
form.login button {
  min-height: 48px;
  padding: 0 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

form.add button:active,
form.login button:active { background: var(--accent-press); }

/* --- task list --- */

ul.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

ul.tasks li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.875rem 0.375rem 0.375rem;
  border-bottom: 1px solid var(--hairline);
}

ul.tasks li:last-child { border-bottom: none; }

li.completing { opacity: 0.35; transition: opacity 0.2s; }

.done-form { flex: none; display: flex; }

.done {
  /* 44px touch target around a 26px ring */
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  background: none;
  border: none;
  cursor: pointer;
  color: transparent; /* the ✓ shows on hover (desktop) */
  font-size: 0.9375rem;
}

.done::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1.5px solid var(--ring);
  border-radius: 50%;
}

.done:hover { color: var(--accent); }
.done:hover::before { border-color: var(--accent); }

.task-body {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0;
}

.description {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.meta {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.meta .overdue {
  color: var(--accent);
  font-weight: 600;
}

li.empty {
  display: block;
  padding: 2.25rem 1rem;
  text-align: center;
  color: var(--ink-soft);
  border: none;
}

/* --- login page --- */

.login-wrap {
  max-width: 20rem;
  margin: 14vh auto 0;
  text-align: center;
}

form.login {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1.5rem;
  text-align: left;
}
