:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --success: #16a34a;
  --success-bg: #ecfdf5;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-translucent: rgba(255, 255, 255, 0.85);
  --success-border: rgba(22, 163, 74, 0.3);
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e6eaf2;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 45px -15px rgba(37, 99, 235, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Myanmar Text", "Noto Sans Myanmar",
    "Padauk", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/*
 * Dark palette applies in two cases, so a manual toggle can always win
 * over the OS setting in either direction:
 *  1. System is dark AND the user hasn't explicitly chosen light.
 *  2. The user has explicitly chosen dark, regardless of system setting.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #4f83ff;
    --primary-dark: #3b6fe0;
    --primary-light: #7ea6ff;
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --bg: #0b1120;
    --surface: #131b2e;
    --surface-alt: #1a2338;
    --surface-translucent: rgba(19, 27, 46, 0.85);
    --success-border: rgba(52, 211, 153, 0.3);
    --text: #e9edf7;
    --text-muted: #97a1b8;
    --border: #232d47;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 45px -15px rgba(79, 131, 255, 0.45);
  }
}

:root[data-theme="dark"] {
  --primary: #4f83ff;
  --primary-dark: #3b6fe0;
  --primary-light: #7ea6ff;
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --bg: #0b1120;
  --surface: #131b2e;
  --surface-alt: #1a2338;
  --surface-translucent: rgba(19, 27, 46, 0.85);
  --success-border: rgba(52, 211, 153, 0.3);
  --text: #e9edf7;
  --text-muted: #97a1b8;
  --border: #232d47;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 45px -15px rgba(79, 131, 255, 0.45);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-translucent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-icon {
  font-size: 1.3rem;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Language dropdown ---------- */

.lang-switch {
  position: relative;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang-trigger:hover {
  border-color: var(--primary-light);
}

.lang-icon {
  font-size: 0.95rem;
  opacity: 0.8;
}

.lang-trigger .chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.lang-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 170px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px;
  transform-origin: top right;
  animation: menu-in 0.16s ease both;
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
}

.lang-menu li:hover {
  background: var(--surface-alt);
}

.lang-menu li[aria-selected="true"] {
  color: var(--primary);
  font-weight: 700;
}

.lang-menu li[aria-selected="true"]::after {
  content: "\2713";
}

.lang-menu li:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ---------- Theme toggle ---------- */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

.theme-toggle[data-active-icon="sun"] .icon-sun {
  display: block;
}

.theme-toggle[data-active-icon="moon"] .icon-moon {
  display: block;
}

/* ---------- Layout ---------- */

.container {
  max-width: 900px;
  margin: auto;
  padding: 40px 20px 20px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 140% at 15% 0%, #4f83ff 0%, var(--primary) 45%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 52px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fade-up 0.6s ease both;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 85% 100%, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 2.3rem;
  line-height: 1.25;
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero p {
  opacity: 0.95;
  max-width: 520px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.buttons {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  position: relative;
}

.button {
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.primary:active {
  transform: translateY(0);
}

/* ---------- Card ---------- */

.card {
  background: var(--surface);
  margin-top: 28px;
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  animation: fade-up 0.6s ease 0.1s both;
}

.card h2 {
  margin-bottom: 24px;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

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

.step {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
}

.number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.step-content h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-content p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.step-content strong {
  color: var(--text);
}

.tip {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-left: 4px solid var(--success);
  padding: 20px 22px;
  border-radius: var(--radius-sm);
  margin-top: 26px;
}

.tip h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.tip-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.tip-list li {
  position: relative;
  padding-left: 24px;
  color: var(--text);
  font-size: 0.94rem;
}

.tip-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* ---------- Footer ---------- */

footer {
  text-align: center;
  color: var(--text-muted);
  margin: 40px 0 30px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-dot {
  opacity: 0.6;
}

/* ---------- Motion & animation ---------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 40px 22px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .card {
    padding: 24px;
  }

  .topbar-inner {
    flex-wrap: wrap;
  }
}
