:root {
  --aquax-deep: #006b5f;
  --aquax-tide: #007d70;
  --aquax-mint: #e8f7f3;
  --aquax-foam: #f7faf9;
  --aquax-ink: #111827;
  --aquax-muted: #667085;
  --aquax-line: #e6ecea;
  --aquax-card: #ffffff;
  --aquax-shadow: 0 18px 48px rgba(17, 24, 39, 0.08);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --duration-exit: 150ms;
  --duration-enter: 210ms;
  --duration-move: 400ms;
}

@keyframes fade {
  from {
    filter: blur(3px);
    opacity: 0;
  }

  to {
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes slide {
  from {
    translate: var(--slide-offset);
  }

  to {
    translate: 0;
  }
}

@keyframes slide-y {
  from {
    transform: translateY(var(--slide-y-offset, 10px));
  }

  to {
    transform: translateY(0);
  }
}

@keyframes via-blur {
  30% {
    filter: blur(3px);
  }
}

::view-transition-old(.fade-out) {
  animation: var(--duration-exit) ease-in fade reverse;
}

::view-transition-new(.fade-in) {
  animation: var(--duration-enter) ease-out var(--duration-exit) both fade;
}

::view-transition-old(.slide-down) {
  animation:
    var(--duration-exit) ease-out both fade reverse,
    var(--duration-exit) ease-out both slide-y reverse;
}

::view-transition-new(.slide-up) {
  animation:
    var(--duration-enter) ease-in var(--duration-exit) both fade,
    var(--duration-move) ease-in both slide-y;
}

::view-transition-new(.slide-from-right) {
  --slide-offset: 60px;
  animation:
    var(--duration-enter) ease-out var(--duration-exit) both fade,
    var(--duration-move) ease-in-out both slide;
}

::view-transition-old(.slide-to-left) {
  --slide-offset: -60px;
  animation:
    var(--duration-exit) ease-in both fade reverse,
    var(--duration-move) ease-in-out both slide reverse;
}

::view-transition-new(.slide-from-left) {
  --slide-offset: -60px;
  animation:
    var(--duration-enter) ease-out var(--duration-exit) both fade,
    var(--duration-move) ease-in-out both slide;
}

::view-transition-old(.slide-to-right) {
  --slide-offset: 60px;
  animation:
    var(--duration-exit) ease-in both fade reverse,
    var(--duration-move) ease-in-out both slide reverse;
}

::view-transition-old(.nav-forward) {
  --slide-offset: -60px;
  animation:
    var(--duration-exit) ease-in both fade reverse,
    var(--duration-move) ease-in-out both slide reverse;
}

::view-transition-new(.nav-forward) {
  --slide-offset: 60px;
  animation:
    var(--duration-enter) ease-out var(--duration-exit) both fade,
    var(--duration-move) ease-in-out both slide;
}

::view-transition-old(.nav-back) {
  --slide-offset: 60px;
  animation:
    var(--duration-exit) ease-in both fade reverse,
    var(--duration-move) ease-in-out both slide reverse;
}

::view-transition-new(.nav-back) {
  --slide-offset: -60px;
  animation:
    var(--duration-enter) ease-out var(--duration-exit) both fade,
    var(--duration-move) ease-in-out both slide;
}

::view-transition-group(.morph) {
  animation-duration: var(--duration-move);
}

::view-transition-image-pair(.morph) {
  animation-name: via-blur;
}

::view-transition-group(.text-morph) {
  animation-duration: var(--duration-move);
}

::view-transition-old(.text-morph) {
  display: none;
}

::view-transition-new(.text-morph) {
  animation: none;
  object-fit: none;
  object-position: left top;
}

::view-transition-old(.scale-out) {
  animation: var(--duration-exit) ease-in scale-down;
}

::view-transition-new(.scale-in) {
  animation: var(--duration-enter) ease-out var(--duration-exit) both scale-up;
}

@keyframes scale-down {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes scale-up {
  from {
    opacity: 0;
    transform: scale(0.85);
  }

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

::view-transition-group(site-header),
::view-transition-group(site-footer) {
  animation: none;
  z-index: 100;
}

::view-transition-old(site-header),
::view-transition-old(site-footer) {
  display: none;
}

::view-transition-new(site-header),
::view-transition-new(site-footer) {
  animation: none;
}

::view-transition-old(legal-hero),
::view-transition-old(legal-content) {
  animation:
    var(--duration-exit) ease-out both fade reverse,
    var(--duration-exit) ease-out both slide-y reverse;
}

::view-transition-new(legal-hero),
::view-transition-new(legal-content) {
  animation:
    var(--duration-enter) ease-out var(--duration-exit) both fade,
    var(--duration-move) ease-out both slide-y;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(232, 247, 243, 0.9) 0, rgba(247, 250, 249, 0) 380px),
    var(--aquax-foam);
  color: var(--aquax-ink);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

html.i18n-pending [data-i18n] {
  visibility: hidden;
}

.brand-bar {
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.16), transparent 26%),
    linear-gradient(90deg, #006456, var(--aquax-deep));
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 50;
  view-transition-name: site-header;
}

.page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.brand-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  object-fit: contain;
  padding: 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.42);
  outline: none;
}

.language-switch {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 24px rgba(0, 55, 49, 0.16);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.language-switch:hover,
.language-switch:focus-within {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
}

.language-switch:focus-within {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(0, 55, 49, 0.16);
}

.language-switch button {
  min-width: 60px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  padding: 0 9px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.language-switch button:hover,
.language-switch button:focus-visible {
  color: #ffffff;
  outline: none;
}

.language-switch button:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.language-switch button[aria-pressed="true"] {
  background: #ffffff;
  color: var(--aquax-deep);
}

html[lang="en"].i18n-pending
  .language-switch
  button[data-language-option="vi"] {
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

html[lang="en"].i18n-pending
  .language-switch
  button[data-language-option="en"] {
  background: #ffffff;
  color: var(--aquax-deep);
}

.language-flag {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-block;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    0 2px 8px rgba(0, 40, 36, 0.18);
}

.flag-vn {
  background: #da251d;
}

.flag-vn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #ffde00;
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 56%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 56%,
    2% 35%,
    39% 35%
  );
  transform: translate(-50%, -50%);
}

.flag-en {
  background: repeating-linear-gradient(
    180deg,
    #b22234 0 7.7%,
    #ffffff 7.7% 15.4%
  );
}

.flag-en::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 56%;
  height: 54%;
  background: #3c3b6e;
}

.flag-en::after {
  content: "";
  position: absolute;
  left: 7%;
  top: 8%;
  width: 42%;
  height: 38%;
  background-image:
    radial-gradient(circle, #ffffff 0 0.8px, transparent 1.15px),
    radial-gradient(circle, #ffffff 0 0.8px, transparent 1.15px);
  background-position: 0 0, 4px 4px;
  background-size: 8px 8px;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  border-bottom: 1px solid var(--aquax-line);
  view-transition-name: legal-hero;
}

.hero-icon {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  color: var(--aquax-deep);
  background: linear-gradient(180deg, #edfff8, #dff8ef);
  border: 1px solid #baf0db;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -10px 22px rgba(0, 107, 95, 0.05);
}

.hero h1,
.section-title,
.card-title {
  font-family: var(--font-display);
  letter-spacing: 0;
}

.updated-pill {
  border: 1px solid var(--aquax-line);
  background: #f8fbfa;
  color: #7b8794;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 14px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--aquax-tide);
  box-shadow: 0 0 0 5px rgba(0, 125, 112, 0.08);
}

.content-section {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  view-transition-name: legal-content;
}

.policy-card,
.contact-card,
.faq-card,
.info-card {
  background: var(--aquax-card);
  border: 1px solid var(--aquax-line);
  border-radius: 22px;
  box-shadow: 0 2px 0 rgba(17, 24, 39, 0.03), var(--aquax-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.policy-card:hover,
.contact-card:hover,
.faq-card:hover,
.info-card:hover {
  border-color: rgba(0, 125, 112, 0.2);
  box-shadow: 0 2px 0 rgba(17, 24, 39, 0.03), 0 22px 54px rgba(17, 24, 39, 0.11);
  transform: translateY(-2px);
}

.policy-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
}

.icon-tile {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #e7f4f2;
  color: var(--aquax-tide);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.body-copy {
  color: var(--aquax-muted);
  line-height: 1.82;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #203447;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.contact-card {
  min-height: 112px;
  padding: 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.faq-card {
  overflow: hidden;
}

.faq-card summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  list-style: none;
  padding: 24px;
}

.faq-card summary::-webkit-details-marker {
  display: none;
}

.faq-card .chevron {
  color: #98a2b3;
  transition: transform 160ms ease;
}

.faq-card[open] .chevron {
  transform: rotate(180deg);
}

.faq-answer {
  border-top: 1px solid #edf2f1;
  padding: 22px 72px 26px;
}

.info-card {
  overflow: hidden;
}

.info-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 28px;
  border-top: 1px solid #edf2f1;
}

.info-row:first-child {
  border-top: 0;
}

.footer {
  background:
    radial-gradient(circle at 8% 50%, rgba(255, 255, 255, 0.15), transparent 20%),
    var(--aquax-deep);
  color: #ffffff;
  view-transition-name: site-footer;
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  padding: 4px;
}

.legal-layout {
  display: grid;
  gap: 16px;
}

@media (max-width: 768px) {
  .brand-shell {
    width: min(100% - 24px, 1120px);
  }

  .header-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .nav-link {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }

  .language-switch {
    min-height: 32px;
  }

  .language-switch button {
    min-width: 52px;
    min-height: 26px;
    gap: 5px;
    padding: 0 7px;
    font-size: 12px;
  }

  .language-flag {
    width: 20px;
    height: 20px;
  }

  .flag-vn::after {
    width: 10px;
    height: 10px;
  }

  .hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }

  .policy-card,
  .contact-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px;
    border-radius: 18px;
  }

  .faq-card summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 20px;
  }

  .faq-answer {
    padding: 18px 20px 22px;
  }

  .info-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 18px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(*),
  ::view-transition-new(*),
  ::view-transition-group(*) {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
  }

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

  .policy-card,
  .contact-card,
  .faq-card,
  .info-card {
    transform: none !important;
  }
}
