/* ═══════════════════════════════════════════════
   SWAP — Shared Stylesheet
   Fonts: Syne (headings) + DM Sans (body)
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=Instrument+Serif:ital@0;1&display=swap');

/* ── CSS VARIABLES ── */
:root {
  /* Light mode */
  --bg: #F5F7FA;
  --bg2: #EEF2F6;
  --surface: #FFFFFF;
  --surface2: #F8FAFB;

  --teal: #4DB8AA;
  --teal2: #3A9E92;
  --teal3: #2D8578;
  --teal-soft: #9FD8CF;
  --teal-wash: #E8F6F4;
  --teal-mid: #C8EBE7;

  --text: #141C27;
  --text2: #5A6677;
  --text3: #9AAAB8;

  --border: #E2E8EF;
  --border2: #CBD5E0;

  --danger: #E05555;
  --danger-bg: #FEF0F0;
  --warn: #E8952A;
  --warn-bg: #FFF7EE;
  --gold: #F5C842;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --shadow:    0 2px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.09);
  --shadow-teal: 0 6px 24px rgba(77,184,170,0.22);

  --nav-bg: rgba(255,255,255,0.94);
  --nav-border: var(--border);
}

[data-theme="dark"] {
  --bg: #0D1117;
  --bg2: #161B24;
  --surface: #1C2333;
  --surface2: #212B3D;

  --teal: #4DB8AA;
  --teal2: #5DC9BA;
  --teal3: #3A9E92;
  --teal-soft: #3A7A72;
  --teal-wash: #1A3330;
  --teal-mid: #1F3F3B;

  --text: #E8EDF5;
  --text2: #8A9BB0;
  --text3: #5A6B7E;

  --border: #2A3447;
  --border2: #3A4A60;

  --danger: #E87070;
  --danger-bg: #2A1A1A;
  --warn: #F0A84A;
  --warn-bg: #2A1E10;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.2);
  --shadow:    0 2px 12px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-teal: 0 6px 24px rgba(77,184,170,0.15);

  --nav-bg: rgba(13,17,23,0.94);
  --nav-border: var(--border);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
h1, h2, h3, h4, h5 {
  font-family: 'Syne', sans-serif;
  line-height: 1.15;
}
.serif { font-family: 'Instrument Serif', serif; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── NAVIGATION ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
  height: 64px;
  border-bottom: 1px solid var(--nav-border);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 200;
  transition: background .3s, border-color .3s;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity .2s;
  text-decoration: none;
}
.logo:hover { opacity: .8; }
.logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo-text span { color: var(--teal); }
.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--teal);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-icon svg { width: 18px; height: 18px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 7px 15px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  display: inline-block;
}
.nav-link:hover { color: var(--text); background: var(--bg2); }
.nav-link.active { color: var(--teal2); font-weight: 600; }

.nav-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }

.nav-right { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  color: var(--text2);
}
.theme-toggle:hover { border-color: var(--teal-soft); color: var(--teal2); background: var(--teal-wash); }
.theme-toggle svg { width: 16px; height: 16px; }

.nav-btn-ghost {
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border: 1.5px solid var(--border2);
  background: transparent;
  transition: all .2s;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-btn-ghost:hover { border-color: var(--teal-soft); color: var(--teal2); }

.nav-btn-primary {
  padding: 9px 22px;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  border: none;
  background: var(--teal);
  transition: all .22s;
  font-family: 'DM Sans', sans-serif;
  box-shadow: var(--shadow-teal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-btn-primary:hover {
  background: var(--teal2);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(77,184,170,0.3);
}

/* ── FOOTER ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 80px 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 48px;
}
.footer-brand p {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.8;
  margin-top: 14px;
  max-width: 240px;
}
.footer-col h5 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--text3);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 13.5px;
  color: var(--text2);
  margin-bottom: 10px;
  transition: color .2s;
}
.footer-col a:hover { color: var(--teal2); }
.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text3);
}

/* ── BUTTONS ── */
.btn-primary {
  padding: 14px 32px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  font-family: 'DM Sans', sans-serif;
  box-shadow: var(--shadow-teal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--teal2);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(77,184,170,0.35);
}
.btn-ghost {
  padding: 13px 28px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border2);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s;
  font-family: 'DM Sans', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--teal-soft); background: var(--teal-wash); color: var(--teal2); }

/* ── FORMS (shared) ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 7px;
  letter-spacing: .1px;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface);
  font-family: 'DM Sans', sans-serif;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(77,184,170,0.1); }
.form-input::placeholder { color: var(--text3); }
select.form-input { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.pet-type-selector {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.pet-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .22s;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text2);
  user-select: none;
}
.pet-type-btn:hover { border-color: var(--teal-soft); color: var(--teal2); background: var(--teal-wash); }
.pet-type-btn.active {
  border-color: var(--teal);
  background: var(--teal-wash);
  color: var(--teal2);
}
.pet-type-btn svg { width: 16px; height: 16px; }

.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: .1px;
  box-shadow: var(--shadow-teal);
}
.submit-btn:hover {
  background: var(--teal2);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(77,184,170,0.3);
}

/* ── SECTION HELPERS ── */
.section-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--teal2);
  margin-bottom: 12px;
}
.section-heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1.2px;
  margin-bottom: 14px;
  line-height: 1.1;
}
.section-heading .accent { color: var(--teal); font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; }
.section-sub {
  font-size: 16px;
  color: var(--text2);
  max-width: 520px;
  line-height: 1.8;
  margin-bottom: 52px;
}
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── AUTH LAYOUT ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.auth-heading {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}
.auth-sub {
  font-size: 14px;
  color: var(--text2);
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.7;
}

