/* Page-specific layout. Shared colors, typography, and base components
   (card, hero shell, button, badge) live in css/theme.css. */

/* ---------- Index / form page ---------- */

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="tel"],
.field input[type="email"],
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--charcoal);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 31, 118, 0.12);
}

.breed-combobox {
  position: relative;
}

.breed-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(43, 43, 43, 0.14);
  max-height: 220px;
  overflow-y: auto;
}

.breed-dropdown[hidden] {
  display: none;
}

.breed-option {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}

.breed-option:hover {
  background: var(--card-tint);
  color: var(--primary-dark);
}

.breed-option.fallback {
  color: rgba(43, 43, 43, 0.55);
  font-style: italic;
}

.age-fields {
  display: flex;
  gap: 1rem;
}

.age-fields select {
  flex: 1;
}

.species-toggle {
  display: flex;
  gap: 0.75rem;
}

.species-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.species-toggle label {
  flex: 1;
  text-align: center;
  padding: 1rem 0.5rem;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  margin: 0;
}

.species-toggle label .emoji {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.species-toggle input[type="radio"]:checked + label {
  border-color: var(--primary);
  background: var(--card-tint);
  color: var(--primary-dark);
}

.error-message {
  color: #c0392b;
  font-size: 0.9rem;
  margin-top: -0.75rem;
  margin-bottom: 1rem;
  display: none;
}

.error-message.visible {
  display: block;
}

.site-footer {
  text-align: center;
  color: rgba(43, 43, 43, 0.45);
  font-size: 0.85rem;
  padding: 1.5rem 1rem;
}

/* ---------- Result page (pet-age-reveal design) ---------- */

/* ---------- Screen flow (progress dots, nav, back link) ---------- */
.reveal-screen[hidden] {
  display: none;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px 0;
}
.progress-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border-soft);
  transition: background 0.2s ease, width 0.2s ease;
}
.progress-dots .dot.filled {
  background: var(--primary);
}
.progress-dots .dot.current {
  width: 20px;
}

.screen-topbar {
  padding-top: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  color: rgba(43, 43, 43, 0.55);
  cursor: pointer;
}
.back-link:hover {
  color: var(--primary-dark);
}

.screen-nav {
  padding: 28px 20px 0;
}

/* ---------- The Gate: blurred tips + lock overlay ---------- */
.tips-gate {
  position: relative;
}
.tips-gate .tip-text {
  filter: blur(6px);
  transition: filter 0.6s ease;
  user-select: none;
}
.tips-gate.unlocked .tip-text {
  filter: blur(0);
  user-select: text;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.lock-overlay.hidden {
  display: none;
}
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 13.5px;
  color: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(43, 43, 43, 0.14);
}

/* ---------- Tips card (clickable to open unlock modal) ---------- */
.tips-card {
  cursor: pointer;
}
.tips-card:has(.tips-gate.unlocked) {
  cursor: default;
}

/* ---------- Skip row ---------- */
#gate-skip-row {
  text-align: center;
}
.skip-hint {
  font-size: 13px;
  color: rgba(43, 43, 43, 0.5);
  margin: 0 0 12px;
}

/* ---------- Unlock modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 43, 43, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-backdrop[hidden] {
  display: none;
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 22px;
  padding: 30px 22px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(43, 43, 43, 0.25);
}
.modal-card form {
  text-align: left;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(43, 43, 43, 0.4);
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.modal-close:hover {
  color: var(--primary-dark);
}

.unlock-copy {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 16px;
  color: var(--charcoal);
}

.method-toggle {
  display: flex;
  background: var(--card-tint);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1rem;
}
.method-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--primary-dark);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.method-tab.active {
  background: var(--primary);
  color: #fff;
}

/* ---------- Share as image card ---------- */
.share-image-card {
  text-align: center;
}
.share-card-preview {
  border-radius: 18px;
  overflow: hidden;
  margin: 4px 0 16px;
  box-shadow: 0 6px 20px rgba(43, 43, 43, 0.1);
}
.share-card-preview img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--card-tint);
  aspect-ratio: 4 / 5;
}
.share-fallback-hint {
  font-size: 13px;
  color: rgba(43, 43, 43, 0.55);
  margin: 12px 0 0;
}

