:root {
  --ink: #17201c;
  --muted: #607069;
  --paper: #fbfaf7;
  --line: #d8ddd5;
  --green: #315f49;
  --green-dark: #1f3f32;
  --amber: #b96f2d;
  --clay: #8f5846;
  --blue: #2e607d;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(20, 31, 27, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 0 5vw;
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 800;
  font-size: 1.12rem;
  text-decoration: none;
  white-space: nowrap;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--muted);
}

nav a[aria-current="page"],
nav a:hover {
  color: var(--ink);
  background: #edf1eb;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
  padding: 56px 5vw 72px;
}

.auth-copy {
  max-width: 680px;
}

.auth-copy h1 {
  font-size: clamp(2.2rem, 6vw, 5rem);
}

.auth-copy p {
  color: var(--muted);
}

.auth-message {
  min-height: 24px;
  color: #8a2f27;
  font-weight: 800;
}

.auth-forms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.hero {
  position: relative;
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(15, 24, 20, 0.82) 0%, rgba(15, 24, 20, 0.62) 38%, rgba(15, 24, 20, 0.1) 100%),
    linear-gradient(0deg, rgba(15, 24, 20, 0.45), rgba(15, 24, 20, 0.04) 46%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, 90vw);
  padding: 7vh 5vw 13vh;
  color: var(--white);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #f4b36f;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 10vw, 7.5rem);
  line-height: 0.95;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.7rem, 4vw, 3.15rem);
  line-height: 1.02;
}

h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

p {
  line-height: 1.65;
}

.lead {
  max-width: 670px;
  margin: 22px 0 0;
  font-size: clamp(1rem, 2vw, 1.22rem);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.96rem;
}

.button.primary {
  background: var(--amber);
  color: #180f09;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  border-color: var(--line);
}

.button.dark {
  background: var(--ink);
  color: var(--white);
}

.button.full {
  width: 100%;
}

.button.compact {
  min-height: 42px;
  padding: 0 14px;
}

.section {
  padding: 72px 5vw;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 34px;
  align-items: start;
}

.intro-grid p {
  max-width: 760px;
}

.info-panel,
.animal-form,
.animal-list-panel,
.empty-state,
.animal-card,
.mini-empty {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.info-panel {
  padding: 26px;
}

.info-panel ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.split-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: #e5ece4;
  border-top: 1px solid var(--line);
}

.split-band p {
  max-width: 820px;
  margin-bottom: 0;
}

.registry-page {
  padding: 48px 5vw 64px;
}

.registry-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.registry-header h1 {
  font-size: clamp(2.2rem, 6vw, 5rem);
}

