/* RoadDog signup page — minimal, brand-rust accent, mobile-first. */

:root {
  --rd-rust: #772402;
  --rd-rust-hover: #8d2a05;
  --rd-ink: #1a1a1a;
  --rd-muted: #6b6b6b;
  --rd-bg: #f7f4f0;
  --rd-card: #ffffff;
  --rd-border: #e1ddd8;
  --rd-error: #b00020;
  --rd-error-bg: #fdecea;
  --rd-radius: 10px;
}

body { background: var(--rd-bg); }

.rd-signup-wrap {
  max-width: 640px;
  margin: 32px auto;
  padding: 0 16px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--rd-ink);
}

.rd-signup-card {
  background: var(--rd-card);
  border: 1px solid var(--rd-border);
  border-radius: var(--rd-radius);
  padding: 32px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.rd-signup-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--rd-rust);
}

.rd-signup-sub {
  font-size: 16px;
  color: var(--rd-muted);
  margin: 0 0 24px 0;
}

.rd-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.rd-fieldset legend {
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rd-muted);
  margin-bottom: 12px;
}

.rd-row {
  margin-bottom: 14px;
}

.rd-row-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rd-row label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--rd-ink);
}

.rd-req { color: var(--rd-rust); }
.rd-opt { color: var(--rd-muted); font-weight: 400; font-size: 12px; }

.rd-row input,
.rd-row select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid var(--rd-border);
  border-radius: 6px;
  background: white;
  color: var(--rd-ink);
  box-sizing: border-box;
}

.rd-row input:focus,
.rd-row select:focus {
  outline: 2px solid var(--rd-rust);
  outline-offset: -1px;
  border-color: var(--rd-rust);
}

.rd-row input.rd-invalid {
  border-color: var(--rd-error);
}

.rd-hint {
  font-size: 12px;
  color: var(--rd-muted);
  margin-top: 4px;
}

.rd-error {
  background: var(--rd-error-bg);
  color: var(--rd-error);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin: 16px 0;
}

.rd-warning {
  background: #fff8e1;
  border: 1px solid #f4d57d;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 14px;
  margin: 16px 0;
}

.rd-warning input {
  display: block;
  margin-top: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--rd-border);
  border-radius: 4px;
  box-sizing: border-box;
}

.rd-submit {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  background: var(--rd-rust);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.rd-submit:hover { background: var(--rd-rust-hover); }
.rd-submit:disabled {
  background: var(--rd-muted);
  cursor: not-allowed;
}

/* Anchor styled as the rust submit button (e.g. "Sign back in"). */
a.rd-submit,
a.rd-submit--link {
  display: inline-block;
  width: auto;
  min-width: 180px;
  padding: 12px 28px;
  text-align: center;
  text-decoration: none;
  color: white;
}
a.rd-submit:hover,
a.rd-submit--link:hover {
  color: white;
  text-decoration: none;
}

.rd-tos {
  font-size: 12px;
  color: var(--rd-muted);
  margin: 16px 0 0 0;
  text-align: center;
}

.rd-tos a {
  color: var(--rd-rust);
  text-decoration: underline;
}

.rd-verify-card {
  text-align: center;
}

.rd-verify-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.rd-verify-help {
  text-align: left;
  background: var(--rd-bg);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
}

.rd-verify-help ul { margin: 8px 0; padding-left: 20px; }
.rd-verify-help li { margin-bottom: 4px; }

@media (max-width: 480px) {
  .rd-signup-card { padding: 20px; }
  .rd-signup-title { font-size: 22px; }
  .rd-row-inline { grid-template-columns: 1fr; }
}

/* ===========================================================================
 * Profile page (multi-section /profile)
 * ========================================================================= */
.rd-profile-wrap {
  max-width: 720px;
  margin: 32px auto;
  padding: 0 16px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--rd-ink);
}

.rd-profile-header {
  margin-bottom: 16px;
}

.rd-profile-section {
  margin-bottom: 20px;
}

