/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #000521;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background: seamless vertical scroll */
.bg-scroll {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-scroll-inner {
  height: 200vh;
  animation: bg-scroll 25s linear infinite;
}

.bg-scroll-item {
  height: 100vh;
  background-image: url("../img/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@keyframes bg-scroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 16px 20px 300px; /* extra bottom padding for fixed slider (60 + 200 + space) */
  max-width: 480px;
  margin: 0 auto;
}

/* 1. Header - language switcher */
.header {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fffffff2;
  border: none;
  border-radius: 999px;
  color: rgba(102, 102, 102, 0.9);
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lang-icon {
  font-size: 16px;
}

.lang-arrow {
  font-size: 10px;
  opacity: 0.8;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  margin: 4px 0 0;
  padding: 8px 0;
  list-style: none;
  background: #1a1a2e;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-width: 140px;
  z-index: 10;
}

.lang-dropdown[hidden] {
  display: none;
}

.lang-dropdown li {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.lang-dropdown li:hover,
.lang-dropdown li[aria-selected="true"] {
  background: rgba(255, 77, 109, 0.2);
  color: #fff;
}

/* 2. Brand title */
.brand-title {
  margin: 0 0 28px;
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 700;
  font-style: italic;
  color: #ff4d6d;
  text-align: center;
  letter-spacing: -0.02em;
}

/* 3. Intro: logo + text */
.intro {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}


.intro-logo {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  overflow: hidden;
  background: #ff4d6d;
}


.intro-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-text {
  margin: 0;
  text-shadow: 0 2px 4px #00000080;
  font-size: 20px;
  font-weight: 600;
  font-family: Comic Sans MS, Comic Sans, cursive, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif;
  line-height: 1.45;
  color: #fff;
  flex: 1;
}

/* 4. Tip box */
.tip-box {
  padding: 14px 18px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(45, 27, 46, 0.75) 0%, rgba(26, 21, 32, 0.75) 100%);
  border: 2px solid #e6c84a;
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(230, 200, 74, 0.35);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #e6c84a;
  line-height: 1.4;
}

/* 5. Horizontal seamless slider - fixed at bottom, 60px from bottom */
.slider-wrap {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 200px;
  overflow: hidden;
  z-index: 50;
}

.slider-track {
  height: 100%;
  overflow: hidden;
}

.slider-inner {
  display: flex;
  align-items: stretch;
  width: max-content;
  animation: scroll 28s linear infinite;
}

.slider-inner img {
  flex-shrink: 0;
  width: 120px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-right: 12px;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* 6. Login button - fixed at bottom, 20px from bottom */
.actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-login {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%);
  z-index: 60;
  cursor: pointer;
  background: linear-gradient(135deg, #fe4e60, #fe4e60);
  border: none;
  border-radius: 30px;
  justify-content: center;
  align-items: center;
  min-width: 300px;
  height: 95px;
  padding: 15px 30px;
  transition: all 0.3s;
  display: flex;
  box-shadow: 0 8px 25px #fe4e6066;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.btn-login-text {
  color: #fff;
  text-shadow: 0 2px 4px #0000004d;
  letter-spacing: 1px;
  font-size: 24px;
  font-weight: 900;
}

.btn-login:active {
  transform: translate(-50%) scale(0.98);
}

/* 7. Fixed share button */
.btn-share {
  position: fixed;
  bottom: 150px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ff4d6d;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.5);
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.btn-share:active {
  transform: scale(0.95);
}

/* Connect with WhatsApp modal */
.connect-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}

.connect-modal-mask.is-hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.connect-modal {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.connect-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.connect-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  color: #333;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.connect-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}

.connect-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px 32px;
  background: linear-gradient(180deg, #ffe8ec 0%, #fff5f7 50%, #fff 100%);
  border-radius: 0 0 20px 20px;
  overflow-y: auto;
}

.connect-modal-heading {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: #ff5a6e;
  text-align: center;
}

.connect-modal-subtitle {
  margin: 0 0 28px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  text-align: center;
  line-height: 1.45;
  max-width: 280px;
}

.connect-phone-wrap {
  display: flex;
  width: 100%;
  max-width: 320px;
  height: 50px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 3px;
}

.connect-country {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 12px;
  background: #fff0f2;
  border-right: 1px solid #ffc4cc;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.connect-country-arrow {
  font-size: 10px;
  opacity: 0.8;
}

.connect-phone-input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  font-size: 16px;
  border: none;
  background: transparent;
  outline: none;
}

.connect-phone-input::placeholder {
  color: #aaa;
}

.connect-phone-wrap.is-error {
  border-color: #e53935;
  box-shadow: 0 0 0 1px #e53935;
}

.connect-phone-error {
  margin: 6px 0;
  padding: 0;
  font-size: 13px;
  color: #e53935;
  min-height: 20px;
  width: 100%;
  max-width: 320px;
}

.connect-modal-btn {
  width: 100%;
  max-width: 320px;
  height: 50px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 16px;
  color: #fff;
  background: linear-gradient(135deg, #fe4e60, #fe4e60);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(254, 78, 96, 0.4);
  transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.connect-modal-btn:active {
  transform: scale(0.98);
}

/* Verification code modal */
.verify-code-mask {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 36px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
}

.verify-code-mask.is-hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.verify-code-dialog {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 28px 22px 24px;
  background: #ffd1dc;
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.verify-code-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #e8e8e8;
  color: #444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.verify-code-title {
  margin: 8px 0 12px;
  padding: 0 36px 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: #ff4d6d;
  line-height: 1.3;
}

.verify-code-sub {
  margin: 0 0 22px;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  line-height: 1.45;
}

.verify-code-sub-label {
  display: block;
  margin-bottom: 4px;
}

.verify-code-phone {
  display: block;
  font-weight: 600;
  color: #666;
}

.verify-code-digits {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: nowrap;
}

.verify-code-digit {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ffc4d4;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #7b61ff;
  line-height: 1;
}

.verify-code-copy-btn {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: #f04e5e;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(240, 78, 94, 0.35);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.verify-code-copy-btn:active {
  transform: scale(0.98);
}

/* Tips modal (after Copiar para WhatsApp) */
.tips-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 232;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 36px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
}

.tips-modal-mask.is-hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.tips-dialog {
  width: 100%;
  max-width: 340px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 20px 22px;
  background: #ffe0e9;
  border-radius: 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.tips-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: #ff4d6d;
}

.tips-text-top {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  line-height: 1.5;
  padding: 0 4px;
}

.tips-illustration {
  position: relative;
  margin: 0 auto 16px;
  max-width: 260px;
}

.tips-phone-mock {
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.tips-phone-mock img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto;
  vertical-align: top;
}

.tips-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 18px solid #ff3b30;
  transform: translateY(-50%);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.tips-text-bottom {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  line-height: 1.45;
}

.tips-code-block {
  margin-bottom: 10px;
}

.tips-code-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.tips-code-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #ff4d6d;
  letter-spacing: 0.04em;
}

.tips-retry-btn {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #fe4e60, #fe4e60);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(254, 78, 96, 0.4);
  -webkit-tap-highlight-color: transparent;
}

.tips-retry-btn:active {
  transform: scale(0.98);
}

/* Toast: pair code success */
.app-toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  z-index: 240;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: fit-content;
  min-width: min(330px, calc(100vw - 20px));
  max-width: calc(100% - 20px);
  padding: 14px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.app-toast.is-hidden {
  display: none !important;
}

.app-toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.app-toast-text {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Share sheet modal */
.share-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 235;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
}

.share-modal-mask.is-hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.share-modal {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 12px 18px 20px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
}

.share-modal-handle {
  width: 46px;
  height: 4px;
  margin: 8px auto 16px auto;
  border-radius: 999px;
  background: #d8d8d8;
}

.share-modal-title {
  margin: 0 0 24px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 10px;
  margin-bottom: 32px;
}

.share-item {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  cursor: pointer;
}

.share-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.share-icon.instagram { background: radial-gradient(circle at 30% 100%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.share-icon.whatsapp { background: #25d366; }
.share-icon.facebook { background: #1877f2; }
.share-icon.telegram { background: #1d9bf0; }

.share-label {
  font-size: 15px;
  color: #333;
}

.share-cancel-btn {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 24px;
  background-color: rgb(245, 245, 245);
  color: #333;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

/* Country code picker modal */
.country-picker-mask {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  -webkit-tap-highlight-color: transparent;
}

.country-picker-mask.is-hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.country-picker {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.country-picker-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #ffddee;
  flex-shrink: 0;
}

.country-picker-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  color: #444;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.country-picker-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.country-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.country-picker-search-icon {
  flex-shrink: 0;
  color: #999;
}

.country-picker-search {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.country-picker-search::placeholder {
  color: #aaa;
}

.country-picker-list {
  flex: 1;
  min-height: 200px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.country-picker-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.country-picker-item:hover {
  background: #fff5f7;
}

.country-picker-item.is-selected {
  background: #ffe4eb;
}

.country-picker-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffddee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1a;
  flex-shrink: 0;
}

.country-picker-item-info {
  flex: 1;
  min-width: 0;
}

.country-picker-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 2px;
}

.country-picker-item-code {
  font-size: 12px;
  color: #888;
  margin: 0;
}

.country-picker-item-dial {
  font-size: 14px;
  color: #666;
  flex-shrink: 0;
}

.country-picker-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d6d;
  flex-shrink: 0;
  margin-left: 4px;
}

/* Welcome modal overlay */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-tap-highlight-color: transparent;
}

.modal-mask.is-hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.modal-dialog {
  width: 100%;
  max-width: 340px;
  padding: 32px 30px 28px;
  background: #ffe0e6;
  border-radius: 30px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-text {
  margin: 0 0 24px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  color: #ff4d6d;
}

.modal-btn-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 140px;
  height: 48px;
  padding: 0 32px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #fe4e60, #fe4e60);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 8px 25px #fe4e6066;
  transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.modal-btn-confirm:active {
  transform: scale(0.98);
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .slider-inner {
    animation: none;
  }
}
