/* Heidi's Dog House app. Shares its palette and type with heidisdoghouse.com. */

:root {
  --cream: #fffbf4;
  --paper: #f7eee0;
  --ink: #2c2418;
  --body: #5a4f40;
  --muted: #6b604f;
  --line: #e6d9c3;
  --terra: #a4572f;
  --terra-dark: #7e4122;
  --terra-soft: #f4dccb;
  --sage: #5f6e40;
  --sage-soft: #e3e8d3;
  --gold-soft: #fbefd0;
  --gold-ink: #7a5410;
  --danger: #a63d26;
  --danger-soft: #f8e1da;
  --white: #ffffff;

  --serif: "Newsreader", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(44, 36, 24, 0.06), 0 10px 28px -14px rgba(44, 36, 24, 0.22);
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: var(--terra); text-underline-offset: 3px; }
a:hover { color: var(--terra-dark); }
:focus-visible { outline: 3px solid #f3c969; outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(30px, 4vw, 40px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.narrow { max-width: 560px; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 32px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sage); }

/* Header */
.app-header { background: var(--white); border-bottom: 1px solid var(--line); }
.app-header .container { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; margin-right: auto; font-family: var(--serif); font-weight: 600; font-size: 21px; }
.brand:hover { color: var(--ink); }
.brand-tag { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--white); background: var(--sage); border-radius: 999px; padding: 2px 10px; }
.app-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.app-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.app-nav a:hover { background: var(--paper); }
.app-nav a[aria-current="page"] { background: var(--terra-soft); color: var(--terra-dark); }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--terra); color: var(--white); font-size: 12px; }

main { padding: clamp(24px, 4vw, 40px) 0 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-head p { color: var(--muted); margin-top: 6px; }

/* Flash */
.flash { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-weight: 600; }
.flash-notice { background: var(--sage-soft); color: #3d4729; }
.flash-alert { background: var(--danger-soft); color: var(--danger); }

/* Buttons */
.button, button.button, input[type="submit"].button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font: 700 15px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  background: var(--terra); color: var(--white);
}
.button:hover { background: var(--terra-dark); color: var(--white); }
.button-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.button-secondary:hover { background: var(--ink); color: var(--cream); }
.button-quiet { background: var(--paper); color: var(--ink); }
.button-quiet:hover { background: var(--line); color: var(--ink); }
.button-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: var(--danger); color: var(--white); }
.button-small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.button[disabled] { opacity: 0.6; cursor: progress; }
.link-button { background: none; border: 0; padding: 0; color: var(--terra); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.button_to { display: inline; }

/* Cards and lists */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); }
.card-tint { background: var(--paper); border-color: transparent; }
.card h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list-title { font-weight: 700; color: var(--ink); text-decoration: none; }
a.list-title:hover { color: var(--terra); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

.details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; }
.details dt { color: var(--muted); font-weight: 600; font-size: 14px; }
.details dd { margin: 0; white-space: pre-line; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--paper); color: var(--body); }
.badge-requested, .badge-pending, .badge-limited, .badge-unpaid { background: var(--gold-soft); color: var(--gold-ink); }
.badge-confirmed, .badge-approved, .badge-scheduled, .badge-open, .badge-paid, .badge-completed { background: var(--sage-soft); color: #3d4729; }
.badge-declined, .badge-full, .badge-expired { background: var(--danger-soft); color: var(--danger); }
.badge-cancelled { background: var(--paper); color: var(--muted); }

/* Dogs */
.dog-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: center; text-decoration: none; color: inherit; }
.dog-card:hover h3 { color: var(--terra); }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--terra-soft); display: grid; place-items: center; font-family: var(--serif); font-size: 28px; color: var(--terra-dark); }
.avatar-lg { width: 120px; height: 120px; font-size: 44px; }
.avatar-sm { width: 40px; height: 40px; font-size: 18px; }

/* Forms */
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"],
.field input[type="number"], .field input[type="date"], .field input[type="datetime-local"], .field input[type="search"],
.field select, .field textarea {
  width: 100%; font: 16px/1.4 var(--sans); color: var(--ink); background: var(--cream);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 46px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-soft); }
