/* ================================================
   BINANCE – GLOBAL DESIGN SYSTEM
   ================================================ */

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

:root {
  --yellow:      #f0b90b;
  --yellow-h:    #d4a50a;
  --yellow-glow: rgba(240,185,11,0.14);
  --bg:          #181a20;
  --card:        #1e2026;
  --input-bg:    #2b3139;
  --border:      #2b3139;
  --border-h:    #474f59;
  --text:        #eaecef;
  --muted:       #848e9c;
  --white:       #ffffff;
  --green:       #0ecb81;
  --red:         #f6465d;
}

html, body { min-height: 100vh; }

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ================================================
   HEADER
   ================================================ */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  height: 64px;
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-left  { display: flex; align-items: center; gap: 32px; }
.top-right { display: flex; align-items: center; gap: 8px; }

.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo-svg  { height: 24px; width: auto; }

.nav-links { display: flex; align-items: center; }

.nav-item {
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
}

.nav-item > a, .nav-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color 0.15s;
}

.nav-item:hover, .nav-item a:hover { color: var(--yellow); }

.arrow-down {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s;
}

.lang-btn:hover { color: var(--text); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburger:hover span { background: var(--yellow); }
.close-btn { background: none; border: none; cursor: pointer; color: var(--text); font-size: 18px; padding: 6px; }
.close-btn:hover { color: var(--yellow); }
.hidden { display: none !important; }

/* Mobile menu */
.full-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 90;
  padding: 16px 24px;
  overflow-y: auto;
}

.full-menu.active { display: block; }

.menu-dropdown { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.menu-dropdown li a {
  display: block;
  padding: 14px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.menu-dropdown li a:hover { background: rgba(240,185,11,0.06); color: var(--yellow); }

/* ================================================
   MAIN
   ================================================ */

.main-container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px 56px;
}

.card-wrapper {
  width: 100%;
  max-width: 444px;
  background: var(--card);
  border-radius: 8px;
  padding: 36px 36px 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* ================================================
   PAGES
   ================================================ */

.form-page { display: none; flex-direction: column; }
.form-page.active { display: flex; }

/* ================================================
   CARD BRAND
   ================================================ */

.card-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
}

.bnb-mark { width: 26px; height: 26px; flex-shrink: 0; }

.bnb-wordmark {
  font-size: 17px;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 1.8px;
  line-height: 1;
}

/* ================================================
   TITLES & TEXT
   ================================================ */

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.3;
}

.description-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 28px;
}

/* ================================================
   INPUTS
   ================================================ */

.input-group { margin-bottom: 18px; }

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper input {
  width: 100%;
  height: 50px;
  background: transparent;
  border: 1px solid var(--border-h);
  border-radius: 4px;
  padding: 0 130px 0 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--white);
  outline: none;
  letter-spacing: 3px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input::placeholder { color: var(--muted); letter-spacing: 0; }

.input-wrapper input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow-glow);
}

.binance-select {
  width: 100%;
  height: 50px;
  background: var(--input-bg);
  border: 1px solid var(--border-h);
  border-radius: 4px;
  padding: 0 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--white);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23848e9c' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.binance-select:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px var(--yellow-glow);
}

.resend-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  padding: 0;
  transition: color 0.15s;
}

.resend-btn:hover { color: var(--yellow-h); }
.resend-btn.no-click { pointer-events: none; color: var(--muted); }

/* ================================================
   SUBMIT BUTTON
   ================================================ */

.submit-btn {
  display: block;
  width: 100%;
  height: 52px;
  background: var(--yellow);
  border: none;
  border-radius: 4px;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}

.submit-btn:hover { background: var(--yellow-h); }
.submit-btn:active { transform: scale(0.99); }

/* ================================================
   LINKS
   ================================================ */

