/* ================================================================
   Astrail — Auth & Onboarding Styles
   ================================================================ */

/* ── Form primitives ─────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--col-text-2);
}

.form-input {
  height: 42px;
  width: 100%;
  padding: 0 14px;
  border: 1.5px solid var(--col-border);
  border-radius: 10px;
  background: var(--col-surface);
  color: var(--col-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder { color: var(--col-text-dis); }
.form-input:focus {
  border-color: var(--col-accent);
  box-shadow: 0 0 0 3px var(--col-accent-50);
}
.form-input.is-error {
  border-color: var(--col-error);
  box-shadow: 0 0 0 3px var(--col-error-bg);
}

.form-select {
  height: 42px;
  width: 100%;
  padding: 0 36px 0 14px;
  border: 1.5px solid var(--col-border);
  border-radius: 10px;
  background: var(--col-surface);
  color: var(--col-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-select:focus {
  border-color: var(--col-accent);
  box-shadow: 0 0 0 3px var(--col-accent-50);
}

.form-error {
  font-size: 12px;
  color: var(--col-error);
  padding: 9px 12px;
  background: var(--col-error-bg);
  border-radius: 8px;
  border: 1px solid var(--col-error-border);
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.4;
}

.form-hint { font-size: 12px; color: var(--col-text-3); margin-top: 1px; }

.input-pwd-wrap { position: relative; }
.input-pwd-wrap .form-input { padding-right: 52px; }
.input-pwd-toggle {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 600; font-family: inherit;
  color: var(--col-text-3);
  transition: color 120ms;
  border-radius: 0 10px 10px 0;
}
.input-pwd-toggle:hover { color: var(--col-text-2); }

/* ── Auth-scoped palette override (Aurora) ───────────────────── */
/* Scoped to auth & onboarding only — dashboard is unaffected    */
.auth-shell,
.onb-shell {
  --col-accent:       #4571F2;
  --col-accent-50:    #EBF0FE;
  --col-accent-100:   #CFDBFC;
  --col-accent-600:   #2F56D0;
  --col-accent-hover: rgba(69,113,242,.07);
}

/* ── Brand panel glow animations ────────────────────────────── */
@keyframes aurGlow1 {
  0%   { opacity:.90; transform: translate(  0px,   0px) scale(1.00); }
  15%  { opacity:.65; transform: translate( 28px, -38px) scale(1.18); }
  30%  { opacity:.82; transform: translate(-18px, -55px) scale(0.88); }
  50%  { opacity:.48; transform: translate(-42px, -22px) scale(1.26); }
  65%  { opacity:.75; transform: translate(-10px,  24px) scale(0.92); }
  80%  { opacity:.58; transform: translate( 22px,  16px) scale(1.12); }
  100% { opacity:.90; transform: translate(  0px,   0px) scale(1.00); }
}
@keyframes aurGlow2 {
  0%   { opacity:.85; transform: translate(  0px,  0px) scale(1.00); }
  20%  { opacity:.50; transform: translate(-32px, 34px) scale(1.22); }
  40%  { opacity:.78; transform: translate( 18px, 52px) scale(0.85); }
  60%  { opacity:.42; transform: translate( 44px, 14px) scale(1.16); }
  80%  { opacity:.70; transform: translate( 10px,-20px) scale(0.94); }
  100% { opacity:.85; transform: translate(  0px,  0px) scale(1.00); }
}
@keyframes aurGlow3 {
  0%   { opacity:.70; transform: translate(  0px,  0px) scale(1.00); }
  25%  { opacity:.38; transform: translate( 36px,-28px) scale(1.35); }
  55%  { opacity:.60; transform: translate(-28px, 18px) scale(0.78); }
  80%  { opacity:.32; transform: translate( 14px, 32px) scale(1.20); }
  100% { opacity:.70; transform: translate(  0px,  0px) scale(1.00); }
}
@keyframes aurGlow4 {
  0%   { opacity:.55; transform: translate(  0px,  0px) scale(1.00); }
  30%  { opacity:.28; transform: translate(-24px,-36px) scale(1.28); }
  60%  { opacity:.50; transform: translate( 32px,-10px) scale(0.82); }
  85%  { opacity:.22; transform: translate(-12px, 28px) scale(1.14); }
  100% { opacity:.55; transform: translate(  0px,  0px) scale(1.00); }
}

/* ── Auth shell — split layout ───────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  background: var(--col-bg);
}

/* Brand panel — intentionally always dark */
.auth-brand {
  width: 420px;
  flex-shrink: 0;
  background: #0A0B0F;
  display: flex;
  flex-direction: column;
  padding: 44px 40px 36px;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 55% at 12% 82%, rgba(95,138,255,.30) 0%, transparent 100%),
    radial-gradient(ellipse 42% 36% at 90% 10%, rgba(69,113,242,.18) 0%, transparent 100%);
}

