/* ==========================================================
   PetLinkTag — design system
   ----------------------------------------------------------
   Palette: a warm, calm "trusted local business" register —
   deep pine for trust and primary actions, a brass/marigold
   accent (echoing tag hardware), clay and sage for status,
   on a warm paper background instead of clinical white.

   Type: Fraunces (a warm, slightly characterful serif) carries
   brand moments — the wordmark and page titles — while Inter
   does the actual work in forms, tables and data.

   Signature element: the brand-mark is a small rounded tag
   shape with a punched hole, built in pure CSS. It's a nod to
   the literal product (a tag/identity for a pet) without
   leaning on a paw-print cliché.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color */
  --color-ink:      #20281F;
  --color-paper:    #FBF8F3;
  --color-pine:     #1F4B3F;
  --color-pine-dark:#163A30;
  --color-marigold: #E0922F;
  --color-clay:     #B5512F;
  --color-sage:     #6E9468;
  --color-mist:     #E7E1D6;
  --color-mist-dark:#D5CCBB;
  --color-white:    #FFFFFF;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 2px rgba(32, 40, 31, 0.06), 0 8px 24px rgba(32, 40, 31, 0.06);
  --max-width: 1080px;
}

/* ---------- Reset & base ---------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--color-pine-dark);
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

a {
  color: var(--color-pine);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--color-marigold);
  outline-offset: 2px;
}

/* ---------- Brand mark ---------- */

.brand-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: var(--color-marigold);
  border-radius: 7px;
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-paper);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-pine-dark);
  margin-left: 0.5em;
}

/* ---------- Auth pages (login / setup) ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--color-white);
  border: 1px solid var(--color-mist);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.auth-card--wide {
  max-width: 460px;
}

.auth-card__brand {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

.auth-card__hint {
  font-size: 0.9rem;
  color: #5B6358;
  margin-top: -0.5em;
  margin-bottom: 1.5em;
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 1.1em 0 0.4em;
  color: var(--color-pine-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.65em 0.8em;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--color-mist-dark);
  border-radius: var(--radius-sm);
  background: var(--color-paper);
  color: var(--color-ink);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-pine);
  box-shadow: 0 0 0 3px rgba(31, 75, 63, 0.15);
}

.field-hint {
  font-size: 0.82rem;
  color: #5B6358;
  margin-top: 0.35em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7em 1.4em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-pine);
  color: var(--color-white);
}
.btn--primary:hover {
  background: var(--color-pine-dark);
}

.btn--block {
  width: 100%;
  margin-top: 1.4em;
}

/* ---------- Alerts & badges ---------- */

.alert {
  padding: 0.8em 1em;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin: 0 0 1em;
  list-style: none;
}
.alert--error {
  background: #FBEAE3;
  color: var(--color-clay);
  border: 1px solid #EFC9B5;
}
.alert--success {
  background: #EAF1E8;
  color: var(--color-sage);
  border: 1px solid #CFE1CB;
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  text-transform: capitalize;
}
.badge--pending   { background: #FBF1E2; color: var(--color-marigold); }
.badge--confirmed { background: #EAF1E8; color: var(--color-sage); }
.badge--completed { background: #E6ECEA; color: var(--color-pine); }
.badge--cancelled,
.badge--no_show   { background: #FBEAE3; color: var(--color-clay); }

/* ---------- App shell (admin) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-mist);
}

.topbar__brand {
  display: flex;
  align-items: center;
}

.topbar__links {
  display: flex;
  align-items: center;
  gap: 1.4em;
}

.topbar__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink);
}

.topbar__link--soon {
  color: var(--color-mist-dark);
  cursor: default;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page__header {
  margin-bottom: 24px;
}

.page__subtitle {
  color: #5B6358;
  margin-top: -0.6em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-mist);
  border-radius: var(--radius-md);
  padding: 20px;
}

.stat-card__value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-pine-dark);
}

.stat-card__label {
  font-size: 0.85rem;
  color: #5B6358;
}

.panel {
  background: var(--color-white);
  border: 1px solid var(--color-mist);
  border-radius: var(--radius-md);
  padding: 24px;
}

.empty-state {
  color: #5B6358;
  font-size: 0.95rem;
  padding: 1em 0;
}

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #5B6358;
  padding: 0.6em 0.8em;
  border-bottom: 2px solid var(--color-mist);
}

.table td {
  padding: 0.7em 0.8em;
  border-bottom: 1px solid var(--color-mist);
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .auth-card { padding: 28px 22px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