.hero-number {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 96px;
  line-height: 1;
  color: var(--primary);
  margin: 0;
  letter-spacing: -0.02em;
}
.hero-number-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2px 0 16px;
}

/* ---------- Quote ---------- */
.quote-section {
  padding: 26px 20px 6px;
  text-align: center;
}
.quote-text {
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(43,43,43,0.75);
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Lifespan bar ---------- */
.lifespan-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: rgba(43,43,43,0.55);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.lifespan-track {
  position: relative;
  height: 14px;
  background: var(--card-tint);
  border-radius: 999px;
  overflow: visible;
}

.lifespan-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.lifespan-marker {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 3px 8px rgba(232,31,118,0.25);
  transition: left 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.footprints {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
}
.footprints svg { color: var(--primary); opacity: 0.25; }

.lifespan-readout {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ---------- Insight line ---------- */
.insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(43,43,43,0.8);
  background: var(--card-tint);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 16px;
}
.insight svg { flex-shrink: 0; color: var(--primary-dark); margin-top: 2px; }

/* ---------- Adaptive care tips ---------- */
.tip-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}
.tip-item:last-child { border-bottom: none; }

.tip-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tip-icon.cat-health { background: rgba(181, 22, 90, 0.12); color: var(--primary-dark); }
.tip-icon.cat-diet { background: rgba(232, 31, 118, 0.12); color: var(--primary); }
.tip-icon.cat-exercise { background: rgba(15, 157, 140, 0.12); color: var(--teal); }
.tip-icon.cat-grooming { background: rgba(43, 43, 43, 0.08); color: rgba(43,43,43,0.6); }
.tip-icon.cat-vaccination { background: rgba(181, 22, 90, 0.12); color: var(--primary-dark); }
.tip-icon.cat-seasonal { background: rgba(232, 31, 118, 0.12); color: var(--primary); }
.tip-icon.cat-dental { background: rgba(15, 157, 140, 0.12); color: var(--teal); }
.tip-icon.cat-behavioral { background: rgba(43, 43, 43, 0.08); color: rgba(43,43,43,0.6); }
.tip-icon.cat-social { background: rgba(232, 31, 118, 0.12); color: var(--primary); }

.tip-body { flex: 1; min-width: 0; }
.tip-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.tip-category {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(43,43,43,0.4);
  margin: 0 0 2px;
}
.tip-title {
  font-weight: 700;
  font-size: 14.5px;
  margin: 0;
}
.tip-severity {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: 2px;
}
.tip-severity.sev-3 { background: var(--primary-dark); color: #fff; }
.tip-severity.sev-2 { background: var(--card-tint); color: var(--primary-dark); }
.tip-severity.sev-1 { background: rgba(43,43,43,0.06); color: rgba(43,43,43,0.55); }

.tip-text {
  font-size: 13.5px;
  color: rgba(43,43,43,0.62);
  line-height: 1.5;
  margin: 0;
}

/* ---------- Go deeper box ---------- */
.deeper-box {
  background: linear-gradient(150deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 22px;
  padding: 26px 22px;
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 26px rgba(181, 22, 90, 0.28);
}
.deeper-box .card-title { color: #fff; justify-content: center; }
.deeper-box p {
  font-size: 14px;
  opacity: 0.92;
  margin: 6px 0 18px;
  line-height: 1.5;
}
.deeper-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--primary-dark);
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  text-decoration: none;
}

/* ---------- Footer link ---------- */
.footer-link {
  text-align: center;
  margin-top: 36px;
}
.footer-link button {
  background: none;
  border: none;
  color: rgba(43,43,43,0.45);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-family: var(--font-body);
}

.paw-trail {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--primary);
}

@media (min-width: 480px) {
  .hero-number { font-size: 112px; }
}
