:root {
  --dark: #050609;
  --dark2: #0b0d12;
  --border-dark: rgba(141,151,178,0.14);
  --accent: #f59e0b;
  --accent2: #b45309;
  --gold: #f8c76b;
  --green: #2ee59d;
  --red: #ff5b7c;
  --text-dark: #f8fafc;
  --muted-dark: #9aa6b8;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

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

body {
  font-family: 'Inter', sans-serif;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: #050609;
}

/* ── LEFT PANEL ── */
.auth-left {
  position: relative;
  overflow: hidden;
  background: #050609;
  display: flex;
  flex-direction: column;
  padding: clamp(32px, 4vw, 56px);
  min-height: 100vh;
}
.auth-left-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 30% -10%, rgba(217,119,6,.18) 0%, transparent 65%),
              radial-gradient(ellipse 60% 40% at 80% 110%, rgba(217,119,6,.1) 0%, transparent 60%);
}
.auth-left-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(217,119,6,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217,119,6,.025) 1px, transparent 1px);
  background-size: 44px 44px;
}
.auth-left-logo {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: auto;
}
.auth-left-logo-icon {
  width: 36px; height: 36px;
  background: #d97706;
  border-radius: 9px; display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: #fff;
}
.auth-left-logo-name {
  font-size: 15px; font-weight: 800; color: #f8fafc; letter-spacing: -.2px;
}

