/* STrading public website: royal purple, glossy controls, restrained claymorphism.
   No external fonts or assets; served with a strict Content-Security-Policy. */
:root {
  --royal-900: #1a0838;
  --royal-800: #24104c;
  --royal-700: #331766;
  --royal-600: #4a2390;
  --royal-500: #6431c4;
  --royal-400: #8a5cf0;
  --royal-300: #b597ff;
  --gold: #f4c95d;
  --ink: #f6f1ff;
  --ink-soft: #cbbcef;
  --ink-faint: #9d8cc6;
  --danger: #ff9bb0;
  --ok: #9ff0c6;
  --clay: linear-gradient(145deg, #3a1b73 0%, #2a1157 100%);
  --clay-shadow: 14px 14px 30px rgba(8, 2, 22, 0.55), -8px -8px 22px rgba(120, 76, 214, 0.16),
    inset 1px 1px 0 rgba(255, 255, 255, 0.08);
  --radius-lg: 26px;
  --radius-md: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial,
    sans-serif;
}

* { box-sizing: border-box; }
/* The hidden attribute always wins over display rules (for example the referral check row). */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 700px at 50% -10%, #5326a8 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #2c0f63 0%, transparent 55%),
    linear-gradient(180deg, var(--royal-800) 0%, var(--royal-900) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
.aura {
  position: fixed;
  inset: -20vmax auto auto 50%;
  width: 60vmax;
  height: 60vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(181, 151, 255, 0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* ---- hero ---- */
.hero { text-align: center; margin-bottom: 22px; }
.icon-ring {
  display: inline-grid;
  place-items: center;
  width: 124px;
  height: 124px;
  border-radius: 34px;
  background: var(--clay);
  box-shadow: var(--clay-shadow), 0 0 42px rgba(138, 92, 240, 0.45);
}
.app-icon { border-radius: 24px; display: block; }
.small-icon { margin: 0 auto 6px; border-radius: 18px; box-shadow: 0 0 24px rgba(138, 92, 240, 0.4); }
h1 {
  margin: 20px 0 6px;
  font-size: clamp(1.9rem, 7.5vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #e4d6ff 55%, var(--gold) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 0 transparent;
  filter: drop-shadow(0 4px 18px rgba(138, 92, 240, 0.45));
}
.tagline { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.disclaimer {
  max-width: 400px;
  margin: 10px auto 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
  line-height: 1.45;
}
.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(244, 201, 93, 0.12);
  border: 1px solid rgba(244, 201, 93, 0.35);
  color: #ffe7a8;
  font-size: 0.92rem;
  text-align: center;
}

/* ---- card ---- */
.card {
  background: var(--clay);
  border-radius: var(--radius-lg);
  box-shadow: var(--clay-shadow);
  padding: 18px;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(10, 3, 28, 0.45);
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.45), inset -2px -2px 6px rgba(120, 76, 214, 0.12);
  margin-bottom: 18px;
}
.tab {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 8px;
  font: 600 0.98rem var(--font);
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}
.tab.is-active {
  color: #fff;
  background: linear-gradient(180deg, var(--royal-400) 0%, var(--royal-500) 55%, var(--royal-600) 100%);
  box-shadow: 0 6px 16px rgba(100, 49, 196, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.panel { display: grid; gap: 12px; }
.panel[hidden] { display: none; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; min-width: 0; }
fieldset:disabled { opacity: 0.55; }

/* ---- fields ---- */
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
input[type="tel"], input[type="text"], input[type="password"] {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(181, 151, 255, 0.18);
  border-radius: 14px;
  padding: 13px 14px;
  font: 500 1rem var(--font);
  color: var(--ink);
  background: rgba(12, 4, 32, 0.55);
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.45), inset -2px -2px 6px rgba(120, 76, 214, 0.1);
  outline: none;
}
input::placeholder { color: var(--ink-faint); }
input:focus { border-color: var(--royal-300); box-shadow: 0 0 0 3px rgba(138, 92, 240, 0.35); }
input:disabled { opacity: 0.6; }
.phone-row, .password-row { position: relative; display: flex; align-items: stretch; }
.prefix {
  display: grid;
  place-items: center;
  padding: 0 12px;
  margin-right: 8px;
  border-radius: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(12, 4, 32, 0.55);
  box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.4);
}
.password-row input { padding-right: 52px; }
.eye {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.eye::before {
  content: "";
  position: absolute;
  inset: 11px 8px;
  border: 2px solid var(--ink-soft);
  border-radius: 50% / 70%;
}
.eye::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--ink-soft);
}
.eye[aria-pressed="true"]::before { border-color: var(--royal-300); box-shadow: 0 0 10px rgba(181, 151, 255, 0.6); }
.eye[aria-pressed="true"]::after { background: var(--royal-300); }
.code-row { display: flex; align-items: end; gap: 10px; }
.grow { flex: 1; }
.hint { margin: 0; font-size: 0.82rem; color: var(--ink-faint); min-height: 1em; }
.hint.ok { color: var(--ok); }
.error { margin: 0; font-size: 0.88rem; color: var(--danger); min-height: 1.1em; }
.small { margin: 2px 0 0; text-align: center; font-size: 0.9rem; color: var(--ink-soft); }

/* ---- referral ---- */
.referral {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(244, 201, 93, 0.08);
  border: 1px solid rgba(244, 201, 93, 0.28);
}
.referral-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #ffe7a8; }
.referral-code { font: 700 1.02rem ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #fff; user-select: all; }
.referral-note { margin: 0; font-size: 0.84rem; color: var(--ink-soft); }
.check { display: flex; gap: 10px; align-items: center; font-size: 0.9rem; }
.check input { width: 20px; height: 20px; accent-color: var(--royal-400); }

/* ---- buttons ---- */
.btn {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  font: 700 1rem var(--font);
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn::before { /* the gloss */
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.04));
  pointer-events: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; filter: grayscale(0.4) brightness(0.8); box-shadow: none; }
.btn:focus-visible, .tab:focus-visible, .link:focus-visible, .eye:focus-visible {
  outline: 3px solid var(--royal-300);
  outline-offset: 2px;
}
.btn-primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(180deg, #9a6dff 0%, var(--royal-500) 48%, #4b1fa3 100%);
  box-shadow: 0 10px 24px rgba(100, 49, 196, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 30px rgba(138, 92, 240, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12) inset; }
.btn-ghost {
  flex: none;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  box-shadow: 6px 6px 14px rgba(8, 2, 22, 0.5), -3px -3px 10px rgba(120, 76, 214, 0.12),
    inset 0 0 0 1px rgba(181, 151, 255, 0.25);
}
.link {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--royal-300);
  font: 600 0.92rem var(--font);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---- done / forgot ---- */
.done { text-align: center; justify-items: center; }
.done h2, #panel-forgot h2 { margin: 4px 0 0; font-size: 1.3rem; }
.done p, #panel-forgot p { margin: 0; color: var(--ink-soft); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-soft); font-size: 0.94rem; }

/* ---- Telegram ---- */
.telegram {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(20, 8, 50, 0.35);
}
.telegram h2 { margin: 0; font-size: 1rem; }
.tg-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5ccfff, #229ed9 60%, #1677b0);
  box-shadow: 0 0 18px rgba(34, 158, 217, 0.65), 0 0 40px rgba(34, 158, 217, 0.25);
}
.tg-icon svg { fill: #fff; margin-left: -2px; }
.tg-body { display: grid; gap: 8px; justify-items: start; }
/* Q-075: a premium Telegram button that stays visibly disabled until the owner publishes the
   real community link. A soft, still glow; no link, no handler, no hover or press effect. */
.tg-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid rgba(92, 207, 255, 0.45);
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(246, 241, 255, 0.72);
  background: linear-gradient(135deg, rgba(34, 158, 217, 0.38), rgba(22, 119, 176, 0.3));
  box-shadow: 0 0 14px rgba(34, 158, 217, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  filter: saturate(0.75);
  cursor: not-allowed;
  pointer-events: none;
}
.tg-button svg { fill: currentColor; }

.foot { margin-top: 26px; text-align: center; color: var(--ink-faint); font-size: 0.8rem; }
.foot p { margin: 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
@media (max-width: 360px) {
  .code-row { flex-direction: column; align-items: stretch; }
  .btn-ghost { width: 100%; }
}

/* ---- loading and the reCAPTCHA slot ---- */
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn[aria-busy="true"]::after { animation: none; }
}
.recaptcha-slot { display: flex; justify-content: center; margin-top: 12px; min-height: 0; }
@media (min-width: 900px) {
  .page { max-width: 520px; padding-top: 56px; }
  h1 { font-size: 2.8rem; }
}