.auth-brand-logo {
  display: flex; align-items: center; gap: 10px;
  position: relative; z-index: 1;
  margin-bottom: 52px;
}
.auth-brand-mark {
  width: 34px; height: 34px;
  background: #0A0B0F; border: 1px solid rgba(244,241,236,.16);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-brand-name {
  font-size: 18px; font-weight: 600;
  color: #fff; letter-spacing: -0.01em;
}

.auth-brand-hl {
  font-size: 33px; font-weight: 600;
  color: #fff; line-height: 1.18;
  letter-spacing: -0.026em;
  margin-bottom: 44px;
  text-wrap: pretty;
  position: relative; z-index: 1;
}
.auth-brand-hl em { font-style: normal; color: #5F8AFF; }

.auth-brand-feats {
  display: flex; flex-direction: column; gap: 20px;
  position: relative; z-index: 1; flex: 1;
}
.auth-feat-row { display: flex; align-items: flex-start; gap: 13px; }
.auth-feat-ico {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: rgba(95,138,255,.14);
  border: 1px solid rgba(95,138,255,.26);
  display: flex; align-items: center; justify-content: center;
}
.auth-feat-title {
  font-size: 14px; font-weight: 600;
  color: rgba(255,255,255,.92); margin-bottom: 2px;
}
.auth-feat-desc {
  font-size: 13px; color: rgba(255,255,255,.38); line-height: 1.45;
}
.auth-brand-foot {
  font-size: 11px; color: rgba(255,255,255,.16);
  position: relative; z-index: 1; margin-top: 32px;
}

/* Form panel */
.auth-panel {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 44px 40px;
  overflow-y: auto;
}
.auth-wrap { width: 100%; max-width: 400px; }

.auth-title {
  font-size: 26px; font-weight: 600;
  color: var(--col-text); letter-spacing: -0.022em;
  margin-bottom: 5px;
}
.auth-sub {
  font-size: 14px; color: var(--col-text-3);
  margin-bottom: 28px; line-height: 1.5;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-row-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  font-size: 12px; color: var(--col-text-3);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--col-border-s);
}

.auth-3p-btn {
  width: 100%; height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1.5px solid var(--col-border);
  border-radius: 10px;
  background: var(--col-surface);
  color: var(--col-text-2);
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.auth-3p-btn:hover {
  background: var(--col-surface-2);
  border-color: var(--col-accent);
  color: var(--col-text);
}

.auth-foot-link {
  margin-top: 20px; text-align: center;
  font-size: 13px; color: var(--col-text-3);
}

.auth-spinner {
  width: 15px; height: 15px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.28);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* ── Registration step indicator ─────────────────────────────── */
.reg-steps { display: flex; align-items: center; margin-bottom: 32px; }
.reg-step  { display: flex; align-items: center; gap: 8px; }

.reg-step-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--col-border);
  background: var(--col-surface); color: var(--col-text-3);
  transition: all 200ms ease;
}
.reg-step.s-done   .reg-step-dot { background: var(--col-accent); border-color: var(--col-accent); color: #fff; }
.reg-step.s-active .reg-step-dot { background: var(--col-accent-50); border-color: var(--col-accent); color: var(--col-accent); }

.reg-step-lbl { font-size: 12px; font-weight: 500; color: var(--col-text-3); white-space: nowrap; }
.reg-step.s-active .reg-step-lbl { color: var(--col-text); font-weight: 600; }
.reg-step.s-done   .reg-step-lbl { color: var(--col-text-2); }

.reg-step-line {
  flex: 1; height: 1.5px; background: var(--col-border-s);
  margin: 0 10px; min-width: 18px; transition: background 300ms;
}
.reg-step-line.done { background: var(--col-accent); }

/* Chip group */
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 13px; border-radius: 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1.5px solid var(--col-border);
  background: var(--col-surface); color: var(--col-text-2);
  font-family: inherit; transition: all 120ms ease; line-height: 1.4;
}
.chip:hover { border-color: var(--col-accent); color: var(--col-text); }
.chip.on { background: var(--col-accent-50); border-color: var(--col-accent); color: var(--col-accent); font-weight: 600; }

/* ── Onboarding ───────────────────────────────────────────────── */
.onb-shell { min-height: 100vh; background: var(--col-bg); display: flex; flex-direction: column; }