.auth-left-content {
  position: relative; z-index: 2;
  flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.auth-left-headline {
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 900; line-height: 1.05; letter-spacing: -1.5px;
  color: #f8fafc; margin-bottom: 16px;
}
.auth-left-headline em { font-style: normal; color: var(--accent); }
.auth-left-sub {
  font-size: 15px; color: #9aa6b8; line-height: 1.6; max-width: 340px;
  margin-bottom: 32px;
}

/* mini dashboard mockup */
.auth-mini-dash {
  background: #0d1117; border: 1px solid rgba(141,151,178,.15);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(217,119,6,.06);
  max-width: 360px;
  animation: floatDash 6s ease-in-out infinite;
}
@keyframes floatDash { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.mini-bar {
  display: flex; align-items: center; gap: 5px; padding: 9px 12px;
  background: #070a0f; border-bottom: 1px solid rgba(141,151,178,.1);
}
.mini-dot { width: 7px; height: 7px; border-radius: 50%; }
.mini-title { font-size: 10px; font-weight: 700; color: #9aa6b8; margin-left: 5px; letter-spacing: .5px; }
.mini-live { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; color: #2ee59d; }
.mini-live-dot { width: 5px; height: 5px; border-radius: 50%; background: #2ee59d; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.mini-body { padding: 12px; }
.mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-bottom: 10px; }
.mini-stat { background: rgba(255,255,255,.04); border: 1px solid rgba(141,151,178,.08); border-radius: 8px; padding: 8px 10px; }
.mini-stat-lbl { font-size: 8px; color: #9aa6b8; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.mini-stat-val { font-size: 13px; font-weight: 900; margin-top: 2px; }
.green { color: #2ee59d; }
.blue { color: #f59e0b; }
.purple { color: #d97706; }
.mini-chart {
  background: rgba(217,119,6,.03); border: 1px solid rgba(217,119,6,.1);
  border-radius: 8px; padding: 10px; margin-bottom: 10px; height: 64px; position: relative; overflow: hidden;
}
.mini-orders { display: flex; flex-direction: column; gap: 5px; }
.mini-order {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: rgba(255,255,255,.025);
  border-radius: 6px; border: 1px solid rgba(141,151,178,.07);
}
.mini-side { font-size: 8px; font-weight: 900; padding: 2px 5px; border-radius: 4px; }
.mini-side.buy { background: rgba(46,229,157,.15); color: #2ee59d; }
.mini-side.sell { background: rgba(255,91,124,.15); color: #ff5b7c; }
.mini-sym { font-size: 10px; font-weight: 700; color: #f8fafc; flex: 1; }
.mini-pnl { font-size: 10px; font-weight: 700; }
.mini-pnl.pos { color: #2ee59d; }
.mini-pnl.neg { color: #ff5b7c; }

.auth-left-footer {
  position: relative; z-index: 2;
  margin-top: 32px; display: flex; gap: 20px;
}
.auth-left-stat { }
.auth-left-stat-val { font-size: 20px; font-weight: 900; color: #f8fafc; }
.auth-left-stat-lbl { font-size: 10px; color: #9aa6b8; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }

/* ── RIGHT PANEL (WHITE) ── */
.auth-right {
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(32px, 4vw, 64px);
  min-height: 100vh;
  overflow-y: auto;
}
.auth-container {
  width: 100%; max-width: 400px;
}
.back-to-site {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #64748b; font-weight: 500;
  text-decoration: none; margin-bottom: 28px;
  transition: color .2s;
}
.back-to-site:hover { color: #f59e0b; }
.auth-right-header {
  margin-bottom: 28px;
}
.auth-right-title {
  font-size: 13px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: #94a3b8; margin-bottom: 10px;
}
.logo-icon {
  display: none; /* hidden on white panel — handled by left panel */
}
h1 {
  font-size: 26px; font-weight: 800; color: #0f172a; line-height: 1.2;
  margin-bottom: 5px;
}
.auth-sub {
  font-size: 13px; color: #64748b;
  margin-bottom: 0;
}
.step-indicator {
  display: flex; gap: 6px; margin: 20px 0;
  padding: 0; border: none; background: transparent;
  border-radius: 0;
}
.step-dot {
  flex: 1; height: 3px; border-radius: 3px;
  background: #e2e8f0;
  transition: background .28s;
}
.step-dot.active { background: #f59e0b; }
.step-dot.done { background: #2ee59d; }

#step-login, #step-signup, #step-forgot, #step-reset, #step-otp, #step-totp {
  animation: stepIn .3s var(--ease) both;
}
@keyframes stepIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: #475569; letter-spacing: .8px; text-transform: uppercase;
  margin-bottom: 6px;
}
.form-group input, .ph-code, #signup-mobile {
  width: 100%; padding: 11px 13px;
  border: 1px solid #e2e8f0; border-radius: 9px;
  background: #f8fafc; color: #0f172a;
  font-size: 14px; font-family: 'Inter', sans-serif;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.form-group input:focus, .ph-code:focus, #signup-mobile:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(217,119,6,.1);
  background: #fff;
}
.ph-row { display: flex; gap: 8px; width: 100%; }
.ph-code { width: 72px !important; flex-shrink: 0; font-weight: 700; text-align: center; }
#signup-mobile { flex: 1; }
.input-row { display: flex; gap: 10px; }
.input-row .form-group { flex: 1; }
.otp-input {
  width: 100%; padding: 16px 14px;
  border: 1px solid #e2e8f0; border-radius: 9px;
  background: #f8fafc; color: #0f172a;
  font-size: 28px; font-family: monospace; font-weight: 700;
  letter-spacing: 14px; text-align: center; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.otp-input:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(217,119,6,.1); background: #fff; }

.tc-row {
  display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px;
  padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 9px;
  background: #f8fafc;
}
.tc-row input[type=checkbox] { width: 15px; height: 15px; margin-top: 2px; accent-color: #f59e0b; flex-shrink: 0; }
.tc-row label { font-size: 12px; color: #64748b; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; }
.tc-row a { color: #f59e0b; text-decoration: none; }
.tc-row a:hover { text-decoration: underline; }

.auth-btn {
  width: 100%; padding: 14px; border: none; border-radius: 10px;
  background: #d97706;
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .3px;
  font-family: 'Inter', sans-serif; cursor: pointer;
  margin-top: 4px; margin-bottom: 16px;
  transition: transform .22s, box-shadow .22s, filter .22s;
  position: relative; min-height: 48px;
  box-shadow: 0 4px 14px rgba(217,119,6,.4), inset 0 1px 0 rgba(255,255,255,.12);
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(217,119,6,.55), inset 0 1px 0 rgba(255,255,255,.14); filter: brightness(1.06); }
.auth-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; box-shadow: none; }
.auth-btn:disabled::after {
  content: "";
  position: absolute; right: 15px; top: 50%;
  width: 15px; height: 15px; margin-top: -7.5px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.msg-box {
  font-size: 13px; padding: 10px 13px; border-radius: 9px;
  margin-bottom: 14px; display: none; text-align: left; line-height: 1.45;
}
.msg-error { background: rgba(217,119,6,.06); border: 1px solid rgba(255,91,124,.25); color: #e11d48; }
.msg-success { background: rgba(46,229,157,.08); border: 1px solid rgba(46,229,157,.3); color: #059669; }

.bottom-row { color: #64748b; font-size: 13px; margin-bottom: 6px; }
.bottom-row span { color: #f59e0b; cursor: pointer; font-weight: 600; }
.bottom-row span:hover { text-decoration: underline; }
.back-link { color: #94a3b8; font-size: 12px; cursor: pointer; display: inline-block; margin-top: 10px; }
.back-link:hover { color: #f59e0b; }
.forgot-link {
  color: #94a3b8; font-size: 12px; cursor: pointer; float: right;
  margin-top: -8px; margin-bottom: 14px;
}
.forgot-link:hover { color: #f59e0b; }
.hint-badge {
  display: inline-block; background: rgba(217,119,6,.06); color: #f59e0b;
  border: 1px solid rgba(255,91,124,.25); border-radius: 20px;
  padding: 4px 12px; font-size: 12px; margin-bottom: 14px;
}
.resend-row { text-align: center; margin-bottom: 4px; font-size: 12px; }
.resend-link { color: #f59e0b; cursor: pointer; font-weight: 600; }
.resend-link:hover { text-decoration: underline; }
.resend-timer { color: #94a3b8; }
.mobile-note { font-size: 11px; color: #94a3b8; margin-top: -10px; margin-bottom: 14px; }
.divider {
  display: flex; align-items: center; margin: 14px 0;
  color: #94a3b8; font-size: 11px;
}
.divider::before, .divider::after { content:''; flex:1; height:1px; background: #e2e8f0; }
.divider::before { margin-right: 10px; } .divider::after { margin-left: 10px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { min-height: 100vh; padding: 32px 24px; align-items: flex-start; padding-top: 48px; }
}
@media (max-width: 520px) {
  .auth-right { padding: 24px 20px; }
  .input-row { flex-direction: column; gap: 0; }
  .otp-input { letter-spacing: 8px; font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
