/* ─── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  --bg: #f8fafc;
  --bg-raised: #ffffff;
  --bg-muted: #f1f5f9;
  --border: rgba(0, 0, 0, 0.05);
  --border-mid: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;

  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --accent-glow: rgba(79, 70, 229, 0.2);

  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.1);
  --success-dot: #22c55e;

  --error-bg: rgba(220, 38, 38, 0.1);
  --error-text: #dc2626;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ne: 'Noto Sans Devanagari', 'Inter', sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.15s;
  --t-base: 0.25s;
  --t-slow: 0.4s;

  /* Orb colors - using violet/indigo/cyan for the old theme vibe */
  --orb-1: rgba(99, 102, 241, 0.12);
  --orb-2: rgba(168, 85, 247, 0.1);
  --orb-3: rgba(6, 182, 212, 0.08);
}

[data-theme="dark"] {
  --bg: #0b0d17;
  --bg-raised: #141928;
  --bg-muted: #1e2536;
  --border: rgba(255, 255, 255, 0.06);
  --border-mid: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;

  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.28);

  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --success-dot: #22c55e;

  --error-bg: rgba(239, 68, 68, 0.1);
  --error-text: #ef4444;

  --orb-1: rgba(99, 102, 241, 0.15);
  --orb-2: rgba(139, 92, 246, 0.12);
  --orb-3: rgba(14, 165, 233, 0.1);
}

/* ─── Base ───────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  transition: background var(--t-slow) ease, color var(--t-slow) ease;
}

body.lang-ne,
body.lang-ne .search-field__input,
body.lang-ne .search-label,
body.lang-ne .hero__sub,
body.lang-ne [data-i18n] {
  font-family: var(--font-ne);
}

/* ─── Ambient Orbs ───────────────────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}

.orb--1 {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: var(--orb-1);
  animation-duration: 20s;
}

.orb--2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  right: -100px;
  background: var(--orb-2);
  animation-duration: 16s;
  animation-delay: -6s;
}

.orb--3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 60%;
  background: var(--orb-3);
  animation-duration: 24s;
  animation-delay: -10s;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(30px, 20px) scale(1.05);
  }
}

/* ─── Top Nav ────────────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: 100px;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-out-expo);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 0 var(--accent-glow);
}

.nav-btn:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.nav-btn:active {
  transform: translateY(0) scale(0.97);
}

.nav-btn svg {
  flex-shrink: 0;
}

/* Icon-only theme button */
.nav-btn:not(.nav-btn--lang) {
  width: 40px;
  padding: 0;
}

/* ─── Container ──────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 72px 20px 80px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  min-height: 100dvh;
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  padding: 28px 0 12px;
  animation: hero-in var(--t-slow) var(--ease-out-expo) both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-dot);
  box-shadow: 0 0 0 3px var(--success-bg);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    box-shadow: 0 0 0 3px var(--success-bg);
  }

  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

.hero__wordmark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-1);
  margin-bottom: 10px;
}

.hero__wordmark em {
  font-style: normal;
  color: var(--accent);
}

.hero__sub {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

/* ─── Search Section ─────────────────────────────────────────── */
.search-section {
  animation: card-in var(--t-slow) var(--ease-out-expo) 0.08s both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 28px 28px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05), 0 0 0 0 var(--accent-glow);
  transition: box-shadow var(--t-base) ease, border-color var(--t-base) ease;
}

.search-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05), 0 0 0 4px var(--accent-glow);
}

.search-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

/* ─── Search Field Group ─────────────────────────────────────── */
.search-field-group {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--t-base) var(--ease-out-expo);
  position: relative;
  min-width: 0;
}

.search-field:focus-within {
  background: var(--bg-raised);
  border-color: var(--accent);
}

.search-field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  display: flex;
  align-items: center;
  transition: color var(--t-fast) ease;
  z-index: 1;
}

.search-field:focus-within .search-field__icon {
  color: var(--accent);
}

.search-field__input {
  width: 100%;
  padding: 16px 44px 16px 44px;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: 0.02em;
  min-width: 0;
}

.search-field__input::placeholder {
  color: var(--text-3);
  font-weight: 400;
}

.search-field__clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-mid);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-spring);
  z-index: 2;
  flex-shrink: 0;
}

.search-field__clear:hover {
  background: var(--border-strong);
  color: var(--text-1);
  transform: translateY(-50%) scale(1.1);
}

.search-field__clear:active {
  transform: translateY(-50%) scale(0.92);
}

/* ─── Search Button ──────────────────────────────────────────── */
.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  height: 54px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-spring);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--accent-glow), 0 1px 2px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.search-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--t-fast) ease;
}

.search-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-btn:hover::before {
  background: rgba(255, 255, 255, 0.06);
}

