:root {
  --wa-green: #25D366;
  --wa-green-dark: #1DA851;
  --wa-green-strong: #25D366;
  --wa-light-green: #e8faf0;
  --wa-bg: #ffffff;
  --wa-card: #ffffff;
  --wa-text: #111b21;
  --wa-text-secondary: #667781;
  --wa-line: rgba(0, 0, 0, 0.06);
  --wa-shadow: 0 1px 2px rgba(11, 20, 26, 0.06);
  --wa-shadow-strong: 0 2px 6px rgba(11, 20, 26, 0.08);
  --wa-radius: 12px;
  --wa-max-width: 430px;
  --wa-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  color: var(--wa-text);
}

button {
  border: 0;
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.landing-app {
  width: 100%;
  max-width: var(--wa-max-width);
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  position: relative;
  overflow-x: hidden;
}

.screen {
  min-height: 100vh;
  padding: 0 14px 20px;
}

.wa-header {
  position: relative;
  top: 0;
  z-index: 5;
  margin: 0 -14px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  background: #111b21;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

.wa-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  max-width: calc(100% - 112px);
}

.wa-header__logo {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #25D366;
}

.wa-header__logo svg {
  width: 100%;
  height: 100%;
}

.wa-header__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-progress {
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 12px 0 0;
}

.wa-progress__seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #d1d7db;
  transition: background 0.3s ease;
}

.wa-progress__seg.done {
  background: #25D366;
}

.wa-progress__seg.active {
  background: #25D366;
}

.intro-page,
.guide-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intro-page,
.guide-page {
  padding-top: 14px;
}

.hero-card,
.guide-hero,
.steps-card {
  background: var(--wa-card);
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow);
}

.hero-card {
  overflow: hidden;
  box-shadow: var(--wa-shadow-strong);
}

.hero-card--welcome {
  background: #ffffff;
}

.hero-card--prepare {
  background: #ffffff;
}

.hero-card__body {
  padding: 0;
}

.hero-card__banner {
  width: 100%;
  aspect-ratio: 1469 / 678;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  background: #f7f8fa;
}

.hero-card__banner-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-card__title {
  margin: 0;
  padding: 4px 20px 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-align: left;
  text-wrap: balance;
  overflow-wrap: anywhere;
  color: #c62828;
}

.hero-card__desc {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.75;
  text-align: left;
  text-wrap: pretty;
  overflow-wrap: anywhere;
  color: var(--wa-text-secondary);
}

.hero-card__desc-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px 22px;
}

.hero-card__phone-token {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  margin: 0 2px;
  border-radius: 999px;
  background: #e8faf0;
  color: #1DA851;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.page-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 0;
}

.primary-btn {
  min-height: 48px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.primary-btn:active {
  background: #1DA851;
}

.primary-btn--urgent {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  animation: pulse-btn 2s ease-in-out infinite;
  box-shadow: 0 4px 14px rgba(229, 57, 53, 0.35);
  font-size: 17px;
  letter-spacing: 0.04em;
}

.primary-btn--urgent:active {
  background: #b71c1c;
  animation: none;
}

.primary-btn.is-disabled {
  background: #d1d7db;
  cursor: not-allowed;
}

.secondary-link {
  min-height: 42px;
  border-radius: 999px;
  background: transparent;
  color: var(--wa-text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.guide-hero {
  padding: 14px;
  background: #fff;
  box-shadow: var(--wa-shadow);
}

.guide-hero__device-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8faf0;
  color: #1DA851;
  font-size: 13px;
  font-weight: 600;
}

.guide-hero__device-tag svg {
  width: 16px;
  height: 16px;
}

.guide-hero__top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-hero__eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: #25D366;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guide-hero__title {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0f2e24;
}

.guide-hero__number {
  padding: 10px 14px;
  border-radius: 10px;
  background: #f0f2f5;
}

.guide-hero__number-label {
  font-size: 12px;
  color: var(--wa-text-secondary);
}

.guide-hero__number-value {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

.steps-card {
  padding: 18px 16px;
  background: #fff;
}

.steps-card__title {
  font-size: 16px;
  font-weight: 700;
}

.branch-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.branch-switch__btn {
  min-height: 36px;
  border-radius: 999px;
  background: #f0f2f5;
  color: var(--wa-text-secondary);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.branch-switch__btn.is-active {
  background: #e8faf0;
  color: #1DA851;
  border-color: #25D366;
}

.steps-card__desc {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--wa-text-secondary);
}

.steps-card__subtitle {
  margin-top: 18px;
  font-size: 16px;
  font-weight: 700;
}

.steps-rail {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.steps-rail::-webkit-scrollbar {
  display: none;
}

.step-slide {
  flex: 0 0 min(78vw, 280px);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 1px 4px rgba(11, 20, 26, 0.08);
  border: 1px solid #e9edef;
}

.step-slide__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f0f2f5;
}

.step-slide__index {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.step-slide__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.step-slide__image {
  display: block;
  width: 100%;
  aspect-ratio: 680 / 1400;
  object-fit: cover;
  background: #eceff1;
}

.guide-bottom-space {
  height: 164px;
}

.sticky-loading,
.sticky-code {
  position: fixed;
  left: max(0px, calc((100vw - var(--wa-max-width)) / 2));
  width: min(100vw, var(--wa-max-width));
  bottom: 0;
  z-index: 8;
  animation: slide-up 0.22s ease;
}

.locked-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(240, 242, 245, 0.88);
  backdrop-filter: blur(6px);
}

.locked-overlay__card {
  width: min(100%, 280px);
  padding: 28px 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(11, 20, 26, 0.15);
  text-align: center;
}

.locked-overlay__lock {
  position: relative;
  width: 64px;
  height: 72px;
  margin: 0 auto 18px;
}

.locked-overlay__lock-body {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, #25D366, #1DA851);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.locked-overlay__lock-hook {
  position: absolute;
  left: 18px;
  top: 0;
  width: 28px;
  height: 34px;
  border: 6px solid #25D366;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

.locked-overlay__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--wa-text);
}

.locked-overlay__desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--wa-text-secondary);
}
/* Device selection page */
.device-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
}