.rd-profile-section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--rd-ink);
  border-bottom: 1px solid var(--rd-border);
  padding-bottom: 8px;
}

.rd-profile-subsection {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  gap: 12px;
}

.rd-profile-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rd-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.rd-profile-current-email {
  flex: 1;
}

.rd-profile-current-email span:last-child {
  font-weight: 500;
  color: var(--rd-ink);
}

.rd-profile-divider {
  border: none;
  border-top: 1px solid var(--rd-border);
  margin: 16px 0;
}

.rd-link-button {
  background: transparent;
  border: 1px solid var(--rd-rust);
  color: var(--rd-rust);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.rd-link-button:hover,
.rd-link-button:focus {
  background: var(--rd-rust);
  color: white;
  text-decoration: none;
}

.rd-button-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rd-button-row .rd-submit {
  flex: 1;
}

.rd-submit--inline {
  display: inline-block;
  width: auto;
  text-decoration: none;
  padding: 10px 18px;
  font-size: 14px;
  margin-top: 8px;
}

.rd-tag-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
}

.rd-tag-list__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rd-border);
}
.rd-tag-list__item:last-child { border-bottom: none; }

.rd-tag-list__photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.rd-tag-list__photo--placeholder {
  background: var(--rd-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.rd-tag-list__info {
  flex: 1;
  min-width: 0;
}

.rd-tag-list__name {
  font-size: 15px;
}

.rd-tag-list__meta {
  font-size: 13px;
  color: var(--rd-muted);
}

.rd-tag-list__token {
  font-size: 12px;
  color: var(--rd-muted);
  margin-top: 2px;
}
.rd-tag-list__token code {
  background: var(--rd-bg);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--rd-ink);
}

.rd-tag-list__actions {
  font-size: 13px;
  flex-shrink: 0;
}
.rd-tag-list__actions a {
  color: var(--rd-rust);
  text-decoration: none;
}
.rd-tag-list__actions a:hover { text-decoration: underline; }

.rd-profile-buy-more {
  margin-top: 12px;
  text-align: center;
}

.rd-profile-footer {
  margin-top: 24px;
  text-align: center;
}

@media (max-width: 480px) {
  .rd-profile-subsection {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .rd-profile-subsection .rd-link-button {
    align-self: stretch;
  }
}

/* ===========================================================================
 * Pet edit page (/pet/{id}/edit)
 * ========================================================================= */
.rd-pet-photo-card {
  text-align: center;
}

.rd-pet-photo {
  max-width: 240px;
  max-height: 240px;
  width: auto;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 0 auto 8px auto;
  object-fit: cover;
}

/* Profile (read-only) section above the edit form. Photo on the left,
 * key facts on the right; collapses to single column on narrow screens. */
.rd-pet-profile-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}

.rd-pet-profile-photo .rd-pet-photo {
  max-width: 160px;
  max-height: 160px;
  margin: 0;
}

.rd-pet-profile-dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  font-size: 14px;
  line-height: 1.4;
}
.rd-pet-profile-dl dt {
  color: var(--rd-muted);
  font-weight: 500;
}
.rd-pet-profile-dl dd {
  margin: 0;
  color: #1f2937;
}

@media (max-width: 600px) {
  .rd-pet-profile-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: left;
  }
  .rd-pet-profile-dl {
    width: 100%;
  }
}

/* "Edit profile" heading that introduces the form below the profile. */
.rd-pet-edit-title {
  margin: 24px 0 12px 0;
  padding: 0;
  border: none;
  font-size: 18px;
  color: #1f2937;
}

/* Section head — title on the left, "Edit profile" (or similar) action on
 * the right. Used on /profile for the contact-info section. */
.rd-profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.rd-profile-section-head .rd-profile-section-title {
  margin: 0;
}

