/* snm-patents extras (Tailwind via CDN handles most styling) */

/* Cloudflare Turnstile on register (same pattern as 4HFix .contact-captcha) */
.register-captcha {
  min-height: 65px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.register-captcha.hidden {
  display: none;
}

/* Homepage: hero image as full-page background + forced light text (readable on dark art).
   Use !important so browser defaults / any leftover dark utilities cannot win. */
.home-hero-bg {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: #f4f6f8 !important;
  background-color: #0f1620;
  background-image: url("/static/img/hero.jpg");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  background-attachment: scroll;
}
@media (min-width: 768px) {
  .home-hero-bg {
    background-attachment: fixed;
    background-position: center center;
  }
}
/* Dark gradient so copy stays readable (image is illustrative only) */
.home-hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgba(15, 22, 32, 0.97) 0%,
      rgba(15, 22, 32, 0.92) 38%,
      rgba(15, 22, 32, 0.62) 62%,
      rgba(15, 22, 32, 0.35) 100%
    ),
    linear-gradient(
      to top,
      rgba(15, 22, 32, 0.85) 0%,
      transparent 42%
    );
}
.home-hero-bg > * {
  position: relative;
  z-index: 1;
}

/* Force light type over the hero — never black on this page */
.home-hero-bg,
.home-hero-bg * {
  color: #f0f3f7 !important;
}
.home-hero-bg h1 .home-brand-snm,
.home-hero-bg .home-title {
  color: #ffffff !important;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55);
}
.home-hero-bg h1 .home-brand-patents {
  color: #e8c547 !important;
}
.home-hero-bg .home-lead {
  color: #e2e8f0 !important;
}
.home-hero-bg .home-muted {
  color: #c5d0de !important;
}
.home-hero-bg .home-eyebrow {
  color: #7ec0f7 !important;
}
.home-hero-bg .home-header a:not(.bg-accent) {
  color: #f0f3f7 !important;
}
.home-hero-bg a.bg-accent,
.home-hero-bg a.bg-accent:hover {
  color: #ffffff !important;
}
.home-hero-bg .home-btn-ghost {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}
.home-hero-bg .home-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff !important;
}
.home-hero-bg .home-header {
  background: rgba(15, 22, 32, 0.65);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}
.home-hero-bg .home-footer {
  border-top-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 22, 32, 0.55);
  color: #c5d0de !important;
}
.home-hero-bg .home-footer a,
.home-hero-bg .home-footer strong {
  color: #e8edf4 !important;
}
.home-hero-bg .home-card {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}
.home-hero-bg .home-card p {
  color: #d0dae6 !important;
}
.home-hero-bg .home-card .home-card-title {
  color: #ffffff !important;
}
/* Keep logo plate light so the mark stays readable; don't force white on the image */
.home-hero-bg .home-header .logo-plate,
.home-hero-bg .logo-plate-sm {
  background: #eef1f5;
  color: inherit;
}
.home-hero-bg .logo-plate *,
.home-hero-bg .logo-plate-sm * {
  color: inherit !important;
}


/* Logo plates: light logos stay readable on dark theme */
.logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: #f4f6f8;
  border: 1px solid rgb(200 210 222 / 0.7);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
.dark .logo-plate {
  background: #eef1f5;
  border-color: rgb(255 255 255 / 0.12);
}
.logo-snm-patents {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-plate-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  background: #ffffff;
  border: 1px solid rgb(200 210 222 / 0.8);
  overflow: hidden;
  padding: 0.2rem;
}
.dark .logo-plate-sm {
  background: #ffffff;
  border-color: rgb(255 255 255 / 0.15);
}
.logo-shimpinomori {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.kind-btn {
  color: rgb(85 109 138);
}
.dark .kind-btn {
  color: rgb(160 176 196);
}
.kind-btn.active {
  background: white;
  color: rgb(26 35 50);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}
.dark .kind-btn.active {
  background: rgb(48 61 78);
  color: rgb(244 246 248);
}

.side-kind-btn {
  color: rgb(85 109 138);
}
.dark .side-kind-btn {
  color: rgb(160 176 196);
}
.side-kind-btn.active {
  background: white;
  color: rgb(26 35 50);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}
.dark .side-kind-btn.active {
  background: rgb(48 61 78);
  color: rgb(244 246 248);
}

.result-card {
  border-radius: 1rem;
  border: 1px solid rgb(200 210 222 / 0.9);
  background: white;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
.dark .result-card {
  border-color: rgb(55 71 92 / 0.9);
  background: rgb(26 35 50 / 0.55);
}

.result-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.result-card-head h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.result-card-head .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.45rem;
  background: #3d9cf0;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.copy-btn {
  font-size: 0.75rem;
  color: rgb(85 109 138);
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.copy-btn:hover {
  border-color: rgb(200 210 222);
  background: rgb(244 246 248);
}
.dark .copy-btn {
  color: rgb(160 176 196);
}
.dark .copy-btn:hover {
  border-color: rgb(55 71 92);
  background: rgb(48 61 78 / 0.6);
}

.prose-snm {
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgb(55 71 92);
  white-space: pre-wrap;
}
.dark .prose-snm {
  color: rgb(200 210 222);
}

.stage-item.active {
  color: #3d9cf0;
  font-weight: 600;
}
.stage-item.done {
  color: rgb(55 71 92);
}
.dark .stage-item.done {
  color: rgb(200 210 222);
}
.stage-item.done::before {
  content: "✓ ";
  color: #22c55e;
}

.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.history-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(200 210 222 / 0.8);
  background: white;
  transition: border-color 0.15s, background 0.15s;
}
.dark .history-item {
  border-color: rgb(55 71 92 / 0.9);
  background: rgb(26 35 50 / 0.4);
}
.history-item:hover {
  border-color: #3d9cf0;
}

/* ── Theme toggle + language flags (header chrome) ── */
.chrome-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 0.75rem;
  border: 1px solid rgb(200 210 222 / 0.9);
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
  background: rgb(228 233 239 / 0.8);
}
.dark .theme-toggle {
  border-color: rgb(55 71 92 / 0.95);
}
.dark .theme-toggle:hover {
  background: rgb(48 61 78 / 0.7);
}
.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 9.5rem;
  height: 2.35rem;
  padding: 0 1.75rem 0 0.55rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(200 210 222 / 0.9);
  background-color: rgb(244 246 248 / 0.9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23556d8a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 0.9rem;
  color: rgb(26 35 50);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}