.device-card {
  background: #fff;
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow);
  padding: 28px 20px;
  text-align: center;
}

.device-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #25D366;
  background: #e8faf0;
  border-radius: 50%;
}

.device-card__icon svg {
  width: 32px;
  height: 32px;
}

.device-card__step-label {
  font-size: 12px;
  font-weight: 600;
  color: #25D366;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.device-card__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--wa-text);
}

.device-card__subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--wa-text-secondary);
}

.device-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.device-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border-radius: 12px;
  background: #f0f2f5;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.device-option:active {
  transform: scale(0.97);
}

.device-option.is-selected {
  background: #e8faf0;
  border-color: #25D366;
}

.device-option__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-text-secondary);
}

.device-option.is-selected .device-option__icon {
  color: #25D366;
}

.device-option__icon svg {
  width: 32px;
  height: 32px;
}

.device-option__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--wa-text);
}

.device-option__check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  color: #25D366;
}
.sticky-loading {
  background: #fff;
  border-top: 3px solid #25D366;
  box-shadow: 0 -4px 16px rgba(11, 20, 26, 0.1);
  padding: 16px 16px calc(16px + var(--wa-safe-bottom));
}

.sticky-loading__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 3px solid rgba(37, 211, 102, 0.2);
  border-top-color: #25D366;
  animation: spin 0.8s linear infinite;
}

.sticky-loading__text {
  font-size: 16px;
  font-weight: 700;
}

.sticky-code {
  background: #fff;
  border-top: 3px solid #25D366;
  box-shadow: 0 -4px 16px rgba(11, 20, 26, 0.1);
  padding-bottom: var(--wa-safe-bottom);
}

.sticky-code__main {
  padding: 18px 16px 14px;
  text-align: center;
}

.sticky-code__label {
  font-size: 13px;
  color: var(--wa-text-secondary);
}

.sticky-code__value {
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 6px;
  color: #25D366;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sticky-code__countdown {
  padding: 13px 16px calc(14px + var(--wa-safe-bottom));
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #8a6200;
  background: #fff4cc;
}

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

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@media (min-width: 431px) {
  .page-shell {
    padding-top: 0;
  }

  .landing-app {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 12px rgba(11, 20, 26, 0.08);
  }
}

@media (max-width: 360px) {
  .hero-card__title,
  .guide-hero__title {
    font-size: 22px;
  }

  .hero-card__desc {
    padding-left: 18px;
    padding-right: 18px;
  }

  .intro-page,
  .guide-page {
    padding-top: 12px;
  }

  .step-slide {
    flex-basis: min(82vw, 260px);
  }
}

/* Urgency & emphasis styles */
.hero-card__subtitle {
  margin: 0;
  padding: 16px 20px 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wa-text-secondary);
}

.hero-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 20px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff3e0;
  border: 1px solid #ffe0b2;
}

.hero-card--welcome .hero-alert {
  background: #ffebee;
  border-color: #ffcdd2;
}

.hero-alert__icon {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1.4;
}

.hero-alert__text {
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
  color: #b71c1c;
}

.hero-card--prepare .hero-alert__text {
  color: #e65100;
}

.text-danger {
  color: #c62828;
  font-weight: 700;
}

