/* Calm, high-contrast theme for students, professionals, and older adults */
:root {
  --bg: #f4f7f4;
  --surface: #ffffff;
  --ink: #1c2b24;
  --muted: #4a5c54;
  --line: #d5e0da;
  --primary: #1f6b4a;
  --primary-dark: #155238;
  --accent: #c45c26;
  --high: #9b1c1c;
  --medium: #8a5a12;
  --low: #1f5f78;
  --ok: #1f6b4a;
  --shadow: 0 8px 24px rgba(28, 43, 36, 0.08);
  --radius: 16px;
  --font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 112.5%; /* 18px base for easier reading */
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top right, #e7f3ea 0%, transparent 40%),
    var(--bg);
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header {
  background: var(--primary-dark);
  color: #fff;
  padding: 1.75rem 1.25rem;
}

.header-inner,
main,
.site-footer {
  max-width: 960px;
  margin: 0 auto;
}

.site-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.7rem;
  font-weight: 700;
}

.tagline {
  margin: 0;
  font-size: 1.05rem;
  color: #e4f3ea;
}

main {
  padding: 1.25rem 1.1rem 2.5rem;
}

.section-title {
  margin: 0 0 0.85rem;
  font-size: 1.28rem;
}

.reminder-banner {
  background: #fff7e8;
  border: 2px solid #e7c48a;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.35rem;
}

.reminder-banner.is-urgent {
  background: #fdecec;
  border-color: #e3a0a0;
}

.reminder-banner p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.dashboard {
  margin-bottom: 1.75rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
}

.stat-card.urgent {
  border-color: #f0b4b4;
}

.stat-card.high {
  border-color: #f3c9a3;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-value {
  margin: 0.2rem 0 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.form-section,
.list-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

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

.optional {
  color: var(--muted);
  font-weight: 500;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 2px solid #c9d6cf;
  border-radius: 12px;
  background: #fbfffc;
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #8ec9ad;
  border-color: var(--primary);
}

.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.form-error {
  color: var(--high);
  font-weight: 650;
  margin: 0.85rem 0 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.btn,
.filter-btn {
  min-height: 48px;
  padding: 0.65rem 1.15rem;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #edf3ef;
  color: var(--ink);
  border-color: #c5d4cc;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: #c5d4cc;
}

.btn-small {
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem;
}

.btn-danger {
  background: #f8e6e6;
  color: var(--high);
  border-color: #e7b8b8;
}

.btn-ok {
  background: #e6f4ec;
  color: var(--ok);
  border-color: #b7dcc7;
}

.sort-note {
  margin: -0.4rem 0 1rem;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-btn {
  background: #eef4f0;
  color: var(--ink);
  border-color: #d3e0d8;
}

.filter-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.task-card {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: #fbfefc;
}

.task-card.is-overdue {
  border-color: #d96a6a;
  background: #fff6f6;
}

.task-card.is-done {
  opacity: 0.78;
  background: #f3f7f4;
}

.task-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: space-between;
  align-items: flex-start;
}

.task-title {
  margin: 0;
  font-size: 1.15rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.badge-high {
  background: #fde2e2;
  color: var(--high);
}

.badge-medium {
  background: #fff0d4;
  color: var(--medium);
}

.badge-low {
  background: #dceff6;
  color: var(--low);
}

.badge-overdue {
  background: #9b1c1c;
  color: #fff;
}

.badge-category {
  background: #e8f3ec;
  color: var(--primary-dark);
}

.task-meta,
.task-desc {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.empty-state {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.site-footer {
  padding: 0 1.1rem 2rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 800px) {
  .stat-grid,
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 106%;
  }

  .site-header h1 {
    font-size: 1.4rem;
  }

  .stat-grid,
  .form-grid,
  .time-row {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .filters,
  .task-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn,
  .filter-btn {
    width: 100%;
  }
}
