:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #eef2f6;
  --text: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  /* BNI red. The palette is red / white / near-black, matching BNI's identity,
   * which has no navy — the previous palette used three navy sections. */
  --primary: #cc0000;
  --primary-dark: #990000;
  --dark: #0a0a0a;
  --dark-2: #1a1a1a;
  --white: #ffffff;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(16, 24, 40, .08);
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

/* ---------------------------------------------------------------------------
   G07 — visible keyboard focus.
   :focus-visible keeps the ring for keyboard users without painting it on every
   mouse click. outline (not box-shadow) so it is not clipped by overflow and
   is honoured in forced-colors / high-contrast mode.
   ------------------------------------------------------------------------ */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* G06 — skip link. Off-screen until focused, then pinned to the viewport. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--dark);
  color: #ffffff;
  font-weight: 750;
  transition: top .18s ease;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(228,231,236,.8);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 20px;
}

.brand-text span {
  color: var(--muted);
  /* 11px was below the readable floor on a phone in daylight; 12px is the
   * minimum this project accepts (tests/e2e/visual.spec.js). */
  font-size: 12px;
  margin-top: 5px;
}

.desktop-nav {
  display: flex;
  gap: 26px;
}

.desktop-nav a {
  font-size: 14px;
  font-weight: 650;
  color: #344054;
}

.desktop-nav a:hover {
  color: var(--primary);
}

/* ---------------------------------------------------------------------------
   G07 — mobile menu button. Desktop hides it; the <=980px block below turns it
   into the disclosure control for the same <nav> landmark.
   ------------------------------------------------------------------------ */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-box {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
}

.nav-toggle-box span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.nav-toggle-box span:nth-child(1) { top: 0; }
.nav-toggle-box span:nth-child(2) { top: 6px; }
.nav-toggle-box span:nth-child(3) { top: 12px; }

.site-header.nav-open .nav-toggle-box span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.nav-open .nav-toggle-box span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle-box span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 12px 20px;
  font-weight: 750;
  cursor: pointer;
  transition: .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: white;
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  color: var(--text);
  background: white;
  border-color: var(--border);
}

.btn-outline {
  border-color: var(--border);
  background: white;
}

.btn-light {
  background: white;
  color: var(--dark);
}

.btn-large {
  padding: 15px 22px;
}

.full-width {
  width: 100%;
}

.hero {
  background:
    radial-gradient(circle at 80% 20%, rgba(204,0,0,.12), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
  overflow: hidden;
}

.hero-grid {
  min-height: 690px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 80px;
  align-items: center;
  padding-top: 60px;
  padding-bottom: 70px;
}

.eyebrow,
.section-kicker,
.section-heading > span,
.action-label {
  color: var(--primary);
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 850;
}

.hero h1 {
  font-size: clamp(46px, 6vw, 76px);
  line-height: 1.03;
  letter-spacing: -.045em;
  margin: 22px 0;
  max-width: 760px;
}

.hero h1 span {
  color: var(--primary);
}

.hero-description {
  font-size: 19px;
  color: var(--muted);
  max-width: 670px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.hero-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 20px;
}

.hero-card {
  padding: 34px;
  background: #0a0a0a;
  color: white;
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(17,24,39,.2);
}

.hero-card-label {
  color: #fda4af;
  font-size: 12px;
  letter-spacing: .13em;
  font-weight: 850;
}

.hero-card h2 {
  font-size: 32px;
  line-height: 1.15;
  margin: 14px 0 32px;
}

.feature-mini {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 21px 0;
  border-top: 1px solid rgba(255,255,255,.12);
}

.feature-mini > span {
  color: #fda4af;
  font-weight: 800;
}

.feature-mini p {
  color: #98a2b3;
  margin: 4px 0 0;
  font-size: 14px;
}

.quick-actions {
  padding: 0 0 40px;
  margin-top: -25px;
  position: relative;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.action-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 20px;
}

.action-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-size: 26px;
  font-weight: 500;
}

.action-card h2 {
  margin: 8px 0;
  font-size: 24px;
}

.action-card p {
  color: var(--muted);
  margin: 0 0 15px;
}

.primary-card .action-icon {
  background: var(--primary);
  color: white;
}

.text-link {
  color: var(--primary);
  font-weight: 800;
}

.section {
  padding: 100px 0;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 44px;
}

.section-heading h2 {
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.1;
  letter-spacing: -.035em;
  margin: 12px 0;
}

.section-heading p {
  color: var(--muted);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.service-card,
.why-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: white;
}

.service-number,
.why-card > strong {
  color: var(--primary);
  font-size: 13px;
}

.service-card h3,
.why-card h3 {
  font-size: 21px;
}

.service-card p,
.why-card p {
  color: var(--muted);
  font-size: 15px;
}

.section-dark {
  background: var(--dark);
  color: white;
}

/* WCAG AA on the DARK section. `--primary` (#cc0000) is the brand red and it is
 * fine on light backgrounds, but the process section is near-black and the same
 * colour measures 3.42:1 there — below the 4.5:1 normal text needs. Scoped
 * rather than changed at the source, because the brand colour is correct
 * everywhere it is used on light.
 *
 * Measured by tests/e2e/visual.spec.js, which computes contrast from the rendered
 * colours: this exact element was 3.42:1 before, 5.05:1 after. */