.registry-header p {
  max-width: 760px;
  color: var(--muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 10px;
  min-width: min(420px, 100%);
}

.summary-strip div {
  padding: 16px;
  background: #eef3ed;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-strip strong {
  display: block;
  font-size: 1.7rem;
}

.summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.registry-layout {
  display: grid;
  grid-template-columns: minmax(310px, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.animal-form,
.animal-list-panel {
  padding: 22px;
}

.form-heading,
.animal-card-header,
.toolbar,
.card-actions {
  display: flex;
  align-items: center;
}

.form-heading {
  justify-content: space-between;
  margin-bottom: 18px;
}

.form-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  color: #34443e;
  font-weight: 800;
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd4cc;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: var(--white);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toolbar {
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar label {
  min-width: 160px;
  flex: 1 1 160px;
  margin: 0;
}

.toolbar .search-label {
  flex-basis: 260px;
}

.animal-list {
  display: grid;
  gap: 14px;
}

.animal-card {
  padding: 18px;
  box-shadow: none;
}

.animal-card-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.animal-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: start;
}

.animal-main {
  min-width: 0;
}

.animal-card h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.animal-card p {
  margin: 0;
  color: var(--muted);
}

.badge-row,
.data-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 8px;
  background: #edf1eb;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.badge.status {
  background: #f6eadf;
  color: #6e3d13;
}

.badge.blue {
  background: #e4eef3;
  color: var(--blue);
}

.data-grid {
  margin-top: 14px;
}

.data-grid span {
  min-width: 130px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 0.88rem;
}

.data-grid strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.notes {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.animal-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.animal-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.animal-details summary::-webkit-details-marker {
  display: none;
}

.details-arrow {
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.animal-details[open] .details-arrow {
  transform: rotate(180deg);
}

.animal-details[open] summary {
  margin-bottom: 14px;
}

.qr-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.qr-code {
  width: 126px;
  height: 126px;
  display: block;
}

.qr-panel span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.log-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.log-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.log-heading strong {
  color: var(--ink);
}

.data-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.data-controls label {
  margin-bottom: 0;
}

.log-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.log-list time {
  color: var(--blue);
  font-weight: 800;
  font-size: 0.86rem;
}

.log-list span,
.log-list p {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
}

.log-list em {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 800;
}

.feeding-success {
  background: #dcefe2;
  color: #1e6b3d;
}

.feeding-attempt {
  background: #f6eadf;
  color: #6e3d13;
}

.feeding-failed {
  background: #f3dfdd;
  color: #8a2f27;
}

.data-calendar {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfa;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 8px;
  background: #edf1eb;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 92px;
  padding: 7px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--white);
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.muted-day {
  background: #f3f5f1;
}

.has-data {
  background: #fbfcfa;
}

.calendar-events {
  display: grid;
  gap: 5px;
}

.calendar-event {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-size: 0.75rem;
}

.calendar-event span {
  font-weight: 800;
}

.calendar-event em {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 8px;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
}

.log-overview {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.log-overview h3 {
  margin-bottom: 12px;
}

.log-overview-list {
  max-height: 360px;
  overflow: auto;
}

.compact-log-list li {
  grid-template-columns: 86px minmax(0, 1fr) auto;
}

.log-entry-action {
  display: flex;
  justify-content: flex-end;
}

.form-actions {
  display: grid;
  gap: 10px;
}

.groups-panel {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.groups-panel > .button {
  margin-bottom: 12px;
}

.group-list {
  display: grid;
  gap: 12px;
}

.group-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.group-card h3 {
  margin-bottom: 4px;
}

.animal-picker {
  margin: 0 0 15px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.animal-picker legend {
  padding: 0 6px;
  color: #34443e;
  font-weight: 800;
  font-size: 0.86rem;
}

.animal-picker-list {
  display: grid;
  gap: 8px;
}

.animal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.animal-check input {
  width: 18px;
  min-height: 18px;
}

.mini-empty {
  padding: 14px;
  color: var(--muted);
  box-shadow: none;
  background: #fbfcfa;
}

.morph-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 184px;
  overflow: auto;
  margin: -4px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.morph-option,
.selected-morph {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--white);
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.83rem;
}

.morph-option:hover,
.selected-morph:hover {
  border-color: var(--green);
  background: #edf1eb;
}

.selected-morphs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 15px;
}

.selected-morph {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #e4eef3;
  color: var(--blue);
}

.selected-morph span {
  font-size: 1rem;
  line-height: 1;
}

.muted-inline,
.selected-log-animal {
  color: var(--muted);
  font-size: 0.9rem;
}

.selected-log-animal {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  font-weight: 800;
}

.is-hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.card-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.text-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  background: var(--white);
  cursor: pointer;
  font-weight: 800;
}

.text-button.delete {
  color: #8a2f27;
}

.text-button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.8rem;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  box-shadow: none;
}

@media (max-width: 920px) {
  .hero {
    min-height: 720px;
  }

  .hero-overlay {
    background: linear-gradient(0deg, rgba(15, 24, 20, 0.84), rgba(15, 24, 20, 0.28));
  }

  .hero-content {
    align-self: end;
    padding-bottom: 72px;
  }

  .intro-grid,
  .registry-layout,
  .registry-header,
  .auth-panel,
  .auth-forms {
    grid-template-columns: 1fr;
    display: grid;
  }

  .registry-header {
    align-items: start;
  }

  .split-band {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  nav {
    justify-content: flex-start;
  }

  .user-bar {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    min-height: 670px;
  }

  .section,
  .registry-page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .two-col,
  .summary-strip,
  .animal-card-body,
  .log-list li,
  .data-controls {
    grid-template-columns: 1fr;
  }

  .qr-panel {
    justify-items: start;
  }

  .toolbar {
    display: grid;
  }

  .button {
    width: 100%;
  }
}