.field input[type="file"] { font: inherit; }
.field fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--terra); background: var(--terra-soft); }
.choice input { width: 18px; height: 18px; accent-color: var(--terra); }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.errors { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 14px 18px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.field_with_errors { display: contents; }
.field_with_errors input, .field_with_errors select, .field_with_errors textarea { border-color: var(--danger); }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-head { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 4px; }
.calendar-day { min-height: 64px; border-radius: 10px; padding: 6px 8px; background: var(--white); border: 1px solid var(--line); display: grid; align-content: space-between; gap: 4px; font-size: 13px; }
.calendar-day .day-number { font-weight: 700; font-size: 14px; }
.calendar-day.is-past { opacity: 0.45; }
.calendar-day.is-blank { background: transparent; border-color: transparent; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--terra); }
.calendar-day.status-open { background: #f3f6ea; }
.calendar-day.status-limited { background: var(--gold-soft); }
.calendar-day.status-full { background: var(--danger-soft); }
.calendar-admin .calendar-day { min-height: 110px; align-content: start; }
.calendar-dogs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.calendar-dogs a { display: block; font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, 0.75); border-radius: 6px; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-dogs a:hover { color: var(--terra); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .calendar { gap: 3px; }
  .calendar-day { min-height: 48px; padding: 4px; font-size: 11px; }
  .calendar-admin .calendar-day { min-height: 72px; }
  .calendar-dogs a { font-size: 10px; padding: 0 3px; }
}

/* Stay updates */
.feed { display: grid; gap: 20px; }
.update { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 12px; }
.update-meta { font-size: 14px; color: var(--muted); }
.update-body { white-space: pre-line; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--paper); }
.media-grid a { display: block; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--paper); }
.auth-card { width: min(440px, 100%); background: var(--white); border-radius: 24px; padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); display: grid; gap: 22px; }
.auth-card .brand { justify-content: center; margin: 0; font-size: 24px; }
.auth-card h1 { font-size: 28px; text-align: center; }
.auth-links { text-align: center; font-size: 15px; display: grid; gap: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--paper); }
tr:last-child td { border-bottom: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--ink); background: var(--paper); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--cream); }

.stat { display: grid; gap: 2px; }
.stat strong { font-family: var(--serif); font-size: 34px; line-height: 1; }

/* Public landing page */
.public main { padding: 0; }
.landing-hero { padding: clamp(40px, 7vw, 88px) 0; }
.landing-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.landing-title { font-size: clamp(38px, 5.6vw, 60px); line-height: 1.05; }
.landing-lede { font-size: clamp(17px, 2vw, 20px); color: var(--body); max-width: 34em; }
.landing-heading { font-size: clamp(28px, 3.6vw, 40px); }
.landing-photos { position: relative; min-height: 440px; }
.landing-photo { width: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.landing-photo-main { position: absolute; left: 0; top: 0; width: 66%; aspect-ratio: 3 / 4; transform: rotate(-2deg); border: 10px solid var(--white); }
.landing-photo-side { position: absolute; right: 0; bottom: 0; width: 50%; aspect-ratio: 3 / 4; transform: rotate(3deg); border: 10px solid var(--white); }
.landing-section { padding: clamp(56px, 8vw, 96px) 0; }
.landing-section-tint { background: var(--paper); }
.landing-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.landing-step-number { width: 44px; height: 44px; border-radius: 50%; background: var(--terra-soft); color: var(--terra-dark); display: grid; place-items: center; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.landing-split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.landing-split .landing-photo { aspect-ratio: 4 / 5; }
.landing-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; color: var(--body); }
.landing-features strong { color: var(--ink); }
.public-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); background: var(--cream); }
.public-footer a { color: var(--ink); }
@media (max-width: 860px) {
  .landing-hero-grid, .landing-split { grid-template-columns: minmax(0, 1fr); }
  .landing-photos { min-height: 0; aspect-ratio: 1 / 0.9; max-width: 480px; width: 100%; }
  .landing-steps { grid-template-columns: minmax(0, 1fr); }
  .landing-split .landing-photo { max-width: 420px; }
}
.app-nav a.button { color: var(--white); border-radius: 999px; padding: 6px 16px; }
.app-nav a.button:hover { background: var(--terra-dark); color: var(--white); }

/* Two-factor */
.setup-steps { margin: 0; padding-left: 20px; display: grid; gap: 22px; }
.setup-steps li { display: grid; gap: 12px; }
.qr-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; width: 212px; justify-self: center; }
.qr-code { display: block; width: 100%; height: auto; }
.secret { display: block; margin-top: 6px; padding: 10px 12px; background: var(--paper); border-radius: 10px; font-size: 15px; letter-spacing: 0.06em; word-break: break-all; }
.recovery-codes { list-style: none; margin: 0; padding: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: var(--paper); border-radius: var(--radius-sm); }
.recovery-codes code { font-size: 16px; letter-spacing: 0.04em; }
.auth-links .button_to { display: block; }
