/* ============================================================
   MINGDAO GLOBAL — custom styles
   Brand: Deep Navy #08224E · Accent Blue #2E6FB7 · Gold #C89D3C
   ============================================================ */

:root {
  --navy: #08224E;
  --navy-2: #0F3A6E;
  --gold: #C89D3C;
  --blue: #2E6FB7;
  --sky: #EAF2FA;
  --purple: #5B2C83;
  --mist: #F4F6F8;
  --cream: #F7F5F0;
  --ink: #1f2430;
  --muted: #5b6472;
  --line: #E4E8EE;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Bilingual visibility ----------
   Default language = Chinese. When <html class="lang-en"> is present,
   English blocks are shown and Chinese blocks hidden. */
html:not(.lang-en) [data-lang="en"] { display: none !important; }
html.lang-en [data-lang="zh"] { display: none !important; }

/* ---------- Typography helpers ---------- */
.text-navy { color: var(--navy); }
.text-gold { color: var(--gold); }
.text-purple { color: var(--purple); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--muted); }
.bg-navy { background-color: var(--navy); }
.bg-mist { background-color: var(--mist); }
.bg-gold { background-color: var(--gold); }
.bg-sky { background-color: var(--sky); }
.bg-cream { background-color: var(--cream); }

h1, h2, h3, h4 {
  color: var(--navy);
  letter-spacing: -0.01em;
}

.font-display { font-weight: 700; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--blue);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  line-height: 1.2;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 18px rgba(8, 34, 78, 0.22);
}
.btn-primary:hover {
  background: var(--navy-2);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(8, 34, 78, 0.3);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
  transform: translateY(-2px);
}
.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover { background: var(--navy-2); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--navy); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06), 0 16px 32px rgba(16, 24, 40, 0.10);
}

/* ---------- Nav ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-link {
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333a47;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--navy); }
.nav-link.active { color: var(--navy); font-weight: 600; }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--blue);
}

/* Dropdown (desktop) */
.has-dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.625rem;
  box-shadow: 0 16px 40px rgba(13, 27, 51, 0.14);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
  z-index: 60;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  color: #333a47;
  transition: background 0.2s ease, color 0.2s ease;
}
.dropdown-menu a:hover { background: var(--mist); color: var(--navy); }
.dropdown-menu a.active { color: var(--navy); font-weight: 600; background: var(--mist); }
.dropdown-right .dropdown-menu { left: auto; right: 0; }

/* Mobile menu */
#mobile-menu { transition: all 0.3s ease; }
#mobile-menu.open { display: block; }

/* ---------- Floating side toolbar ---------- */
.side-toolbar {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tool-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(13, 27, 51, 0.12);
  transition: all 0.3s ease;
}
.tool-btn:hover {
  background: var(--navy);
  color: #fff;
  transform: translateY(-2px);
}
.tool-btn .iconfont { font-size: 1.15rem; }
.qr-pop {
  position: absolute;
  right: 54px;
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(13, 27, 51, 0.18);
  padding: 0.6rem;
  width: 150px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 80;
}
.tool-btn:hover .qr-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}
.qr-pop img { width: 100%; border-radius: 0.4rem; display: block; }
.qr-pop.qr-text {
  width: auto;
  max-width: 240px;
  padding: 0.5rem 0.8rem;
}
.qr-pop.qr-text .qr-label {
  margin-top: 0;
  white-space: nowrap;
  font-weight: 600;
  color: var(--navy);
}
.qr-pop .qr-label {
  font-size: 0.72rem;
  text-align: center;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* ---------- Floating WhatsApp (bottom-right) ---------- */
.wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float .iconfont { font-size: 1.5rem; }
@media (max-width: 640px) {
  .wa-float { right: 1rem; bottom: 1rem; width: 50px; height: 50px; }
  .side-toolbar { right: 0.6rem; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Section spacing ---------- */
.section { padding: 5rem 0; }
@media (max-width: 640px) { .section { padding: 3.5rem 0; } }

/* ---------- Forms ---------- */
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.field .req { color: #c0392b; }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 111, 183, 0.16);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #c0392b; }
.err-msg {
  font-size: 0.78rem;
  color: #c0392b;
  margin-top: 0.3rem;
  display: none;
}
.field.has-error .err-msg { display: block; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.checkbox-row input { width: 18px; height: 18px; margin-top: 2px; }

/* ---------- Legal / prose ---------- */
.prose-block h3 { margin-top: 1.75rem; margin-bottom: 0.6rem; font-size: 1.15rem; }
.prose-block p { margin-bottom: 1rem; color: #3c4453; line-height: 1.85; }
.prose-block ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1rem; color: #3c4453; }
.prose-block li { margin-bottom: 0.4rem; }

/* ---------- Misc ---------- */
.section-anchor { scroll-margin-top: 90px; }
.divider-gold { height: 3px; width: 64px; background: var(--gold); border-radius: 2px; }
.decor-line { display: block; width: 56px; height: 3px; background: var(--blue); border-radius: 2px; }

/* Subtle grain / hero decoration */
.hero-grid {
  background-image:
    linear-gradient(rgba(8, 34, 78, 0.85), rgba(8, 34, 78, 0.85)),
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    url('/images/bb8.jpg');
  background-size: cover, 48px 48px, 48px 48px, cover;
  background-position: center, 0 0, 0 0, center;
}