.links-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.accent-link {
  color: var(--yellow);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.accent-link:hover { color: var(--yellow-h); text-decoration: underline; }

/* ================================================
   CAPTCHA PAGE
   ================================================ */

/* Puzzle image area */
.puzzle-area {
  width: 100%;
  height: 148px;
  border-radius: 6px;
  background: #2b3139;
  border: 1px solid var(--border-h);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

/* Decorative background pattern */
.puzzle-bg-pattern {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, #1e2329 25%, transparent 25%) -20px 0,
    linear-gradient(225deg, #1e2329 25%, transparent 25%) -20px 0,
    linear-gradient(315deg, #1e2329 25%, transparent 25%),
    linear-gradient(45deg,  #1e2329 25%, transparent 25%);
  background-size: 40px 40px;
  background-color: #252930;
  opacity: 0.8;
}

/* The target slot (gap to fill) */
.puzzle-slot {
  position: absolute;
  top: 50%;
  right: 14%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(0,0,0,0.45);
  border: 2px dashed rgba(240,185,11,0.5);
  border-radius: 6px;
}

/* The draggable piece (positioned by JS to follow slider) */
.puzzle-piece {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #f0b90b, #d4a50a);
  border-radius: 6px;
  box-shadow: 2px 0 12px rgba(0,0,0,0.4);
  transition: left 0.04s linear;
  pointer-events: none;
  z-index: 2;
}

.puzzle-piece-inner {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.15) 25%, transparent 25%) -14px 0,
    linear-gradient(225deg, rgba(255,255,255,0.15) 25%, transparent 25%) -14px 0,
    linear-gradient(315deg, rgba(255,255,255,0.15) 25%, transparent 25%),
    linear-gradient(45deg,  rgba(255,255,255,0.15) 25%, transparent 25%);
  background-size: 28px 28px;
  border-radius: 6px;
}

.puzzle-lock-icon {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Slider track */
.captcha-track-wrapper { margin-bottom: 18px; }

.captcha-track {
  width: 100%;
  height: 48px;
  background: var(--input-bg);
  border: 1px solid var(--border-h);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  user-select: none;
  cursor: default;
}

.captcha-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: rgba(240,185,11,0.12);
  transition: width 0.04s linear;
}

.captcha-handle {
  position: absolute;
  top: 0; left: 0;
  width: 56px;
  height: 100%;
  background: var(--yellow);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 2;
  transition: background 0.3s, left 0.04s linear;
  touch-action: none;
}

.captcha-handle:active { cursor: grabbing; }
.captcha-handle.success { background: var(--green); cursor: default; }

.captcha-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
  transition: color 0.3s, opacity 0.3s;
  z-index: 1;
}

.captcha-label.success-text { color: var(--green); font-weight: 600; }

.captcha-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

/* ================================================
   LOADING PAGE
   ================================================ */

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 0 16px;
  gap: 14px;
  min-height: 200px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3.5px solid rgba(240,185,11,0.15);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.loading-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: -6px;
}

/* Error box */
.error-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  animation: fadeUp 0.35s ease;
  width: 100%;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.error-icon { display: flex; }
.error-text { font-size: 14px; color: var(--red); font-weight: 600; text-align: center; }

.retry-btn {
  background: transparent;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 32px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.retry-btn:hover { background: var(--yellow); color: #1a1a1a; }

/* ================================================
   SUCCESS PAGE
   ================================================ */

.success-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 24px 0 10px;
}

.success-circle {
  width: 64px;
  height: 64px;
  animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}

.success-title { font-size: 22px; font-weight: 700; color: var(--green); }

.success-text {
  font-size: 14px;
  color: var(--muted);
  max-width: 300px;
  line-height: 1.65;
}

/* ================================================
   QR CONTAINER PAGE (STEP 3)
   ================================================ */

.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  padding: 16px;
  background: var(--white);
  border-radius: 8px;
  width: 200px;
  height: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.qr-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ================================================
   FOOTER
   ================================================ */

.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 12px;
}

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--yellow); }

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 900px) {
  .nav-links, .lang-btn, .nav-icon-btn { display: none; }
  .hamburger { display: flex; }
}

@media (max-width: 500px) {
  .card-wrapper {
    padding: 28px 18px 24px;
    border-radius: 0;
    box-shadow: none;
  }
  .main-container { padding: 0; align-items: flex-start; }
  .bottom-bar { flex-direction: column; gap: 10px; text-align: center; }
}