.onb-header {
  height: 60px; background: var(--col-surface);
  border-bottom: 1px solid var(--col-border-s);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; flex-shrink: 0;
}
.onb-logo { display: flex; align-items: center; gap: 9px; }
.onb-logo-mark {
  width: 28px; height: 28px; background: #0A0B0F; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.onb-logo-name { font-size: 15px; font-weight: 600; color: var(--col-text); letter-spacing: -0.01em; }
.onb-step-label { font-size: 13px; color: var(--col-text-3); font-variant-numeric: tabular-nums; }

.onb-bar { height: 3px; background: var(--col-border-s); position: relative; overflow: hidden; flex-shrink: 0; }
.onb-bar-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--col-accent);
  transition: width 420ms cubic-bezier(0.4, 0, 0.2, 1);
}

.onb-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 52px 32px;
}
.onb-wrap { width: 100%; max-width: 580px; }

.onb-eyebrow {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--col-accent); margin-bottom: 10px;
}
.onb-title {
  font-size: 30px; font-weight: 600; color: var(--col-text);
  letter-spacing: -0.026em; margin-bottom: 10px;
  text-wrap: pretty; line-height: 1.18;
}
.onb-desc {
  font-size: 15px; color: var(--col-text-3); line-height: 1.6;
  margin-bottom: 32px; text-wrap: pretty;
}
.onb-actions { display: flex; align-items: center; gap: 10px; margin-top: 32px; }

/* Feature cards (welcome step) */
.onb-feat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.onb-feat-card {
  padding: 20px; border: 1px solid var(--col-border-s);
  border-radius: 14px; background: var(--col-surface);
  transition: box-shadow 150ms ease;
}
.onb-feat-card:hover { box-shadow: var(--shadow-md); }
.onb-feat-card-ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--col-accent-50);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.onb-feat-card-title { font-size: 14px; font-weight: 600; color: var(--col-text); margin-bottom: 5px; }
.onb-feat-card-desc  { font-size: 12px; color: var(--col-text-3); line-height: 1.5; }

/* Wallet cards */
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wallet-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--col-border); border-radius: 12px;
  background: var(--col-surface); cursor: pointer;
  transition: border-color 150ms, background 150ms;
  font-family: inherit; text-align: left;
}
.wallet-card:hover   { border-color: var(--col-accent); background: var(--col-accent-50); }
.wallet-card.on      { border-color: var(--col-accent); background: var(--col-accent-50); box-shadow: 0 0 0 3px var(--col-accent-100); }
.wallet-card-ico     { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wallet-card-name    { font-size: 14px; font-weight: 500; color: var(--col-text); }
.wallet-card-hint    { font-size: 11px; color: var(--col-text-3); margin-top: 2px; }

/* Invite form */
.invite-row { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.invite-list { display: flex; flex-direction: column; gap: 8px; }
.invite-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--col-surface); border: 1px solid var(--col-border-s); border-radius: 10px;
}

/* All-set success */
.onb-success-ico {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--col-success-bg); border: 2px solid var(--col-success-border);
  display: flex; align-items: center; justify-content: center;
}
.onb-check-list { display: flex; flex-direction: column; gap: 10px; }
.onb-check-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--col-text-2); }
.onb-check-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1099px) {
  .auth-brand           { width: 340px; }
  .auth-brand-hl        { font-size: 27px; }
  .onb-feat-grid        { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .auth-brand           { display: none; }
  .auth-panel           { padding: 36px 24px; }
  .onb-feat-grid        { grid-template-columns: 1fr; }
  .wallet-grid          { grid-template-columns: 1fr; }
  .invite-row           { flex-wrap: wrap; }
  .invite-row .form-group { min-width: 0; flex: 1 1 100%; }
  .onb-body             { padding: 32px 20px; }
  .onb-title            { font-size: 24px; }
  .reg-step-lbl         { display: none; }
}

/* Device sim */
#root.sim-phone .auth-brand    { display: none; }
#root.sim-phone .auth-panel    { padding: 36px 24px; }
#root.sim-phone .onb-feat-grid { grid-template-columns: 1fr; }
#root.sim-phone .wallet-grid   { grid-template-columns: 1fr; }
#root.sim-phone .invite-row    { flex-wrap: wrap; }
#root.sim-phone .onb-body      { padding: 32px 20px; }
#root.sim-phone .onb-title     { font-size: 24px; }
#root.sim-phone .reg-step-lbl  { display: none; }

#root.sim-tablet .auth-brand    { display: none; }
#root.sim-tablet .auth-panel    { padding: 36px 36px; }
#root.sim-tablet .onb-feat-grid { grid-template-columns: 1fr 1fr; }
#root.sim-tablet .wallet-grid   { grid-template-columns: 1fr 1fr; }
