:root {
  --orange: #ef5b13;
  --orange-dark: #b85000;
  --green: #174b25;
  --gold: #d4af37;
  --cream: #f8f3e7;
  --ink: #17130f;
  --muted: #706960;
  --line: rgba(184, 80, 0, 0.15);
  --shadow: 0 24px 70px rgba(107, 52, 13, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  background:
    radial-gradient(circle at 10% 5%, rgba(212, 175, 55, 0.2), transparent 28rem),
    radial-gradient(circle at 95% 35%, rgba(239, 91, 19, 0.1), transparent 28rem),
    #fffdf9;
}

a { color: inherit; text-decoration: none; }

.task-loader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: #fffdf9; opacity: 1; visibility: visible; transition: opacity .3s ease, visibility .3s ease; }
.task-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.task-loader__content { display: grid; justify-items: center; gap: 15px; color: var(--green); }
.task-loader__content img { width: 76px; height: 76px; padding: 7px; object-fit: contain; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow); }
.task-loader__content strong { font-size: .9rem; }
.task-loader__spinner { width: 30px; height: 30px; border: 3px solid rgba(23,75,37,.14); border-top-color: var(--orange); border-radius: 50%; animation: task-loader-spin .75s linear infinite; }

@keyframes task-loader-spin { to { transform: rotate(360deg); } }

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.portal-brand { display: flex; align-items: center; gap: 12px; }
.portal-brand img { width: 50px; height: 50px; object-fit: contain; }
.portal-brand strong { display: block; font-size: 1rem; }
.portal-brand span { color: var(--muted); font-size: .72rem; }

.portal-nav { display: flex; gap: 8px; }
.portal-nav a { padding: 10px 15px; border-radius: 999px; font-size: .88rem; font-weight: 700; }
.portal-nav a:hover, .portal-nav a[aria-current="page"] { color: #fff; background: var(--green); }

.portal-main { width: min(820px, calc(100% - 32px)); margin: 56px auto 80px; }
.eyebrow { margin: 0 0 10px; color: var(--orange-dark); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-family: "Montserrat", sans-serif; font-size: clamp(2rem, 6vw, 4rem); letter-spacing: -.055em; line-height: 1.02; }
.intro { max-width: 620px; margin: 18px 0 36px; color: var(--muted); line-height: 1.7; }

.portal-card { padding: clamp(22px, 5vw, 42px); border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.task-form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .86rem; font-weight: 800; }
.field input, .field textarea { width: 100%; padding: 14px 16px; border: 1px solid rgba(23,75,37,.2); border-radius: 13px; color: var(--ink); font: inherit; background: #fff; outline: none; }
.field textarea { min-height: 145px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(239,91,19,.1); }
.button { justify-self: start; border: 0; padding: 13px 21px; border-radius: 999px; color: #fff; font-family: inherit; font-size: .9rem; font-weight: 800; background: linear-gradient(110deg, var(--green), #286c39); cursor: pointer; box-shadow: 0 10px 25px rgba(23,75,37,.2); }
.button:hover { transform: translateY(-1px); }
.form-message { min-height: 1.4em; margin: -5px 0 0; color: var(--green); font-size: .88rem; font-weight: 700; }

.task-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.task-count { color: var(--muted); font-size: .9rem; font-weight: 700; }
.task-filters { display: flex; gap: 8px; margin: 0 0 20px; overflow-x: auto; }
.task-filters button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 9px 13px; border-radius: 999px; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 800; background: #fff; cursor: pointer; white-space: nowrap; }
.task-filters button span { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: .7rem; background: var(--cream); }
.task-filters button[aria-pressed="true"] { color: #fff; border-color: var(--green); background: var(--green); }
.task-filters button[aria-pressed="true"] span { color: var(--green); background: #fff; }
.task-list { display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; }
.task-item { display: grid; grid-template-columns: 1fr auto; gap: 14px 22px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; transition: opacity .2s, border-color .2s; }
.task-item.is-complete { opacity: .65; border-color: rgba(23,75,37,.22); }
.task-item h2 { margin: 0 0 7px; font-size: 1.06rem; }
.task-item p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; white-space: pre-wrap; }
.task-item.is-complete h2 { text-decoration: line-through; }
.task-date { grid-column: 1; color: #958b80; font-size: .72rem; }
.task-actions { display: grid; justify-items: end; gap: 12px; align-self: start; }
.complete-button { border: 0; padding: 9px 13px; border-radius: 999px; color: #fff; font: inherit; font-size: .75rem; font-weight: 800; background: var(--green); cursor: pointer; }
.complete-button:hover { background: #286c39; }
.completed-badge { padding: 7px 10px; border-radius: 999px; color: var(--green); font-size: .75rem; font-weight: 800; background: rgba(23,75,37,.1); }
.delete-button { border: 0; padding: 5px 7px; color: #a43620; font: inherit; font-size: .75rem; font-weight: 800; background: transparent; cursor: pointer; }
.delete-button:hover { color: #fff; border-radius: 7px; background: #a43620; }
.delete-button:focus-visible { outline: 3px solid rgba(164,54,32,.25); outline-offset: 2px; }
.delete-button:disabled, .complete-button:disabled, .button:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.empty-state { padding: 54px 22px; border: 1px dashed rgba(184,80,0,.3); border-radius: 22px; text-align: center; }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.empty-state a { display: inline-block; color: var(--orange-dark); font-weight: 800; }

@media (max-width: 600px) {
  .portal-header { align-items: flex-start; }
  .portal-brand span { display: none; }
  .portal-nav { gap: 2px; }
  .portal-nav a { padding: 9px 10px; }
  .portal-main { margin-top: 35px; }
  .task-item { grid-template-columns: 1fr; }
  .task-actions { grid-row: 2; justify-items: start; }
  .task-date { grid-row: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .task-loader__spinner { animation-duration: 1.5s; }
}
