:root {
  --bg-top: #f5efe6;
  --bg-bottom: #dce8d9;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-border: rgba(31, 45, 29, 0.12);
  --text: #1f2d1d;
  --muted: #536350;
  --accent: #2e7d32;
  --accent-dark: #1f5c25;
  --completed: #edf7ee;
  --pending: #fff7e8;
  --shadow: 0 20px 50px rgba(33, 48, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 30%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.page {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.subtitle {
  max-width: 640px;
  margin: 14px 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.panel {
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.refresh-button,
.primary-button,
.action-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.refresh-button:hover,
.primary-button:hover,
.action-button:hover {
  transform: translateY(-1px);
}

.refresh-button:disabled,
.primary-button:disabled,
.action-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.todo-form {
  margin-top: 22px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 45, 29, 0.08);
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.form-row {
  display: flex;
  gap: 12px;
}

.todo-input,
.edit-input {
  width: 100%;
  border: 1px solid rgba(31, 45, 29, 0.16);
  border-radius: 14px;
  padding: 13px 15px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
}

.todo-input:focus,
.edit-input:focus {
  outline: 2px solid rgba(46, 125, 50, 0.22);
  border-color: var(--accent);
}

.status-message {
  margin: 18px 0 0;
  color: var(--muted);
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.todo-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(31, 45, 29, 0.08);
  background: white;
  box-shadow: 0 8px 20px rgba(33, 48, 29, 0.08);
}

.todo-card.completed {
  background: var(--completed);
}

.todo-card.pending {
  background: var(--pending);
}

.todo-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.todo-edit-form {
  margin-bottom: 14px;
}

.todo-meta {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.75);
}

.todo-date {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.todo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.action-button {
  padding: 10px 14px;
  font-size: 0.88rem;
}

.action-button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 45, 29, 0.1);
}

.action-button.delete {
  background: linear-gradient(135deg, #b8442f, #8d2d20);
}

.empty-state {
  padding: 28px;
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1100px);
    padding-top: 28px;
  }

  .panel {
    padding: 18px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-row {
    flex-direction: column;
  }
}