.dark .lang-select {
  border-color: rgb(55 71 92 / 0.95);
  background-color: rgb(26 35 50 / 0.75);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23c8d2de'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  color: rgb(244 246 248);
}
.lang-select:focus {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px rgba(61, 156, 240, 0.45);
}

/* Little flag buttons (header or near Analyze) */
.lang-flags {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  padding: 0.15rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(200 210 222 / 0.85);
  background: rgb(244 246 248 / 0.55);
}
.dark .lang-flags {
  border-color: rgb(55 71 92 / 0.95);
  background: rgb(26 35 50 / 0.45);
}
.lang-flag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.12s, background 0.12s, transform 0.12s;
}
.lang-flag-btn:hover {
  opacity: 1;
  background: rgba(61, 156, 240, 0.12);
}
.lang-flag-btn.active {
  opacity: 1;
  background: rgba(61, 156, 240, 0.22);
  box-shadow: inset 0 0 0 1px rgba(61, 156, 240, 0.45);
  transform: scale(1.06);
}

/* Homepage hero: keep chrome readable on dark art */
.home-hero-bg .theme-toggle {
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
}
.home-hero-bg .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}
.home-hero-bg .lang-select {
  border-color: rgba(255, 255, 255, 0.35) !important;
  background-color: rgba(15, 22, 32, 0.55) !important;
  color: #f0f3f7 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f0f3f7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
}
.home-hero-bg .lang-flags {
  border-color: rgba(255, 255, 255, 0.28) !important;
  background: rgba(15, 22, 32, 0.4) !important;
}
.home-hero-bg .lang-flag-btn {
  color: inherit !important;
}
.home-hero-bg .lang-flag-btn.active {
  background: rgba(126, 192, 247, 0.25) !important;
  box-shadow: inset 0 0 0 1px rgba(126, 192, 247, 0.55) !important;
}

@media (max-width: 640px) {
  .lang-flags-desktop {
    display: none;
  }
  .lang-select {
    max-width: 7.25rem;
    font-size: 0.75rem;
  }
}
@media (min-width: 641px) {
  .lang-select-mobile {
    display: none;
  }
}

/* User profile dropdown menu */
.user-menu {
  position: relative;
}
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 12rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid rgb(200 210 222 / 0.9);
  background: transparent;
  font-size: 0.8rem;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.user-menu-btn:hover {
  background: rgb(228 233 239 / 0.7);
}
.dark .user-menu-btn {
  border-color: rgb(55 71 92 / 0.95);
}
.dark .user-menu-btn:hover {
  background: rgb(48 61 78 / 0.65);
}
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 0.85rem;
  border: 1px solid rgb(200 210 222 / 0.9);
  background: #fff;
  box-shadow: 0 10px 30px -8px rgba(15, 22, 32, 0.25);
  z-index: 50;
}
.dark .user-menu-panel {
  border-color: rgb(55 71 92 / 0.95);
  background: rgb(26 35 50);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.45);
}
.user-menu-panel a,
.user-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: rgb(244 246 248);
}
.dark .user-menu-panel a:hover,
.dark .user-menu-panel button:hover {
  background: rgb(48 61 78);
}
.user-menu-panel button {
  color: rgb(185 28 28);
}
.dark .user-menu-panel button {
  color: rgb(252 165 165);
}
