:root {
  --ink: #17233b;
  --muted: #68748b;
  --line: #e5e9f0;
  --page: #f5f7fb;
  --surface: #fff;
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --danger: #dc4255;
  --success: #23966c;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 28px;
  padding: 0 max(5vw, 24px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 9px;
  font-size: 1.1rem;
}

.header-message {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.profile-button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  color: var(--brand-dark);
  background: #e9e8ff;
  border: 0;
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 800;
}

.auth-panel {
  display: grid;
  min-height: calc(100vh - 102px);
  place-items: center;
  padding: 48px 24px;
}

.auth-card {
  width: min(100%, 430px);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(28, 39, 73, .04);
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.auth-intro {
  margin-bottom: 24px;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--page);
  border-radius: 8px;
}

.auth-tab {
  padding: 9px 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--brand-dark);
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(28, 39, 73, .08);
}

.auth-status {
  min-height: 1.2em;
  margin: 16px 0 0;
  color: var(--danger);
  font-size: .8rem;
}

.app-shell {
  width: min(1180px, 90%);
  margin: 0 auto;
  padding: 64px 0 48px;
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -.045em;
}

.intro-text {
  margin-bottom: 0;
  color: var(--muted);
}

.progress-card {
  width: 214px;
  padding: 16px 18px;
  background: #edeeff;
  border-radius: 13px;
}

.progress-card strong {
  display: block;
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.progress-card span {
  color: #5d6289;
  font-size: .78rem;
}

.progress-track {
  height: 6px;
  margin-top: 11px;
  overflow: hidden;
  background: #d5d6f7;
  border-radius: 99px;
}

.progress-track span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(450px, 1.5fr);
  gap: 24px;
  align-items: start;
}

.task-form-card,
.tasks-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(28, 39, 73, .04);
}

.task-form-card {
  padding: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
}

.section-heading h2,
.tasks-header h2 {
  margin: 0;
  font-size: 1.07rem;
  letter-spacing: -.02em;
}

.heading-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--brand);
  background: #eeefff;
  border-radius: 7px;
  font-weight: 700;
}

.field {
  margin-bottom: 17px;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #45516a;
  font-size: .8rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #dce2eb;
  border-radius: 8px;
  outline-color: var(--brand);
  font-size: .86rem;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a4adbd;
}

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

.primary-button {
  width: 100%;
  margin-top: 3px;
  padding: 12px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  font-weight: 750;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.tasks-card {
  overflow: hidden;
}

.tasks-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1.5fr);
  align-items: center;
  gap: 24px;
  padding: 25px 27px 21px;
  border-bottom: 1px solid var(--line);
}

.tasks-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.filter-controls,
.filter-field {
  min-width: 0;
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  width: 100%;
}

.filter-field label {
  margin-bottom: 5px;
}

.filter-panel select {
  padding: 8px 9px;
  font-size: .78rem;
}

.apply-filter-button,
.completed-row button {
  color: #536078;
  background: #fff;
  border: 1px solid #dfe4ed;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 650;
}

.apply-filter-button {
  padding: 9px 10px;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

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

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 21px 27px;
  border-bottom: 1px solid var(--line);
}

.check-button {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  margin-top: 2px;
  background: #fff;
  border: 2px solid #c9d1de;
  border-radius: 50%;
}

.check-button.checked {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
  font-size: .72rem;
}

.task-content h3 {
  margin-bottom: 5px;
  font-size: .94rem;
}

.task-content p {
  margin-bottom: 11px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .73rem;
}

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

.date.urgent {
  color: var(--danger);
  font-weight: 700;
}

.date.today {
  color: #c58a00;
  font-weight: 700;
}

.priority {
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 750;
}

.priority.high {
  color: #a72c3d;
  background: #ffeaed;
}

.priority.medium {
  color: #9b6016;
  background: #fff3dd;
}

.priority.low {
  color: #197757;
  background: #e3f6ef;
}

.more-button {
  align-self: start;
  padding: 0 2px;
  color: #8e98a9;
  background: transparent;
  border: 0;
  font-weight: 800;
  letter-spacing: 1px;
}

.completed-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 27px;
  background: #fafbfc;
}

.completed-check {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  font-size: .72rem;
}

.completed-row div {
  display: grid;
  gap: 2px;
  margin-right: auto;
  font-size: .78rem;
}

.completed-row div span {
  color: var(--muted);
  font-size: .73rem;
}

.completed-row button {
  padding: 7px 9px;
}

.site-footer {
  padding: 0 24px 30px;
  color: #8a94a7;
  text-align: center;
  font-size: .76rem;
}

.form-actions {
  display: grid;
  gap: 9px;
  margin-top: 3px;
}

.primary-button,
.secondary-button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-weight: 750;
}

.primary-button {
  margin-top: 0;
}

.secondary-button {
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--brand);
}

.secondary-button:hover {
  background: #f3f2ff;
}

.task-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.edit-button {
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: .75rem;
  font-weight: 700;
}

.task-item.completed .task-content h3 {
  color: var(--muted);
  text-decoration: line-through;
}

@media (max-width: 780px) {
  .app-shell {
    width: min(92%, 580px);
    padding-top: 36px;
  }

  .intro,
  .workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .progress-card {
    width: 100%;
  }

  .workspace {
    gap: 18px;
  }
}

@media (max-width: 500px) {
  .site-header {
    min-height: 62px;
    padding: 0 18px;
    gap: 12px;
  }

  .header-message {
    display: none;
  }

  .profile-button {
    margin-left: auto;
  }

  .task-form-card {
    padding: 21px;
  }

  .tasks-header,
  .task-item,
  .completed-row {
    padding-right: 18px;
    padding-left: 18px;
  }

  .tasks-header {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

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