/* Styles for logged-in pages, auth pages and the admin panel. Builds on the tokens in styles.css. */

:root {
  --line: #e6d9c4;
  --danger: #b5382a;
  --ok: #1f7a4d;
}

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; }
.pre { white-space: pre-line; }
.small-center { text-align: center; font-size: .92rem; margin: 14px 0 0; }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 500;
  color: var(--ink); cursor: pointer;
}
.link-button:hover { color: var(--primary); }
.link-button.danger { color: var(--danger); }
.nav-links .link-button { font-weight: 500; }

.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; padding-inline: .6em; }
.btn-danger-ghost:hover { background: #fbeae7; color: var(--danger); border-color: #fbeae7; }
.btn-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-group form { margin: 0; }

/* Flash messages */
.flash {
  padding: 14px 18px; border-radius: 12px; margin: 0 0 20px; font-weight: 500;
  background: #e6f3ec; color: var(--ok); border: 1px solid #c6e3d2;
}
.flash-error { background: #fbeae7; color: var(--danger); border-color: #f2cbc4; }
.flash ul { margin: 0; padding-left: 18px; }
.home-flash { margin-top: 16px; }

/* Auth pages */
.auth-page { min-height: calc(100vh - var(--header-h) - 200px); display: grid; place-items: center; padding: 56px 16px; }
.auth-card {
  width: min(460px, 100%); background: var(--white); border-radius: 24px; padding: 36px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 2rem; }
.auth-card.center .btn { margin: 6px 4px 0; }
.error-emoji { font-size: 3rem; margin: 0; }

/* Forms */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
.form label small, .form legend small { color: var(--muted); font-weight: 400; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]),
.form select,
.form textarea,
.filter-bar input,
.filter-bar select {
  font: inherit; font-weight: 400; padding: 11px 14px; border: 1px solid var(--sand-200);
  border-radius: 10px; background: var(--sand-50); color: var(--ink); width: 100%;
}
.form input:disabled { opacity: .65; }
.form input:focus, .form select:focus, .form textarea:focus, .filter-bar input:focus, .filter-bar select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.form input[type=file] { font: inherit; font-size: .9rem; }
.form .check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.form .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.form fieldset { border: 0; padding: 0 0 8px; margin: 0; display: grid; gap: 16px; }
.form fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 22px; }
.form legend { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; padding: 0; margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-icon { grid-template-columns: 110px 1fr; }
.checks { display: grid; gap: 10px; align-content: end; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.form-actions.spread { justify-content: space-between; align-items: center; }
.narrow-form { max-width: 760px; }

.photo-field { display: flex; gap: 20px; align-items: center; }

/* Choice cards (booking form) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body {
  display: grid; gap: 2px; padding: 16px; border: 2px solid var(--sand-200); border-radius: 14px;
  background: var(--white); height: 100%; transition: border-color .15s, background .15s;
}
.choice-row { display: flex; align-items: center; gap: 12px; }
.choice-body small { color: var(--muted); font-weight: 400; }
.choice-icon { font-size: 1.6rem; }
.choice input:checked + .choice-body { border-color: var(--accent); background: #f7ece7; }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--accent); outline-offset: 2px; }

.estimate {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 16px;
  background: var(--sand-100); border-radius: 14px; padding: 16px 20px;
}
.estimate strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); grid-row: span 2; }
.estimate small { color: var(--muted); }

/* App pages */
.app-page { padding: 40px 0 72px; min-height: 70vh; }
.narrow-app { width: min(820px, 100% - 32px); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.page-head .muted { font-weight: 400; }
.page-head .status { margin-right: 8px; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; }
.tabs a {
  padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: .78rem; background: var(--sand-100); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }

.panel { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 10px rgba(74, 47, 26, .06); margin-bottom: 24px; }
.panel h2 { font-size: 1.3rem; }
.panel h3 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; margin: 18px 0 4px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.panel-head a { font-weight: 500; font-size: .92rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-row-5 { grid-template-columns: repeat(5, 1fr); }
.stat {
  background: var(--white); border-radius: var(--radius); padding: 20px; display: grid; gap: 4px;
  box-shadow: 0 2px 10px rgba(74, 47, 26, .06); text-decoration: none; color: var(--ink);
}
.stat-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .9rem; }
.stat-alert .stat-num { color: var(--primary); }
a.stat:hover { box-shadow: var(--shadow); }

.list { list-style: none; padding: 0; margin: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 4px; text-decoration: none; color: var(--ink);
}
.list-link:hover strong { color: var(--primary); }
.list-link small, .pet-line small { display: block; color: var(--muted); font-size: .86rem; }
.list-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px; }
.chev { color: var(--muted); font-size: 1.4rem; }
.pet-line { display: flex; align-items: center; gap: 18px; }

.empty-hero {
  text-align: center; background: var(--white); border: 2px dashed var(--sand-200);
  border-radius: var(--radius); padding: 40px 24px; margin-bottom: 24px;
}
.empty-hero > span { font-size: 2.6rem; }
.empty-hero p { color: var(--muted); max-width: 440px; margin-inline: auto; }

/* Status badges */
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status-pending { background: #fdf0d9; color: #96600b; }
.status-confirmed { background: #f1e1da; color: var(--cocoa); }
.status-completed { background: #e6f3ec; color: var(--ok); }
.status-cancelled { background: #f4e4e1; color: var(--danger); }

/* Avatars */
.avatar { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--white); box-shadow: 0 2px 8px rgba(74, 47, 26, .12); }
.avatar-emoji { display: grid; place-items: center; background: var(--sand-100); font-size: 3rem; }
.avatar-sm { width: 96px; height: 96px; font-size: 2.6rem; }
.avatar-lg { width: 180px; height: 180px; font-size: 5rem; }
.avatar-xl { width: 240px; height: 240px; font-size: 6.5rem; }

/* Pets */
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.pet-card {
  background: var(--white); border-radius: var(--radius); padding: 28px 20px; text-align: center;
  text-decoration: none; color: var(--ink); display: grid; justify-items: center; gap: 4px;
  box-shadow: 0 2px 10px rgba(74, 47, 26, .06); transition: transform .2s, box-shadow .2s;
}
.pet-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pet-card h3 { margin: 10px 0 0; }
.pet-card p { margin: 0 0 8px; }
.hint-chip, .ok-chip { font-size: .78rem; padding: 3px 10px; border-radius: 999px; font-weight: 500; }
.hint-chip { background: #fdf0d9; color: #96600b; }
.ok-chip { background: #e6f3ec; color: var(--ok); }
.pet-hero { display: flex; align-items: center; gap: 24px; margin: 8px 0 28px; }
.pet-hero h1 { margin: 0 0 4px; }
.pet-hero p { margin: 0; }

.details { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.details dt { color: var(--muted); font-size: .92rem; }
.details dd { margin: 0; }

.welcome-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; font-size: .88rem; font-weight: 500; }
.welcome-steps span { padding: 6px 14px; border-radius: 999px; background: var(--white); color: var(--muted); border: 1px solid var(--line); }
.welcome-steps .done { color: var(--ok); border-color: #c6e3d2; background: #e6f3ec; }
.welcome-steps .current { color: var(--white); background: var(--accent); border-color: var(--accent); }

/* Timeline */
.timeline { list-style: none; padding: 0 0 0 18px; margin: 8px 0 20px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 8px; }
.timeline li::before {
  content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--white);
}
.timeline li.timeline-system::before { background: var(--sand-200); }
.timeline-meta { font-size: .8rem; color: var(--muted); }
.timeline p { margin: 2px 0 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--sand-50); }
.table a { font-weight: 600; text-decoration: none; }
.icon-cell { font-size: 1.4rem; width: 40px; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input { flex: 1 1 260px; width: auto; }
.filter-bar select { width: auto; }

/* Homepage booking CTA */
.book-cta { display: grid; gap: 20px; }
.book-cta-card { background: var(--white); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.book-cta-card p { color: var(--muted); }
.book-cta-alt { box-shadow: none; border: 1px solid var(--sand-200); background: transparent; }
.book-cta-icon { font-size: 2rem; }

/* Admin shell */
.admin-body .site-footer, .admin-body .wa-float { display: none; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--header-h)); }
.admin-side { background: var(--white); border-right: 1px solid var(--line); padding: 24px 14px; display: flex; flex-direction: column; gap: 2px; }
.admin-side a { padding: 9px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .94rem; }
.admin-side a:hover { background: var(--sand-100); }
.admin-side a.active { background: #f1e1da; color: var(--cocoa); }
.admin-side-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 16px 12px 6px; font-weight: 600; }
.admin-side-label:first-child { margin-top: 0; }
.admin-side-view { margin-top: auto; color: var(--accent) !important; }
.admin-main { padding: 32px clamp(16px, 3vw, 40px) 64px; min-width: 0; }
.faq-edit summary { padding: 0; font-weight: 600; }
.faq-edit[open] summary { margin-bottom: 16px; }
.faq-edit summary::after { right: 0; }

@media (max-width: 1100px) {
  .stat-row-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; gap: 4px; }
  .admin-side a { white-space: nowrap; }
  .admin-side-label { display: none; }
  .admin-side-view { margin-top: 0; }
}

@media (max-width: 820px) {
  .nav-links .inline-form { padding: 12px 0; border-bottom: 1px solid var(--sand-200); }
}

@media (max-width: 560px) {
  :root { --header-h: 88px; }
  .hero { border-radius: 0 0 28px 28px; }
  .site-header .logo { font-size: 2.6rem; }
  .site-header .logo-paw { width: 46px; height: 46px; }
  .site-header .logo-text { padding-top: 12px; }
  .field-row, .field-row-icon { grid-template-columns: 1fr; }
  .stat-row, .stat-row-5 { grid-template-columns: 1fr 1fr; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 10px; }
  .auth-card { padding: 26px 20px; }
  .panel { padding: 18px; }
  .pet-hero { flex-direction: column; text-align: center; }
  .avatar-xl { width: 200px; height: 200px; }
  .photo-field { flex-direction: column; align-items: flex-start; }
}

/* Admin: homepage background settings */
.bg-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bg-panel { display: grid; gap: 16px; }
.bg-panel[hidden] { display: none; }
.color-field { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.color-field input[type=color] {
  width: 64px; height: 44px; padding: 3px; border: 1px solid var(--sand-200); border-radius: 10px;
  background: var(--white); cursor: pointer;
}
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--sand-200); cursor: pointer; padding: 0; }
.swatch:hover { box-shadow: 0 0 0 2px var(--primary); }
.form input[type=range] { width: 100%; accent-color: var(--primary); }

.bg-preview-wrap { display: grid; gap: 6px; }
.bg-preview {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: center;
  min-height: 190px; padding: 24px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--sand-100); overflow: hidden;
}
.bg-preview-text { display: grid; gap: 4px; font-family: var(--font-display); }
.bg-preview-text strong { font-size: 1.35rem; line-height: 1.15; color: var(--ink); font-weight: 600; }
.bg-preview-text .bg-preview-highlight { color: var(--accent); }
.bg-preview-eyebrow { font-family: var(--font-body); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.bg-preview-btn { justify-self: start; margin-top: 8px; font-family: var(--font-body); font-size: .72rem; font-weight: 600; color: var(--white); background: var(--primary); padding: 6px 12px; border-radius: 999px; }
.bg-preview-art { aspect-ratio: 1; border-radius: 14px; background: linear-gradient(180deg, #f6eadb 0%, #ecd9c4 55%, #e2c7b0 100%); box-shadow: var(--shadow); }
.bg-preview.no-art { grid-template-columns: 1fr; }
.bg-preview.no-art .bg-preview-art { display: none; }

@media (max-width: 560px) {
  .bg-options { grid-template-columns: 1fr; }
}

/* Admin: picture on the right of the banner */
.art-settings { display: grid; gap: 14px; padding-top: 18px; border-top: 1px dashed var(--line); }
.art-settings h3 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.art-controls { display: grid; gap: 10px; flex: 1; }
.art-thumb {
  width: 120px; height: 120px; flex-shrink: 0; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(180deg, #f6eadb 0%, #ecd9c4 55%, #e2c7b0 100%) center / cover;
  box-shadow: 0 2px 8px rgba(74, 47, 26, .12);
}
.art-thumb span { font-size: .78rem; color: var(--muted); }
.art-thumb:not(.is-empty) span { display: none; }
.bg-preview-art { position: relative; }
.bg-preview-card { position: absolute; left: 8%; bottom: 26%; width: 48%; height: 14%; background: var(--white); border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.bg-preview-card-2 { left: auto; right: 8%; bottom: 10%; }
.bg-preview.no-cards .bg-preview-card { display: none; }

/* Admin: design page */
.design-jump { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.design-jump a {
  padding: 8px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .9rem;
}
.design-jump a:hover { border-color: var(--primary); }
.design-block { scroll-margin-top: calc(var(--header-h) + 16px); }
.design-block > h2 { margin-bottom: 6px; }
.section-list { display: grid; gap: 10px; margin-top: 16px; }
.section-item { border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; background: var(--white); scroll-margin-top: calc(var(--header-h) + 16px); }
.section-item summary { display: flex; align-items: center; gap: 14px; padding: 14px 32px 14px 0; font-weight: 500; }
.section-item summary small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.section-item[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.section-item > form { padding-bottom: 18px; }
.section-swatch { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; border: 1px solid var(--line); background: var(--sand-100); }
.section-preview {
  display: grid; gap: 6px; justify-items: center; text-align: center; padding: 28px 16px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--sand-50); font-family: var(--font-display);
}
.section-preview strong { font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.section-preview-card { width: 60%; height: 36px; background: var(--white); border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.08); margin-top: 6px; }
.page-color-form { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-color-form .form-actions { margin: 0; }

/* Admin: service photo */
.service-thumb { width: 120px; height: 90px; border-radius: 12px; object-fit: cover; flex-shrink: 0; box-shadow: 0 2px 8px rgba(74, 47, 26, .12); }
.service-thumb-empty { display: grid; place-items: center; font-size: 2.6rem; background: var(--sand-100); box-shadow: none; }
.service-thumb-sm { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; display: block; }

/* Admin: gallery */
.upload-preview { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.gallery-item { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--white); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery-item form { padding: 14px; gap: 10px; }
.gallery-item-row { display: flex; gap: 8px; align-items: end; }
.gallery-item-row label { flex: 1; }

/* Homepage: service card photo and gallery */
.card-photo { width: calc(100% + 56px); margin: -28px -28px 18px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; display: block; }
.card:has(.card-photo) { overflow: hidden; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.gallery-photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--white); box-shadow: 0 2px 10px rgba(74, 47, 26, .08); }
.gallery-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .4s ease; }
.gallery-photo:hover img { transform: scale(1.04); }
.gallery-photo figcaption { padding: 12px 16px; color: var(--muted); font-size: .92rem; }

@media (prefers-reduced-motion: reduce) {
  .gallery-photo img { transition: none; }
}

/* Booking form: minimum notice */
.field-row-3 { grid-template-columns: 1fr .8fr 1fr; }
.notice-hint {
  margin: -4px 0 0; padding: 12px 16px; border-radius: 12px; font-size: .92rem;
  background: var(--sand-100); color: var(--ink);
}
.notice-hint.notice-error { background: #fbeae7; color: var(--danger); }
@media (max-width: 560px) {
  .field-row-3 { grid-template-columns: 1fr; }
}
