:root {
  --ink: #141414;
  --muted: #525252;
  --line: #e7e7e7;
  --brand: #ff8210;
  --brand-dark: #d96700;
  --brand-soft: #fff3ea;
  --bg: #ffffff;
  --card: #ffffff;
  --danger: #b42318;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.09);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 480px at 50% -120px, #fff1e3 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 86px;
  padding: 12px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav .brand { text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; }
.brand-logo { height: 58px; width: auto; display: block; }
.site-nav nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 20px; }
.site-nav nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-nav nav a:hover { color: var(--ink); }
.site-nav .cta { background: var(--brand); color: #fff; padding: 9px 18px; border-radius: 999px; font-weight: 600; }
.menu-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.menu-toggle span { width: 20px; height: 2px; border-radius: 999px; background: var(--ink); transition: transform 160ms ease, opacity 160ms ease; }
.site-nav.nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
.site-nav.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
#topbar-account { display: flex; align-items: center; gap: 12px; padding-left: 2px; }
#topbar-shop-name { font-weight: 600; font-size: 0.9rem; color: var(--ink); }

.portal-shell { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }

.portal-intro { max-width: 560px; margin: 0 auto 28px; text-align: center; }
.portal-intro h1 { font-family: "Newsreader", Georgia, serif; font-size: 2rem; margin: 10px 0 12px; letter-spacing: -0.01em; }
.portal-intro p { color: var(--muted); }
.kicker { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.14em; color: var(--brand); font-weight: 700; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  margin: 0 auto 20px;
  max-width: 620px;
  box-shadow: var(--shadow-md);
}
.card h2 { font-family: "Newsreader", Georgia, serif; margin-top: 0; letter-spacing: -0.01em; font-size: 1.5rem; }
.card code { background: #eef2f6; padding: 2px 6px; border-radius: 6px; font-size: 0.88em; }

.portal-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.portal-tab {
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.portal-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.portal-menu {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.portal-menu-item {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.portal-menu-item:hover { background: var(--brand-soft); color: var(--brand-dark); }
.portal-menu-item.active { background: var(--brand); color: #fff; }

.form-grid { display: grid; gap: 16px; }
.form-grid.two-col { grid-template-columns: 1fr 1fr; }
.field-group.full-row { grid-column: 1 / -1; }
.action-row { display: flex; gap: 10px; justify-content: flex-end; }

label { font-weight: 600; font-size: 0.86rem; color: #344054; }
.optional-label { font-weight: 400; color: var(--muted); }

input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fcfcfb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 130, 16, 0.18);
}

button {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}
button:hover { background: var(--brand-dark); box-shadow: var(--shadow-md); }
button:active { transform: translateY(1px); }
button.back-button { background: none; color: var(--muted); border: 1px solid var(--line); box-shadow: none; padding: 9px 16px; font-size: 0.85rem; }
button.back-button:hover { color: var(--ink); border-color: var(--brand); background: var(--brand-soft); }
button.danger-button { background: var(--danger); }
button.danger-button:hover { background: #8f1c11; }
button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

.notice { max-width: 620px; margin: 0 auto 20px; padding: 13px 18px; border-radius: 14px; font-size: 0.9rem; box-shadow: var(--shadow-sm); }
.notice.ok { background: var(--brand-soft); color: #065f46; border: 1px solid #a7f3d0; }
.notice.error { background: #fef3f2; color: var(--danger); border: 1px solid #fda29b; }
.hidden { display: none !important; }

.key-box {
  background: #101828;
  color: #d1fae5;
  padding: 14px 18px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
  margin-bottom: 14px;
}

.lookup-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-top: 16px; }
.lookup-card h4 { margin: 0 0 6px; }
.lookup-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lookup-status.registered { background: var(--brand-soft); color: #065f46; }
.lookup-status.lost { background: #fffaeb; color: #b54708; }
.lookup-status.stolen { background: #fef3f2; color: var(--danger); }
.lookup-status.unregistered { background: #f2f4f7; color: var(--muted); }
.lookup-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.lookup-photos img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.registry-empty { text-align: center; color: var(--muted); padding: 24px 0; }
.service-log-form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.service-log-form h4 { margin: 0; }
.service-log-form label { display: grid; gap: 6px; }
.dialog-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20, 20, 20, 0.45); }
.dialog-box { width: min(100%, 460px); max-height: 86vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); }
.dialog-box h2 { margin: 0 0 8px; font-family: "Newsreader", Georgia, serif; }
.dialog-box p { margin: 0 0 18px; color: var(--muted); }
.dialog-fields { display: grid; gap: 12px; margin-bottom: 14px; }
.dialog-fields label { display: grid; gap: 6px; }
.dialog-error { color: var(--danger); font-size: 0.86rem; margin: 0 0 12px; }
.dialog-body { max-height: 50vh; overflow-y: auto; margin-bottom: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .site-nav { flex-direction: row; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 14px 16px; }
  .brand-logo { height: 52px; }
  .menu-toggle { display: flex; }
  .site-nav nav { display: none; order: 3; flex-basis: 100%; }
  .site-nav.nav-open nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 520px; margin: 0 auto; }
  .site-nav nav a { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 0.92rem; text-align: center; }
  .site-nav .cta, #topbar-account { grid-column: 1 / -1; }
  #topbar-account { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .form-grid.two-col { grid-template-columns: 1fr; }
  .card { padding: 22px; }
}

@media (max-width: 430px) {
  .site-nav nav { grid-template-columns: minmax(0, 1fr); }
  .brand-logo { height: 46px; }
}
