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

html {
  background: #f3f4f6;
  padding: 16px;
}

body {
  max-width: 520px;
  margin: 24px auto;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #1f2937;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1 {
  margin: 0 0 24px;
  font-size: 1.75rem;
  line-height: 1.2;
  color: #111827;
}

/* Form */

#record-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

legend {
  padding: 0 8px;
  font-weight: 600;
}

fieldset input[type="radio"] {
  margin: 0 8px 0 0;
  vertical-align: middle;
}

fieldset label {
  display: inline-block;
  margin-right: 16px;
  vertical-align: middle;
}

label[for="feed-time"] {
  display: block;
  margin-bottom: -8px;
  font-weight: 600;
}

#feed-time {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  color: inherit;
}

#feed-time:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Buttons */

button,
#add-record {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background-color: #2563eb;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

button:hover,
#add-record:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.15);
}

button:active,
#add-record:active {
  background-color: #1e40af;
  transform: translateY(0);
  box-shadow: none;
}

button:focus-visible,
#add-record:focus-visible {
  outline: 2px solid #1e40af;
  outline-offset: 2px;
}

#form-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.875rem;
}

#form-error:empty {
  display: none;
}

/* Records */

#record-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#record-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
  transition: box-shadow 150ms ease;
}

#record-list li:hover {
  box-shadow: 0 4px 8px rgba(17, 24, 39, 0.08);
}

.delete-record {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #b91c1c;
  font-size: 0.875rem;
}

.delete-record:hover {
  background-color: #fef2f2;
}

.delete-record:active {
  background-color: #fee2e2;
}

.delete-record:focus-visible {
  outline: 2px solid #b91c1c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  button,
  #add-record,
  .delete-record,
  #record-list li {
    transition: none;
  }

  button:hover,
  button:active,
  #add-record:hover,
  #add-record:active,
  .delete-record:hover,
  .delete-record:active {
    transform: none;
  }
}