.desc-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #e8faf0;
  color: #1DA851;
  font-weight: 600;
  font-size: 13px;
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 4px 14px rgba(229, 57, 53, 0.35); }
  50% { box-shadow: 0 4px 24px rgba(229, 57, 53, 0.55); }
}

/* Scan page */
.scan-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 24px;
}

.scan-card {
  background: #fff;
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow-strong);
  overflow: hidden;
}

.scan-card__header {
  text-align: center;
  padding: 28px 20px 18px;
}

.scan-card__shield {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #25D366;
  background: #e8faf0;
  border-radius: 50%;
  animation: shield-pulse 1.5s ease-in-out infinite;
}

.scan-card__shield svg {
  width: 36px;
  height: 36px;
}

.scan-card__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--wa-text);
}

.scan-card__subtitle {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--wa-text-secondary);
}

.scan-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 16px;
}

.scan-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e9edef;
  overflow: hidden;
}

.scan-progress-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #25D366, #1DA851);
  transition: width 0.5s ease;
}

.scan-progress-pct {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: #25D366;
  min-width: 36px;
  text-align: right;
}

.scan-list {
  list-style: none;
  margin: 0;
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.scan-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--wa-line);
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.scan-item:last-child {
  border-bottom: none;
}

.scan-item.is-active,
.scan-item.is-done {
  opacity: 1;
}

.scan-item__icon {
  flex-shrink: 0;
  font-size: 20px;
  width: 32px;
  text-align: center;
}

.scan-item__body {
  flex: 1;
  min-width: 0;
}

.scan-item__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--wa-text);
}

.scan-item__detail {
  font-size: 12px;
  color: var(--wa-text-secondary);
  margin-top: 2px;
}

.scan-item.is-active .scan-item__label {
  color: #1DA851;
}

.scan-item.is-done .scan-item__label {
  color: var(--wa-text);
}

.scan-item__status {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(37, 211, 102, 0.2);
  border-top-color: #25D366;
  animation: spin 0.7s linear infinite;
}

.scan-check-icon {
  display: block;
  animation: check-pop 0.25s ease;
}

@keyframes shield-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
}

@keyframes check-pop {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* RTL Support */
html[dir="rtl"] {
  direction: rtl;
}

html[dir="rtl"] .wa-header {
  justify-content: center;
}

html[dir="rtl"] .wa-header__lang {
  left: 16px;
  right: auto;
}

html[dir="rtl"] .hero-alert {
  flex-direction: row-reverse;
}

html[dir="rtl"] .scan-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .device-option {
  flex-direction: column;
}

html[dir="rtl"] .guide-hero__top {
  text-align: right;
}

html[dir="rtl"] .guide-hero__number {
  text-align: right;
}

html[dir="rtl"] .hero-card__subtitle,
html[dir="rtl"] .hero-card__title,
html[dir="rtl"] .hero-card__desc {
  text-align: right;
}

html[dir="rtl"] .branch-switch {
  flex-direction: row-reverse;
}

html[dir="rtl"] .step-slide__head {
  flex-direction: row-reverse;
}

html[dir="rtl"] .guide-hero__device-tag,
html[dir="rtl"] .hero-card__phone-token,
html[dir="rtl"] .sticky-loading__inner,
html[dir="rtl"] .sticky-code__main {
  flex-direction: row-reverse;
}

html[dir="rtl"] .locked-overlay__lock-body {
  left: auto;
  right: 8px;
}

html[dir="rtl"] .locked-overlay__lock-hook {
  left: auto;
  right: 18px;
}

html[dir="rtl"] .scan-progress-pct {
  text-align: left;
}

html[dir="rtl"] .scan-item__status {
  order: -1;
}

html[dir="rtl"] .device-option__check {
  left: 8px;
  right: auto;
}

/* Language Switcher */
.wa-header__lang {
  position: absolute;
  top: calc(50% + env(safe-area-inset-top, 0px) / 2);
  right: 16px;
  transform: translateY(-50%);
}

.lang-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.lang-switch-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-switch-btn__current {
  font-size: 12px;
  letter-spacing: 0.02em;
}

html[dir="rtl"] .lang-switch-btn,
html[dir="rtl"] .lang-menu__item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .lang-switch-btn__current {
  letter-spacing: 0;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(11, 20, 26, 0.2);
  overflow: hidden;
  z-index: 100;
  animation: slide-down 0.15s ease;
}

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--wa-text);
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

html[dir="rtl"] .lang-menu__item {
  text-align: right;
}

.lang-menu__item:hover {
  background: #f0f2f5;
}

.lang-menu__item.is-active {
  background: #e8faf0;
  color: #1DA851;
  font-weight: 600;
}

.lang-menu__flag {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 360px) {
  .lang-switch-btn__current {
    display: none;
  }

  .lang-menu {
    min-width: 120px;
  }
}
