/* ============ SnoutID — warm, playful pet-science ============ */
:root {
  --cream: #FBF4E8;
  --cream-deep: #F3E7D3;
  --ink: #33221A;
  --ink-soft: #6B584C;
  --accent: #E8842A;
  --accent-dark: #C4630F;
  --green: #4E7A3A;
  --red: #B3402E;
  --card: #FFFFFF;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 10px 30px rgba(51, 34, 26, 0.10);
  --shadow-sm: 0 4px 14px rgba(51, 34, 26, 0.08);
  --font-head: 'Baloo 2', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, .logo-text, .how-num { font-family: var(--font-head); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 11px 24px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: inherit; padding: 11px 14px; }
.btn-ghost:hover { color: var(--accent-dark); }
.btn-lg { padding: 14px 30px; font-size: 1.08rem; }
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); padding: 7px 16px; font-size: 0.88rem; }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 244, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(51, 34, 26, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.logo-mark { flex-shrink: 0; }
.logo-text { font-size: 1.5rem; font-weight: 800; letter-spacing: 0.2px; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.nav-link:hover { color: var(--accent-dark); background: rgba(232, 132, 42, 0.10); }
.auth-area, .user-area { display: flex; align-items: center; gap: 6px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--accent-dark); padding: 8px 10px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--card);
  border: 1px solid rgba(51, 34, 26, 0.12);
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 60;
  position: relative;
}
.nav-toggle-bar { display: block; height: 2.5px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 64px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero-eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: rgba(232, 132, 42, 0.13);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.2rem); line-height: 1.05; font-weight: 800; }
.accent-word { color: var(--accent); font-style: normal; position: relative; }
.hero-sub { margin: 20px 0 28px; font-size: 1.14rem; color: var(--ink-soft); max-width: 34rem; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 0.9rem; color: var(--ink-soft); }
.hero-visual { position: relative; }
.hero-visual > img {
  width: 100%;
  aspect-ratio: 1880 / 1253;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.hero-tag {
  position: absolute;
  left: -18px;
  bottom: 26px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 220px;
}
.hero-tag-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-soft); }
.hero-tag-breed { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.hero-tag-conf { font-size: 0.85rem; font-weight: 800; color: var(--green); }
.hero-tag-bar { display: block; height: 6px; border-radius: 3px; background: var(--cream-deep); overflow: hidden; margin-top: 5px; }
.hero-tag-bar span { display: block; height: 100%; background: var(--green); border-radius: 3px; }

/* ---------- Scanner ---------- */
.scan-section { padding: 24px 0 72px; }
.scan-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 44px);
  max-width: 780px;
  margin: 0 auto;
}
.scan-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; }
.scan-head p { color: var(--ink-soft); margin-top: 6px; }
.scan-loggedout { text-align: center; padding: 28px 12px 12px; }
.scan-loggedout svg { margin: 0 auto 14px; }
.scan-locked-title { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; }
.scan-locked-sub { color: var(--ink-soft); max-width: 30rem; margin: 8px auto 20px; }
.scan-upload-row { display: flex; gap: 24px; align-items: stretch; margin-top: 26px; flex-wrap: wrap; }
.scan-preview {
  flex: 1 1 240px;
  min-height: 240px;
  background: var(--cream);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.scan-preview img { width: 100%; height: 100%; object-fit: cover; }
.scan-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-soft); font-weight: 700; }
.scan-controls { flex: 1 1 220px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.btn-file { justify-content: center; cursor: pointer; }
#dogFile { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.scan-hint { font-size: 0.85rem; color: var(--ink-soft); }
.scan-status { margin-top: 18px; font-weight: 700; color: var(--accent-dark); text-align: center; }
.scan-result {
  margin-top: 24px;
  background: var(--cream);
  border: 2px solid rgba(232, 132, 42, 0.35);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.result-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.result-eyebrow { font-size: 0.75rem; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-dark); }
.result-breed { font-size: 1.7rem; font-weight: 800; line-height: 1.15; }
.result-conf { text-align: right; }
.result-conf-num { display: block; font-family: var(--font-head); font-weight: 800; font-size: 1.7rem; color: var(--green); }
.result-conf-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.result-bar { display: block; height: 8px; background: rgba(255,255,255,0.9); border-radius: 4px; overflow: hidden; margin: 12px 0 14px; }
.result-bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.result-desc { color: var(--ink); }
.result-alts { margin-top: 8px; font-size: 0.92rem; color: var(--ink-soft); }
.result-saved { margin-top: 14px; font-weight: 800; font-size: 0.92rem; }
.result-saved a { color: var(--accent-dark); }

/* ---------- How it works ---------- */
.how-section { padding: 8px 0 72px; }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 800; text-align: center; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.how-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 26px;
}
.how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(232, 132, 42, 0.15);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.how-card h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.how-card p { color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- Breeds section ---------- */
.breeds-section { padding-bottom: 80px; }
.breeds-head { max-width: 40rem; margin: 0 auto 36px; padding: 0 20px; text-align: center; }
.breeds-head p { color: var(--ink-soft); margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--cream); padding: 40px 0; text-align: center; }
.footer-brand { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; margin-bottom: 8px; }
.footer-credit { margin-top: 12px; }
.footer-credit a { opacity: 0.5; font-weight: 300; color: inherit; text-decoration: none; }
.footer-credit a:hover { opacity: 0.8; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(51, 34, 26, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--cream);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 430px;
  padding: 30px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: var(--card);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.auth-tabs { display: flex; gap: 8px; background: var(--cream-deep); border-radius: 999px; padding: 5px; margin-bottom: 22px; }
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.auth-tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-paw { text-align: center; margin-bottom: 6px; }
.auth-title { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; }
.auth-sub { color: var(--ink-soft); margin: 4px 0 18px; font-size: 0.95rem; }
.field-label { display: block; font-weight: 800; font-size: 0.88rem; margin-bottom: 5px; }
.field {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(51, 34, 26, 0.15);
  border-radius: 14px;
  background: var(--card);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 14px;
}
.field:focus { outline: none; border-color: var(--accent); }
.field-otp { letter-spacing: 8px; text-align: center; font-size: 1.4rem; font-weight: 800; }
.auth-alt { text-align: center; margin-top: 14px; font-size: 0.92rem; }
.auth-alt a { color: var(--accent-dark); font-weight: 800; }
.auth-note { margin-top: 12px; font-size: 0.82rem; color: var(--ink-soft); text-align: center; }
.auth-error { color: var(--red); font-weight: 700; margin-top: 10px; font-size: 0.92rem; text-align: center; }
#verifyMessage { text-align: center; }
#verifyMessage a { color: var(--accent-dark); font-weight: 800; }
#verifyMessage button { margin-top: 14px; }

/* ---------- My Dogs page ---------- */
.page-head { padding: 48px 0 28px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; }
.page-head p { color: var(--ink-soft); margin-top: 6px; }
.dogs-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.dog-count { font-weight: 800; color: var(--ink-soft); }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-chip {
  border: 2px solid rgba(51, 34, 26, 0.18);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.dogs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; padding-bottom: 72px; }
.dog-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dog-card-photo { aspect-ratio: 1 / 1; width: 100%; overflow: hidden; background: var(--cream-deep); }
.dog-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.dog-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dog-breed { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; line-height: 1.2; }
.dog-conf { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.85rem; color: var(--green); }
.dog-conf-bar { display: inline-block; width: 70px; height: 6px; background: var(--cream-deep); border-radius: 3px; overflow: hidden; }
.dog-conf-bar span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.dog-desc { font-size: 0.92rem; color: var(--ink-soft); flex: 1; }
.dog-meta { font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; border-top: 1px solid rgba(51,34,26,0.08); padding-top: 10px; }
.dog-card-actions { display: flex; justify-content: flex-end; padding: 0 20px 16px; }
.empty-state {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  padding: 60px 24px;
  margin-bottom: 72px;
}
.empty-state h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.empty-state p { color: var(--ink-soft); max-width: 28rem; margin: 0 auto 22px; }
.login-again { text-align: center; padding: 100px 20px; }
.login-again h1 { font-size: 1.8rem; margin-bottom: 10px; }
.login-again p { color: var(--ink-soft); margin-bottom: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 560px; }
  .hero-tag { left: 14px; }
  .how-grid { grid-template-columns: 1fr; max-width: 460px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid rgba(51, 34, 26, 0.1);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px 20px;
    gap: 6px;
  }
  .main-nav.open { display: flex; }
  .auth-area, .user-area { flex-direction: column; align-items: stretch; }
  .user-chip { justify-content: center; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
}
@media (max-width: 560px) {
  .hero { padding: 36px 0 48px; }
  .hero-actions .btn { width: 100%; }
  .scan-upload-row { flex-direction: column; }
  .dogs-grid { grid-template-columns: 1fr; }
}