/* Pet documents card — list of uploaded docs grouped by type + add form. */
.rd-pet-docs-list {
  margin: 12px 0;
}
.rd-pet-docs-group {
  margin-bottom: 16px;
}
.rd-pet-docs-group-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rd-muted);
  margin: 0 0 6px 0;
}
.rd-pet-docs-items {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rd-pet-docs-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.rd-pet-docs-item:first-child {
  border-top: none;
}
.rd-pet-docs-item-main {
  flex: 1;
  min-width: 0;
}

/* Thumbnail — left of each row. 112px square. Image docs show the image
 * itself; PDFs get the rendered page-1 preview (or a "PDF" badge if the
 * renderer wasn't available); everything else gets a page glyph. */
.rd-pet-docs-thumb {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  text-decoration: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.rd-pet-docs-thumb:hover,
.rd-pet-docs-thumb:focus {
  border-color: var(--rd-rust);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}
.rd-pet-docs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rd-pet-docs-thumb--pdf {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}
.rd-pet-docs-thumb-label {
  color: #b91c1c;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.10em;
}
.rd-pet-docs-thumb--file {
  background: #f4efe9;
}
.rd-pet-docs-thumb-glyph {
  font-size: 48px;
  line-height: 1;
}
.rd-pet-docs-item-title {
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
}
.rd-pet-docs-item-title:hover,
.rd-pet-docs-item-title:focus {
  color: var(--rd-rust);
  text-decoration: underline;
}
.rd-pet-docs-item-meta {
  font-size: 12px;
  color: var(--rd-muted);
  margin-top: 2px;
}
.rd-pet-docs-tier {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.rd-pet-docs-tier--vet {
  background: #eef2f7;
  color: #475569;
}
.rd-pet-docs-tier--public {
  background: #f4efe9;
  color: var(--rd-rust);
}
.rd-pet-docs-delete {
  color: #b91c1c;
  font-size: 13px;
  flex-shrink: 0;
}
.rd-pet-docs-delete:hover,
.rd-pet-docs-delete:focus {
  color: #7f1d1d;
}
.rd-pet-docs-add {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

/* Native visible file inputs, one per device class. CSS hides each
 * based on pointer type. The native input IS the tap target — no
 * overlays, no JS triggers, just the browser doing its job. */
.rd-pet-docs-upload-row {
  margin-top: 12px;
}
.rd-pet-docs-upload-zone {
  padding: 16px;
  background: #fff;
  border: 2px dashed var(--rd-rust);
  border-radius: 10px;
}
.rd-pet-docs-upload-label {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--rd-muted);
  line-height: 1.4;
}
.rd-pet-docs-native-input {
  display: block;
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 0;
  cursor: pointer;
}

/* Desktop: show only the multi-file browse zone. */
@media (hover: hover) and (pointer: fine) {
  .rd-pet-docs-upload-zone--camera { display: none !important; }
}

/* Mobile: show only the camera-capture zone. People aren't going to
 * scroll through their downloads folder on a phone — they'll snap
 * a photo of the document right there. */
@media (hover: none), (pointer: coarse) {
  .rd-pet-docs-upload-zone--browse { display: none !important; }
}
.rd-pet-docs-upload-btn,
.rd-pet-docs-upload-btn > span {
  /* color: applied on the label + child spans because some browsers /
   * themes inherit a darker color from a surrounding rule, leaving the
   * text black on the rust background. Spelling it on both prevents
   * the override. */
  color: #fff !important;
}
.rd-pet-docs-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--rd-rust);
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
  text-decoration: none;
}
.rd-pet-docs-upload-btn:hover,
.rd-pet-docs-upload-btn:focus-within {
  background: var(--rd-rust-hover);
}
.rd-pet-docs-upload-btn--camera {
  background: transparent;
  border: 1px solid var(--rd-rust);
}

/* Hide the camera button on devices that have a mouse/trackpad (i.e.
 * desktops + laptops). The capture="environment" attribute is only
 * useful on touch devices with a real camera; on a desktop it just
 * opens the same file picker as the Browse Files button — confusing. */
@media (hover: hover) and (pointer: fine) {
  .rd-pet-docs-upload-btn--camera {
    display: none !important;
  }
}
.rd-pet-docs-upload-btn--camera,
.rd-pet-docs-upload-btn--camera > span {
  /* Camera button is outlined — text is rust, only flips to white on
   * hover/focus when the background fills in. */
  color: var(--rd-rust) !important;
}
.rd-pet-docs-upload-btn--camera:hover,
.rd-pet-docs-upload-btn--camera:focus-within {
  background: var(--rd-rust);
}
.rd-pet-docs-upload-btn--camera:hover,
.rd-pet-docs-upload-btn--camera:focus-within,
.rd-pet-docs-upload-btn--camera:hover > span,
.rd-pet-docs-upload-btn--camera:focus-within > span {
  color: #fff !important;
}
.rd-pet-docs-progress {
  margin-top: 10px;
  padding: 8px 12px;
  background: #f4efe9;
  border-left: 3px solid var(--rd-rust);
  border-radius: 4px;
  font-size: 13px;
  color: #1f2937;
}
.rd-pet-docs-progress--error {
  background: #fef2f2;
  border-left-color: #b91c1c;
  color: #7f1d1d;
}

/* Doc row layout — row container so Edit + Delete sit on the right,
 * inline edit form expands below it when the Edit button is clicked. */
.rd-pet-docs-item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.rd-pet-docs-item-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.rd-pet-docs-edit-form {
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}
.rd-pet-docs-edit-form .rd-row { margin-bottom: 10px; }
.rd-pet-docs-edit-form label {
  font-size: 13px;
  font-weight: 600;
}

/* Share via email panel — same visual rhythm as the upload form, sits
 * between the docs list and the "+ Add document" link. */
.rd-pet-docs-share {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}
#rd-pet-docs-share-form {
  margin-top: 12px;
}
.rd-pet-docs-share-picker {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  max-height: 200px;
  overflow-y: auto;
}
.rd-pet-docs-share-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rd-pet-docs-share-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 14px;
}
.rd-pet-docs-share-list__type {
  font-weight: 600;
  color: #1f2937;
}
.rd-pet-docs-share-list__title {
  color: #4b5563;
}