.search-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.search-btn__arrow {
  display: flex;
  align-items: center;
  transition: transform var(--t-fast) var(--ease-spring);
}

.search-btn:hover .search-btn__arrow {
  transform: translateX(3px);
}

/* ─── Search Hint ────────────────────────────────────────────── */
.search-hint {
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* ─── Result Area ────────────────────────────────────────────── */
.result-area {
  width: 100%;
  min-height: 0;
}

/* ─── Result States ──────────────────────────────────────────── */
.result-state {
  width: 100%;
  padding: 44px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: state-reveal var(--t-slow) var(--ease-out-expo) both;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

@keyframes state-reveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.state-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.state-icon--error {
  background: var(--error-bg);
  color: var(--error-text);
}

.state-icon--empty {
  background: var(--bg-muted);
  color: var(--text-3);
}

.state-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

.state-sub {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* Loading Spinner */
.loading-ring {
  color: var(--accent);
  margin-bottom: 4px;
}

.spinner-arc {
  animation: spin-arc 1.1s ease-in-out infinite;
  transform-origin: center;
}

@keyframes spin-arc {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.state-text {
  font-size: 0.9rem;
  color: var(--text-2);
  font-weight: 500;
}

/* ─── License Card ───────────────────────────────────────────── */
.license-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  overflow: hidden;
  animation: card-reveal var(--t-slow) var(--ease-out-expo) both;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  position: relative;
}

/* Accent top bar */
.license-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
}

@keyframes card-reveal {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.license-card__header {
  padding: 28px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.license-card__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid rgba(46, 184, 112, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-dot);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

.license-card__num {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.04em;
  padding-top: 6px;
  word-break: break-all;
  text-align: right;
  flex: 1;
  min-width: 0;
}

.license-card__divider {
  height: 1px;
  background: var(--border);
  margin: 20px 28px;
}

.license-card__name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-1);
  padding: 0 28px;
  line-height: 1.15;
  word-break: break-word;
}

/* ─── License Fields Grid ────────────────────────────────────── */
.license-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 24px 0 0;
  border-top: 1px solid var(--border);
}

.license-field {
  padding: 20px 28px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.license-field:nth-child(2n) {
  border-right: none;
}

.license-field--full {
  grid-column: 1 / -1;
  border-right: none;
  border-bottom: none;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.field-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.01em;
  word-break: break-word;
  line-height: 1.4;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding-top: 8px;
  margin-top: auto;
}

.footer__text {
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.footer__updated {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ─── Transitions for theme switch ──────────────────────────── */
.license-card,
.search-card,
.result-state,
.nav-btn {
  transition:
    background var(--t-slow) ease,
    border-color var(--t-slow) ease,
    box-shadow var(--t-slow) ease,
    color var(--t-slow) ease;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 540px) {
  .container {
    padding: 64px 14px 60px;
    gap: 16px;
  }

  .top-nav {
    top: 12px;
    right: 12px;
    gap: 6px;
  }

  .nav-btn {
    height: 36px;
    font-size: 0.82rem;
  }

  .nav-btn:not(.nav-btn--lang) {
    width: 36px;
    padding: 0;
  }

  .nav-btn--lang {
    padding: 0 12px;
  }

  .hero {
    padding: 16px 0 8px;
  }

  .search-card {
    padding: 22px 18px 18px;
  }

  .search-field-group {
    flex-direction: column;
    gap: 10px;
  }

  .search-btn {
    width: 100%;
    justify-content: center;
    height: 50px;
    font-size: 0.95rem;
  }

  .search-field__input {
    font-size: 0.95rem;
    padding: 15px 42px;
  }

  .license-card__header {
    padding: 22px 20px 0;
  }

  .license-card__name {
    padding: 0 20px;
    font-size: 1.5rem;
  }

  .license-card__divider {
    margin: 16px 20px;
  }

  .license-grid {
    grid-template-columns: 1fr;
  }

  .license-field {
    border-right: none;
    padding: 16px 20px;
  }

  .license-field:last-child {
    border-bottom: none;
  }

  .license-field--full {
    border-bottom: none;
  }

  .result-state {
    padding: 36px 20px;
  }
}

@media (max-width: 360px) {
  .search-card {
    padding: 18px 14px 16px;
    border-radius: var(--radius-lg);
  }

  .license-card {
    border-radius: var(--radius-lg);
  }
}

/* ─── Focus Visible ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.search-field__input:focus-visible,
.search-btn:focus-visible,
.nav-btn:focus-visible {
  outline: none;
  /* handled by parent or box-shadow */
}

/* ─── Selection ──────────────────────────────────────────────── */
::selection {
  background: var(--accent-soft);
  color: var(--text-1);
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ─── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}