/* Gwen's Friends Pet Care — base styles
 *
 * Placeholder styling until the visual mockups from the design sub-agent
 * are integrated. Uses the agreed warm palette: sage green / warm cream /
 * terracotta accent. The mockups directory holds full design comps.
 */

:root {
  --color-sage: #7a9b76;
  --color-sage-dark: #5e7d5a;
  --color-cream: #faf6ef;
  --color-cream-dark: #efe7d8;
  --color-text: #2d2a26;
  --color-text-muted: #6b6760;
  --color-terracotta: #c97b5e;
  --color-terracotta-dark: #a86247;
  --color-line: #e3dccb;
  --color-bg: #fffbf5;
  --color-success: #4a7c3a;
  --color-error: #b03a3a;
  --font-serif: 'Fraunces', 'Lora', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 2px rgba(45, 42, 38, 0.06);
  --shadow-md: 0 4px 12px rgba(45, 42, 38, 0.08);
  --radius: 8px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-text);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

a {
  color: var(--color-sage-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
a:hover { border-bottom-color: var(--color-sage); }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-line);
  z-index: 100;
  padding: 14px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  border: none;
}
.nav-brand .paw { display: inline-block; margin-right: 6px; }
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--color-sage-dark); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--color-terracotta);
  color: white;
}
.btn-primary:hover {
  background: var(--color-terracotta-dark);
  border-bottom-color: transparent;
}
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}
.btn-secondary:hover {
  background: var(--color-text);
  color: var(--color-cream);
  border-bottom-color: transparent;
}

/* ---- Hero ---- */
.hero {
  background: var(--color-cream);
  padding: 80px 0;
}
.hero h1 {
  font-size: 3rem;
  max-width: 720px;
  margin-bottom: 16px;
}
.hero .lede {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---- Cards ---- */
.card {
  background: white;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: white;
  color: var(--color-text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-sage);
  outline-offset: 1px;
  border-color: var(--color-sage);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.checkbox-group { display: flex; flex-wrap: wrap; gap: 14px; }
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}

/* ---- Live quote preview (public /book) ---- */
.quote-preview {
  background: var(--color-cream);
  border: 1px solid var(--color-line);
  border-left: 4px solid var(--color-sage);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
  transition: border-color 0.2s, background-color 0.2s;
}
.quote-preview-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.quote-preview-total {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 4px 0 8px;
}
.quote-preview.is-ready .quote-preview-total { color: var(--color-sage-dark); }
.quote-preview-lines {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  border-top: 1px solid var(--color-line);
}
.quote-preview-lines li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  border-bottom: 1px dashed var(--color-line);
}
.quote-preview-lines li:last-child { border-bottom: none; }
.quote-preview-lines li.quote-error { color: var(--color-error); display: block; text-align: center; }
.quote-preview-note {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ---- Flash messages ---- */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  border: 1px solid;
}
.flash-success {
  background: #eaf3e6;
  border-color: #b3d4a3;
  color: var(--color-success);
}
.flash-error {
  background: #fbeaea;
  border-color: #e0b0b0;
  color: var(--color-error);
}