/* Share recipient viewer page (/share/{token}). */
.rd-share-wrap {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 16px;
}
.rd-share-note {
  background: #f4efe9;
  border-left: 3px solid var(--rd-rust);
  padding: 12px 14px;
  border-radius: 4px;
  margin: 14px 0;
}
.rd-share-note__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rd-muted);
  margin-bottom: 4px;
}
.rd-share-note__body {
  margin: 0;
  color: #1f2937;
}

/* Photo upload — "Change photo" button below the displayed image. */
.rd-pet-photo--empty {
  width: 160px;
  height: 160px;
  background: #f4efe9;
  color: var(--rd-muted);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.rd-pet-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
/* Hard-hide the native file input so only the styled "Change photo"
 * button is visible. The label has for="rd-pet-photo-input", so clicking
 * the button opens the OS file-picker dialog directly. */
.rd-pet-photo-actions input[type="file"],
input#rd-pet-photo-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.rd-pet-photo-change {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--rd-rust);
  border: 1px solid var(--rd-rust);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.rd-pet-photo-change:hover,
.rd-pet-photo-change:focus {
  background: var(--rd-rust-hover);
  color: #fff;
}
.rd-pet-photo-change:hover,
.rd-pet-photo-change:focus {
  background: var(--rd-rust);
  color: #fff;
}
.rd-pet-photo-change[aria-disabled="true"] {
  opacity: 0.65;
  pointer-events: none;
}
.rd-pet-photo-actions .rd-hint {
  text-align: center;
  font-size: 12px;
}

.rd-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.4;
}

.rd-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0 0;
  flex-shrink: 0;
  accent-color: var(--rd-rust);
}

.rd-pet-button-row {
  margin-top: 16px;
  align-items: center;
}
.rd-pet-button-row .rd-link-button {
  flex-shrink: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
}