.section-heading.light-heading > span,
.light-heading .eyebrow,
.light-heading .section-kicker {
  color: #f05055;
}

.light-heading p {
  color: #98a2b3;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.process-item {
  padding: 28px 0;
  border-top: 1px solid #344054;
}

.process-item strong {
  color: #fda4af;
}

.process-item h3 {
  font-size: 24px;
}

.process-item p {
  color: #98a2b3;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.register-section {
  background: var(--surface);
}

.register-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 80px;
  align-items: start;
}

.register-copy h2 {
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.register-copy p,
.register-copy li {
  color: var(--muted);
}

.register-copy ul {
  padding-left: 20px;
}

.register-form {
  padding: 34px;
  border-radius: 28px;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.form-title {
  display: flex;
  flex-direction: column;
  margin-bottom: 25px;
}

.form-title strong {
  font-size: 24px;
}

.form-title span {
  color: var(--muted);
  font-size: 13px;
}

.register-form label:not(.checkbox-row) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 14px;
}

.register-form input,
.register-form select {
  min-height: 49px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  background: white;
  outline: none;
}

.register-form input:focus,
.register-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(204,0,0,.08);
}

/* The base rule above sets outline:none, which would also hide the keyboard
   focus ring. This re-states it at a higher specificity for keyboard users. */
.register-form input:focus-visible,
.register-form select:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Invalid state. Colour is never the only signal: the field also gets
   aria-invalid="true" and an inline message wired with aria-describedby. */
.register-form input[aria-invalid="true"],
.register-form select[aria-invalid="true"] {
  border-color: #f04438;
  background: #fffbfa;
}

.field-error {
  color: #b42318;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.checkbox-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin: 22px 0;
  color: var(--muted);
  font-size: 13px;
}