/* ---- Tables ---- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line);
}
.table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tr:hover { background: var(--color-cream); }

/* ---- Status pills ---- */
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}
.pill-pending { background: #fef3d0; color: #8a6a1a; }
.pill-approved { background: #e0f0d4; color: var(--color-success); }
.pill-denied { background: #f5d6d6; color: var(--color-error); }
.pill-completed { background: #d6e4f0; color: #2a5a8a; }
.pill-cancelled { background: #e0dcd0; color: var(--color-text-muted); }

/* ---- Footer ---- */
.footer {
  background: var(--color-cream);
  border-top: 1px solid var(--color-line);
  padding: 32px 0;
  margin-top: 60px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* ---- Admin ---- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--color-cream);
  border-right: 1px solid var(--color-line);
  padding: 24px 16px;
}
.admin-sidebar h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar a {
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 0.95rem;
  border: none;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: var(--color-cream-dark);
}
.admin-main { padding: 32px 40px; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.admin-stat {
  background: white;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.admin-stat .label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-stat .value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  margin-top: 4px;
}

/* ---- Utilities ---- */
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.section { padding: 60px 0; }
.section-tight { padding: 32px 0; }
.flex { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

@media (max-width: 720px) {
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .nav-links { flex-wrap: wrap; }
  .hero { padding: 50px 0; }
  .hero h1 { font-size: 2.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid var(--color-line); }
  h1 { font-size: 2rem; }
}

/* ---- Quote builder (admin) ---- */
.quote-builder {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-top: 18px;
}
.quote-side { position: sticky; top: 24px; align-self: start; }
.quote-side-total {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--color-sage-dark);
  margin: 6px 0 14px;
}
.quote-side-lines {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  border-top: 1px solid var(--color-line);
}
.quote-side-lines li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-line);
  color: var(--color-text-muted);
}
.quote-side-lines li:last-child { border-bottom: none; }

@media (max-width: 800px) {
  .quote-builder { grid-template-columns: 1fr; }
  .quote-side { position: static; }
}

/* ---- Service area map ---- */
.service-area-map {
  width: 100%;
  height: 460px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-line);
  background: #e8e4d8;  /* fallback while tiles load */
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.leaflet-popup-content strong { font-family: var(--font-serif); }

/* ---- Admin header (page title + actions) ---- */
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-header > div { flex: 1; min-width: 200px; }
.admin-header h1, .admin-header h3 { margin-bottom: 4px; }

/* ---- Photo gallery ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.photo-card {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-line);
  background: var(--color-cream-tint);
  box-shadow: var(--shadow-sm);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.photo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-card:focus-visible {
  outline: 3px solid var(--color-terracotta);
  outline-offset: 3px;
}
.empty-gallery {
  text-align: center;
  padding: 32px 24px;
}

/* ---- Forms (contact, booking, etc.) ---- */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text);
}
.form-row .req { color: var(--color-terracotta); }
.form-row .optional { font-weight: 400; color: var(--color-text-muted); font-size: 0.85em; }
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: #fff;
  font: inherit;
  color: var(--color-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.form-row textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: 0 0 0 3px rgba(122, 155, 118, 0.25);
}
.form-row input[aria-invalid="true"],
.form-row textarea[aria-invalid="true"] {
  border-color: var(--color-terracotta);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.form-actions .text-muted { margin: 0; font-size: 0.9em; }

/* Honeypot — hidden via CSS, not display:none (bats check for that) */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

/* ---- Admin inbox ---- */
.inbox-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}
.inbox-filter {
  padding: 8px 14px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  background: var(--color-cream-tint);
  transition: background 120ms ease, color 120ms ease;
}
.inbox-filter:hover {
  background: var(--color-sage-tint);
  color: var(--color-text);
}
.inbox-filter.is-active {
  background: var(--color-sage);
  color: #fff;
  border-color: var(--color-sage-dark);
}
.inbox-filter .count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.4);
  font-size: 0.8em;
}
.inbox-filter.is-active .count { background: rgba(255,255,255,0.3); }
.inbox-card {
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.inbox-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.inbox-card-meta {
  margin: 4px 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-new { background: var(--color-terracotta); color: #fff; }
.inbox-card-body pre {
  margin: 0;
  padding: 12px 14px;
  background: var(--color-cream-tint);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-line);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.inbox-card-actions form { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Button variants ---- */
.btn-sm {
  padding: 5px 12px;
  font-size: 0.85rem;
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-line);
}
.btn-ghost:hover {
  background: var(--color-cream-tint);
  color: var(--color-text);
}

/* Footer admin link — small and unobtrusive so it doesn't scream
   "admin" at random visitors. Still visible enough that Gwen can
   find it. */
.footer-admin-link {
  font-size: 0.85em;
  opacity: 0.6;
}
.footer-admin-link:hover { opacity: 1; }

/* Footer two-row layout — links on top, copyright + admin on bottom */
.footer-links {
  margin-bottom: 0.25rem;
}
.footer-links a {
  margin: 0 0.25rem;
}
