/* Tapify: clean, premium and warm. Black, white and blue.
   No web fonts, no frameworks and no images: loads fast on a weak signal. */
:root {
  --ink: #0a0a0a;
  --ink-2: #1b2433;
  --muted: #566074;
  --mist: #f3f6fb;
  --card: #ffffff;
  --line: #e1e7f1;
  --blue: #1d4ed8;
  --blue-deep: #1e3a8a;
  --blue-bright: #3b82f6;
  --blue-tint: #eef3ff;
  --gradient: linear-gradient(135deg, #2f6df0 0%, #1d4ed8 55%, #1e3a8a 100%);
  --radius: 22px;
  --name-font: ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink-2);
  font: 18px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---------- brand bar ---------- */
.bar {
  position: relative;
  padding: 16px 24px;
  background: var(--ink);
}
.bar::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue-bright), var(--blue-deep));
}
.brand {
  color: #fff;
  font-weight: 750;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

/* Taller bar with a soft blue glow, for the finder and home pages. */
.bar--hero {
  padding: 26px 24px 120px;
  background:
    radial-gradient(120% 140% at 50% 120%, rgba(59, 130, 246, 0.55) 0%, rgba(29, 78, 216, 0.18) 45%, rgba(10, 10, 10, 0) 70%),
    var(--ink);
  text-align: center;
}

/* ---------- page ---------- */
main {
  max-width: 30rem;
  margin: 0 auto;
  padding: 32px 24px 64px;
  text-align: center;
}
main.profile { margin-top: -96px; padding-top: 0; }

h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--name-font);
  font-size: clamp(2.4rem, 11vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
h2 { margin: 0 0 6px; color: var(--ink); font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 14px; overflow-wrap: anywhere; }

.status { color: var(--muted); }
.kicker { margin: 22px 0 4px; color: var(--muted); font-size: 1.05rem; }
.owner { margin: 0 0 28px; color: var(--muted); font-size: 1.15rem; }

/* ---------- the dog's photo ---------- */
.photo {
  display: block;
  width: 62vw;
  max-width: 13rem;
  height: auto; /* the width/height attributes on the <img> would otherwise stretch it */
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #dbe6ff, #b9ceff);
  box-shadow: 0 0 0 6px #fff, 0 0 0 9px rgba(59, 130, 246, 0.35), 0 22px 40px -14px rgba(10, 20, 60, 0.55);
  animation: arrive 0.5s ease-out both;
}
.photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.75rem;
}
@keyframes arrive {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* ---------- buttons ---------- */
.button {
  display: block;
  min-height: 68px;
  padding: 18px 22px;
  border-radius: 20px;
  background: var(--gradient);
  box-shadow: 0 14px 26px -12px rgba(29, 78, 216, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.button:active { transform: translateY(1px); filter: brightness(0.94); }
.button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

button.button {
  width: 100%;
  margin-top: 10px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
button.button:disabled { opacity: 0.6; cursor: wait; }

.button--ghost {
  background: #fff;
  box-shadow: none;
  border: 2px solid var(--blue) !important;
  color: var(--blue);
}
.button--ghost:active { background: var(--blue-tint); filter: none; }

.number { margin: 14px 0 32px; color: var(--muted); font-size: 1.1rem; letter-spacing: 0.02em; }

/* ---------- details on the finder page ---------- */
.notes {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
}
.notes--medical { background: var(--blue-tint); border-color: #cfdcfb; }
/* Keep the owner's line breaks in commands and notes. */
.notes p { margin: 0; white-space: pre-line; }

/* ---------- owner pages ---------- */
main.owner { max-width: 34rem; text-align: left; }
main.owner h1 { font-size: 2rem; }
main.owner h3 { margin: 30px 0 4px; color: var(--ink); font-size: 1.1rem; font-weight: 700; }
.lead { color: var(--muted); }
.whoami { margin-bottom: 20px; color: var(--muted); font-size: 0.95rem; }

.field { margin: 0 0 18px; }
.field label, .label-like { display: block; margin: 0 0 6px; color: var(--ink); font-weight: 650; font-size: 1rem; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }

input[type='text'], input[type='email'], input[type='password'], select, textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid #c9d3e6;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.45);
  outline-offset: 1px;
  border-color: var(--blue);
}

button.link {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
main.owner h3 + .hint { margin: 0 0 20px; }
p.switch { margin: 22px 0 0; text-align: center; }

.card {
  margin: 22px 0;
  padding: 24px 20px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -28px rgba(10, 20, 60, 0.35);
}
.card h2 { margin-bottom: 10px; font-family: var(--name-font); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }

.msg { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; font-size: 0.95rem; }
.msg--error { background: #fdecec; color: #8a1c1c; border: 1px solid #f3b4b4; }
.msg--ok { background: var(--blue-tint); color: var(--blue-deep); border: 1px solid #cfdcfb; }

/* "Show to finders" switches: clear on/off state, big enough to tap. */
.detail { margin: 0 0 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.detail:last-of-type { border-bottom: 0; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.share-label { display: flex; flex-direction: column; gap: 2px; color: var(--ink); font-weight: 650; }
.share-state { font-size: 0.85rem; font-weight: 400; }
.share-state--on { color: var(--blue); }
.share-state--off { color: var(--muted); }

input.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 58px;
  height: 34px;
  margin: 0;
  border-radius: 17px;
  background: #b9c3d6;
  cursor: pointer;
  transition: background 0.15s;
}
input.switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(10, 20, 60, 0.3);
  transition: transform 0.15s;
}
input.switch:checked { background: var(--gradient); }
input.switch:checked::before { transform: translateX(24px); }
input.switch:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
input.switch:disabled { opacity: 0.5; cursor: not-allowed; }

/* photo picker */
.photo-preview {
  display: block;
  width: 128px;
  height: 128px;
  margin: 6px 0 14px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #dbe6ff, #b9ceff);
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(59, 130, 246, 0.4);
}
.photo-actions { display: flex; align-items: center; gap: 16px; }
.photo-actions .button { flex: 1; min-height: 56px; margin-top: 0; font-size: 1.05rem; }

@media (prefers-reduced-motion: reduce) {
  .photo { animation: none; }
  input.switch, input.switch::before { transition: none; }
}

/* a notice that follows a button needs a little air */
.button + .msg { margin-top: 18px; }

/* pause / replace link */
.tag-controls { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--line); }
.notice { background: #eef3ff; border: 1px solid #cfdcfb; border-radius: 16px; padding: 16px 18px; margin-top: 8px; }
.notice p { margin: 0 0 12px; }
.notice .strong { font-weight: 650; }
.notice input[readonly] { font-size: 0.9rem; }

/* privacy page and small footer links */
main.prose { text-align: left; }
main.prose h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
main.prose h2 { margin: 28px 0 8px; font-size: 1.2rem; }
main.prose ul { margin: 0 0 14px; padding-left: 1.2rem; }
main.prose li { margin: 0 0 10px; }
main.prose .lead { color: var(--muted); font-size: 1.1rem; }
.draft { padding: 12px 16px; border-radius: 14px; background: #fff4cc; border: 1px solid #f0d77a; color: #5c4600; font-size: 0.95rem; }
.todo { background: #fff4cc; border-radius: 6px; padding: 0 4px; }
.legal { margin: 28px 0 0; text-align: center; font-size: 0.9rem; }
.legal a { color: var(--muted); }

/* delete account */
.danger-zone { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--line); text-align: left; }
.button--danger { background: #b42318; background-image: none; box-shadow: none; color: #fff; }
.button--ghost.button--danger { background: transparent; color: #b42318; border: 2px solid #b42318; }
.notice ul { margin: 0 0 12px; padding-left: 1.2rem; }