.checkbox-row input {
  min-height: auto;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------------
   G07 — registration result states.
   The colour is reinforced with wording and, on success/failure, with focus
   moved to this region (it carries role="status" aria-live="polite").
   min-height is kept so the first message does not shift the layout.
   ------------------------------------------------------------------------ */
.form-message {
  margin-top: 15px;
  min-height: 20px;
  font-size: 14px;
}

.form-message.is-success,
.form-message.is-error,
.form-message.is-pending {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  line-height: 1.55;
}

.form-message.is-success {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}

.form-message.is-error {
  color: #b42318;
  background: #fef3f2;
  border-color: #fecdca;
}

.form-message.is-pending {
  color: #b54708;
  background: #fffaeb;
  border-color: #fedf89;
}

/* Busy / completed submit button. */
.btn[aria-busy="true"] {
  cursor: progress;
}

.btn[aria-busy="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: vo-spin .7s linear infinite;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .8;
}

.btn:disabled:hover {
  transform: none;
}

@keyframes vo-spin {
  to { transform: rotate(360deg); }
}

/* "Đăng nhập / Kiểm tra đơn" — revealed on success or on a pending
   registration. Hidden by default via the [hidden] attribute. */
.form-success {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.form-success[hidden] {
  display: none;
}

.existing-customer {
  text-align: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.existing-customer a {
  color: var(--primary);
  font-weight: 800;
}

/* ---------------------------------------------------------------------------
   G04B — public tracking lookup.

   One card: mode buttons, one input row, one live status line, one result list.
   Colour is never the only signal — every state also changes the WORDING, and the
   status line is the live region (role="status"), so the answer is announced as
   well as painted.

   The two properties that matter at 412px are marked below: `min-width: 0` on the
   input (a flex item refuses to shrink below its content width without it, which
   is the usual cause of sideways scroll) and `overflow-wrap: anywhere` on the
   values (a tracking code has no spaces, so it would otherwise push the card
   wider than the screen).
   ------------------------------------------------------------------------ */
.tracking-section {
  background: var(--surface);
}

.tracking-card {
  max-width: 900px;
  padding: 34px;
  border-radius: 28px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.tracking-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

/* min-height 44px is the accepted minimum touch target: both modes must be
   tappable with a thumb without zooming. */
.tracking-mode {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  transition: .2s ease;
}

.tracking-mode.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.tracking-form {
  margin: 0;
}

.tracking-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14px;
}

.tracking-input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.tracking-input {
  /* See the block comment above: without min-width:0 this flex item will not
     shrink below the width of its own placeholder and the row overflows. */
  flex: 1 1 auto;
  min-width: 0;
  min-height: 49px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  background: #ffffff;
  outline: none;
}

.tracking-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(204,0,0,.08);
}

/* The base rule above sets outline:none, which would also hide the keyboard focus
   ring. Re-stated at higher specificity for keyboard users, as on the form. */
.tracking-input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Same invalid treatment as the registration form: colour is reinforced by
   aria-invalid and by the message in the live region. */
.tracking-input[aria-invalid="true"] {
  border-color: #f04438;
  background: #fffbfa;
}

.tracking-submit {
  flex: 0 0 auto;
  white-space: nowrap;
}

.tracking-status {
  margin-top: 16px;
  /* Reserve the line so the card does not jump when the first answer lands. */
  min-height: 22px;
  font-size: 14px;
  color: var(--muted);
}

.tracking-status.is-found,
.tracking-status.is-notfound,
.tracking-status.is-error {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  line-height: 1.55;
}

.tracking-status.is-found {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}

/* Not-found is amber, not red: nothing is broken, the customer just needs to
   check the code. Provider errors are red because something IS broken. */
.tracking-status.is-notfound {
  color: #b54708;
  background: #fffaeb;
  border-color: #fedf89;
}

.tracking-status.is-error {
  color: #b42318;
  background: #fef3f2;
  border-color: #fecdca;
}

.tracking-results {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.tracking-results[hidden] {
  display: none;
}

.tracking-results h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.tracking-fields {
  display: grid;
  grid-template-columns: minmax(150px, 230px) 1fr;
  gap: 10px 20px;
  margin: 0;
}

/* dt/dd are DIRECT children of the grid, one pair per row: no wrapper element is
   needed, and a wrapper would have to be `display: contents` to keep the grid
   working — a trick worth avoiding inside a <dl>. */
.tracking-fields dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.tracking-fields dd {
  margin: 0;
  /* A code has no spaces to break at; `anywhere` is what keeps a 40-character
     one inside the card instead of widening the page. */
  overflow-wrap: anywhere;
}

.tracking-block {
  margin-top: 22px;
}

.tracking-block h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.tracking-logs {
  margin: 0;
  padding-left: 20px;
}

.tracking-logs li {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.tracking-logs strong {
  display: block;
  font-weight: 750;
}

.tracking-log-note,
.tracking-log-time {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.tracking-children {
  margin: 0;
  padding-left: 20px;
}

.tracking-children li {
  margin-bottom: 14px;
}

.contact-section {
  background: var(--primary);
  color: white;
}

.contact-inner {
  min-height: 270px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.contact-inner h2 {
  font-size: 42px;
  margin: 8px 0;
}

.contact-inner p {
  max-width: 650px;
  color: rgba(255,255,255,.8);
}

.footer {
  background: #0a0a0a;
  color: white;
  padding: 65px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 50px;
}

.footer-grid > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-grid a,
.footer-grid p {
  color: #98a2b3;
}

.footer-logo {
  font-size: 28px;
}

.footer-bottom {
  border-top: 1px solid #262626;
  margin-top: 45px;
  padding-top: 25px;
  /* #667085 on the near-black footer measured 3.91:1 — below AA for 13px text. The footer is
   * the one place the muted grey sits on near-black; everywhere else it is on
   * white, where it passes. Lightened here only. Measured before/after by
   * tests/e2e/visual.spec.js. Re-measured after the BNI palette change: 5.46:1. */
  color: #7d8798;
  font-size: 13px;
}

@media (max-width: 980px) {
  /* G07 — the same <nav> landmark becomes a disclosure panel. visibility is
     used (not just opacity) so the links leave the tab order while closed. */
  .nav-toggle {
    display: inline-flex;
  }

  .header-inner {
    gap: 14px;
  }

  .desktop-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 20px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 44px rgba(16, 24, 40, .12);
    transform: translateY(-6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  .site-header.nav-open .desktop-nav {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .desktop-nav a {
    padding: 15px 2px;
    font-size: 16px;
    border-bottom: 1px solid var(--surface-2);
  }

  .desktop-nav a:last-child {
    border-bottom: 0;
  }

  .hero-grid,
  .register-grid {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .hero-grid {
    min-height: auto;
  }

  .services-grid,
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-card {
    max-width: 700px;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .site-header .brand-text span {
    display: none;
  }

  /* Keep the login entry point and the menu button on one line at 360px. */
  .header-inner {
    gap: 10px;
  }

  .header-login {
    padding: 10px 13px;
    font-size: 13px;
  }

  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .hero-grid {
    padding-top: 45px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .action-grid,
  .services-grid,
  .process-grid,
  .why-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .action-card {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 75px 0;
  }

  .register-copy h2 {
    font-size: 36px;
  }

  .register-form {
    padding: 24px;
  }

  /* G04B at 412px. The input row stacks and the button takes the full width, so
     the control can never be clipped by the card; the result rows go one per
     line because a 150px label column leaves too little room for a code. */
  .tracking-card {
    padding: 20px;
  }

  .tracking-input-row {
    flex-direction: column;
  }

  .tracking-submit {
    width: 100%;
  }

  .tracking-mode {
    flex: 1 1 auto;
  }

  .tracking-fields {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .tracking-fields dd {
    margin: 0 0 12px;
  }

  .contact-inner {
    padding: 55px 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-inner h2 {
    font-size: 35px;
  }
}

/* ---------------------------------------------------------------------------
   G06/G07 — reduced motion.
   Honours the operating-system "reduce motion" setting: no smooth scrolling
   and effectively no transitions or animation. Content and state changes still
   happen; only the movement is removed.
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .skip-link {
    transition: none;
  }
}