.user-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.user-type-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all .22s;
  background: var(--surface);
  text-align: center;
}
.user-type-card:hover { border-color: var(--teal-soft); background: var(--teal-wash); }
.user-type-card.active { border-color: var(--teal); background: var(--teal-wash); }
.user-type-card .utc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  background: var(--bg2);
  transition: background .22s;
}
.user-type-card.active .utc-icon,
.user-type-card:hover .utc-icon { background: white; }
.user-type-card .utc-icon svg { width: 18px; height: 18px; }
.utc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.utc-desc { font-size: 11px; color: var(--text3); margin-top: 2px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
}
.auth-divider-line { flex: 1; height: 1px; background: var(--border); }
.auth-divider-text { font-size: 12px; color: var(--text3); white-space: nowrap; }

.auth-social-btn {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all .2s;
}
.auth-social-btn:hover { border-color: var(--teal-soft); background: var(--teal-wash); }

.auth-switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--text2);
  margin-top: 20px;
}
.auth-switch a { color: var(--teal2); font-weight: 600; cursor: pointer; }
.auth-switch a:hover { text-decoration: underline; }

.form-step { display: none; }
.form-step.active { display: block; }

/* ── DASHBOARD ── */
.dash-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.dash-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-sidebar-section {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text3);
  padding: 16px 12px 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--bg2); color: var(--text); }
.sidebar-link.active { background: var(--teal-wash); color: var(--teal2); font-weight: 600; }
.sidebar-link svg { width: 17px; height: 17px; opacity: .7; }
.sidebar-link.active svg, .sidebar-link:hover svg { opacity: 1; }

.dash-main { padding: 40px 48px; background: var(--bg); overflow-y: auto; }
.dash-greeting { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; font-family: 'Syne', sans-serif; }
.dash-sub { font-size: 14px; color: var(--text2); margin-bottom: 32px; }

.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.dash-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.dash-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dsc-label { font-size: 12px; color: var(--text3); font-weight: 500; margin-bottom: 8px; }
.dsc-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -1px; font-family: 'Syne', sans-serif; }
.dsc-value span { font-size: 14px; color: var(--teal2); margin-left: 6px; font-family: 'DM Sans', sans-serif; font-weight: 600; letter-spacing: 0; }

.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-card-title { font-size: 14px; font-weight: 700; color: var(--text); font-family: 'Syne', sans-serif; }
.dash-card-action { font-size: 12.5px; color: var(--teal2); font-weight: 600; cursor: pointer; }
.dash-card-action:hover { text-decoration: underline; }

.pet-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pet-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.pet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--teal-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid var(--teal-mid);
}
.pet-name { font-size: 14px; font-weight: 600; color: var(--text); }
.pet-meta { font-size: 12px; color: var(--text3); margin-top: 1px; }
.pet-status {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}
.pet-status.ok { background: var(--teal-wash); color: var(--teal2); }
.pet-status.warn { background: var(--warn-bg); color: var(--warn); }

.vault-doc {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 10px;
  transition: border-color .2s;
}
.vault-doc:hover { border-color: var(--teal-soft); }
.vault-doc:last-child { margin-bottom: 0; }
.vault-doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.vault-doc-icon.green { background: #ECFDF5; }
.vault-doc-icon.blue  { background: #EFF6FF; }
.vault-doc-icon.amber { background: #FFFBEB; }
.vault-doc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.vault-doc-meta { font-size: 11.5px; color: var(--text3); }
.vault-doc-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
}
.vault-doc-status.ok { background: var(--teal-wash); color: var(--teal2); }
.vault-doc-status.warn { background: var(--warn-bg); color: var(--warn); }

.qr-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.qr-box {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  padding: 8px;
}
.qr-box svg { width: 100%; height: 100%; }
.qr-label { font-size: 12.5px; color: var(--text2); font-weight: 500; }

/* ── UTILITY ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── ANIMATIONS ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(77,184,170,.4); }
  70%       { box-shadow: 0 0 0 5px rgba(77,184,170,0); }
}
.anim-fade-up { animation: fade-up .5s ease both; }
.anim-delay-1 { animation-delay: .1s; }
.anim-delay-2 { animation-delay: .2s; }
.anim-delay-3 { animation-delay: .3s; }
.anim-delay-4 { animation-delay: .4s; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .nav { padding: 0 28px; }
  .nav-links { display: none; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
}
@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .auth-card { padding: 32px 24px; }
  .form-row { grid-template-columns: 1fr; }
  .dash-stats-row { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .user-type-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer { padding: 40px 24px 28px; }
}


/* Logo image is toggled via JS; ensure correct sizing */
.logo .swap-logo-img,
.login-logo .swap-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ── THEME-AWARE LOGO ── */
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark  { display: block !important; }
[data-theme="light"] .logo-light { display: block !important; }
[data-theme="light"] .logo-dark  { display: none !important; }
/* Ensure navbar flex doesn't shift when images are shown/hidden */
.logo { line-height: 0; }
