/* ============ DNIPRO LLC — Auth flow redesign ============ */
:root {
  --navy: #06122b;
  --navy-2: #0c2150;
  --navy-3: #123a86;
  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --cyan: #4fc3f7;
  --cyan-2: #38bdf8;
  --coral: #f97316;
  --coral-dark: #ea580c;

  --ink: #0c1730;
  --ink-2: #33405c;
  --muted: #6b7894;
  --muted-2: #9aa6bd;
  --line: #e7ebf2;
  --line-2: #eef1f7;
  --field: #f6f8fc;
  --white: #ffffff;

  --green: #16a34a;
  --green-bg: #ecfdf3;
  --red: #e11d48;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 11px;
  --shadow: 0 24px 60px -24px rgba(8, 20, 48, .28);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Unbounded', var(--sans);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: #0a1224;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
::selection { background: #bcd6ff; color: var(--navy); }
button { font-family: inherit; }

/* ---------------- shell ---------------- */
.shell {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  overflow: hidden;
}

/* =====================================================
   LEFT — BRAND PANEL
   ===================================================== */
.brand {
  position: relative;
  color: #fff;
  padding: 40px 46px 36px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 12% 8%, #1b48a8 0%, rgba(27,72,168,0) 55%),
    radial-gradient(120% 90% at 92% 100%, #0a2a66 0%, rgba(10,42,102,0) 60%),
    linear-gradient(160deg, var(--navy-2) 0%, var(--navy) 70%);
}
/* animated aurora blobs */
.brand::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(38% 38% at 30% 30%, rgba(79,195,247,.45), transparent 70%),
    radial-gradient(34% 34% at 72% 62%, rgba(37,99,235,.5), transparent 70%),
    radial-gradient(30% 30% at 55% 88%, rgba(124,58,237,.32), transparent 70%);
  filter: blur(6px);
  animation: drift 22s ease-in-out infinite alternate;
  pointer-events: none;
}
/* fine grain */
.brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: .7;
  pointer-events: none;
}
@keyframes drift {
  0%   { transform: translate(-4%, -3%) rotate(0deg) scale(1); }
  50%  { transform: translate(5%, 4%) rotate(8deg) scale(1.12); }
  100% { transform: translate(-2%, 6%) rotate(-6deg) scale(1.05); }
}
.brand > * { position: relative; z-index: 2; }

/* logo */
.logo { display: flex; align-items: center; gap: 13px; }
.logo .mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
}
.logo .wm { line-height: 1; }
.logo .wm .n { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .01em; }
.logo .wm .s { font-size: 11px; letter-spacing: .34em; color: rgba(255,255,255,.6); font-weight: 600; margin-top: 3px; }

/* step rail */
.steps { display: flex; gap: 10px; margin-top: 44px; }
.steps .st { display: flex; align-items: center; gap: 9px; flex: 1; }
.steps .dot {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.7);
  transition: all .4s var(--ease);
}
.steps .lbl { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.55); transition: color .4s; white-space: nowrap; }
.steps .st.active .dot { background: var(--cyan); border-color: var(--cyan); color: var(--navy); box-shadow: 0 0 0 5px rgba(79,195,247,.18); }
.steps .st.active .lbl { color: #fff; }
.steps .st.done .dot { background: rgba(255,255,255,.92); border-color: rgba(255,255,255,.92); color: var(--blue); }
.steps .st.done .lbl { color: rgba(255,255,255,.8); }
.steps .bar { flex: 1; height: 1.5px; background: rgba(255,255,255,.16); align-self: center; min-width: 8px; }

/* headline area */
.bhead { margin-top: auto; }
.bhead .kick {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 16px;
}
.bhead .kick::before { content: ""; width: 18px; height: 2px; background: var(--cyan); border-radius: 2px; }
.bhead h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.bhead p {
  font-size: 15.5px; line-height: 1.55; color: rgba(255,255,255,.74);
  max-width: 34ch; margin: 0;
}
.bhead .anim-key { animation: rise .5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* route motif */
.route { position: relative; height: 92px; margin: 30px 0 26px; }
.route svg { width: 100%; height: 100%; overflow: visible; }
.route .path { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 2; stroke-dasharray: 2 8; stroke-linecap: round; }
.route .glow { fill: none; stroke: url(#rg); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 120 600; animation: dash 5s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -720; } }
.route .pin { fill: #fff; }
.route .pin.b { fill: var(--cyan); }
.parcel {
  position: absolute; top: 0; left: 0;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--cyan), var(--blue));
  box-shadow: 0 8px 20px -6px rgba(56,189,248,.6);
  color: #fff;
  offset-path: path("M 8 70 C 90 10, 150 120, 250 50 S 380 30, 430 64");
  offset-rotate: 0deg;
  animation: travel 5s linear infinite;
}
@keyframes travel {
  0% { offset-distance: 0%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* trust chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.13);
  padding: 7px 11px; border-radius: 999px;
}
.chips .chip svg { opacity: .85; }

/* =====================================================
   RIGHT — FORM PANEL
   ===================================================== */
.panel {
  position: relative;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.topbar {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 22px 40px 0;
}

/* language switcher */
.lang { position: relative; }
.lang .btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--field); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: border-color .15s, background .15s;
}
.lang .btn:hover { border-color: var(--muted-2); }
.lang .flag { width: 22px; height: 15px; border-radius: 3px; overflow: hidden; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.05); }
.lang .caret { transition: transform .2s; color: var(--muted); }
.lang.open .caret { transform: rotate(180deg); }
.lang .menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: 6px; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; min-width: 188px;
  animation: rise .18s var(--ease) both;
}
.lang .item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: none; border: none; text-align: left;
}
.lang .item:hover { background: var(--field); }
.lang .item.sel { background: #eaf1ff; color: var(--blue); }

/* form stage */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 40px;
}
.form {
  width: 100%;
  max-width: 416px;
}
.form .anim-key { animation: swap .42s var(--ease) both; }
@keyframes swap { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.back {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  margin-bottom: 22px; padding: 4px 0;
  transition: color .15s;
}
.back:hover { color: var(--ink); }

.eyebrow {
  font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 12px;
}
.form h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 10px;
}
.form .lede { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0 0 28px; }
.form .lede b { color: var(--ink); font-weight: 700; }

/* labelled input */
.fld { margin-bottom: 18px; }
.fld > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.inputwrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 14px; height: 56px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.inputwrap:focus-within { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.inputwrap .lead { color: var(--muted); display: grid; place-items: center; transition: color .2s; }
.inputwrap:focus-within .lead { color: var(--blue); }
.inputwrap input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 16px; color: var(--ink);
}
.inputwrap input::placeholder { color: var(--muted-2); }
.kindchip {
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 4px 9px; border-radius: 999px;
  background: #e9f0ff; color: var(--blue);
  animation: rise .2s var(--ease) both;
}

/* license toggle */
.agree {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 4px 0 24px;
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2);
}
.switch {
  position: relative; flex: none;
  width: 44px; height: 26px; border-radius: 999px;
  background: #d6dce8; cursor: pointer; border: none;
  transition: background .22s var(--ease);
  margin-top: 1px;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
  transition: transform .22s var(--ease);
}
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(18px); }
.agree a { color: var(--blue); font-weight: 700; text-decoration: none; }
.agree a:hover { text-decoration: underline; }

/* primary button */
.cta {
  width: 100%; height: 56px;
  border: none; border-radius: var(--r-md); cursor: pointer;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: #fff; font-size: 15.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 14px 28px -12px rgba(37,99,235,.8);
  transition: transform .08s, box-shadow .2s, filter .2s, opacity .2s;
}
.cta:hover { filter: brightness(1.06); box-shadow: 0 18px 34px -12px rgba(37,99,235,.85); }
.cta:active { transform: translateY(1px); }
.cta:disabled { background: #c3cfe6; color: #eef2fb; cursor: not-allowed; box-shadow: none; filter: none; }
.cta .arrow { transition: transform .2s; }
.cta:not(:disabled):hover .arrow { transform: translateX(3px); }

.altline { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.altline a, .linkbtn { color: var(--blue); font-weight: 700; text-decoration: none; background: none; border: none; cursor: pointer; font-size: inherit; font-family: inherit; }
.altline a:hover, .linkbtn:hover { text-decoration: underline; }
.linkbtn:disabled { color: var(--muted-2); cursor: not-allowed; text-decoration: none; }

/* ---- OTP ---- */
.otp { display: flex; gap: 10px; margin: 4px 0 8px; }
.otp input {
  flex: 1; height: 62px; min-width: 0;
  text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 24px;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s, transform .15s;
}
.otp input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.12); transform: translateY(-2px); }
.otp input.filled { border-color: #bcd0f7; color: var(--blue); }
.otp.err input { border-color: var(--red); animation: shake .4s; }
@keyframes shake {
  0%,100%{ transform: translateX(0); }
  20%{ transform: translateX(-7px); } 40%{ transform: translateX(6px); }
  60%{ transform: translateX(-4px); } 80%{ transform: translateX(3px); }
}
.timer {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 2px 26px; font-size: 13.5px; color: var(--muted);
}
.timer .clk { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink-2); }
.timer .clk.warn { color: var(--coral-dark); }
.errnote { color: var(--red); font-size: 13px; font-weight: 600; margin: -2px 2px 14px; display: flex; align-items: center; gap: 6px; }

/* ---- cabinets ---- */
.cab-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.cab {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: #fff; cursor: pointer; text-align: left;
  transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}
.cab:hover { border-color: #bcd0f7; box-shadow: 0 12px 24px -16px rgba(37,99,235,.5); transform: translateY(-1px); }
.cab .av {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 16px; color: #fff;
}
.cab .info { flex: 1; min-width: 0; }
.cab .nm { font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.cab .meta .pbox { color: var(--blue); font-weight: 600; }
.cab .act {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--blue);
  padding: 9px 14px; border-radius: 10px; border: 1.5px solid #d6e2fb;
  background: #f2f7ff; transition: all .15s;
}
.cab:hover .act { background: var(--blue); color: #fff; border-color: var(--blue); }
.cab.connecting { border-color: #bcd0f7; }
.cab.connecting .act { background: #eef4ff; color: var(--blue); border-color: #d6e2fb; }
.cab.connected { border-color: var(--green); background: var(--green-bg); }
.cab.connected .act { background: var(--green); color: #fff; border-color: var(--green); }
.cab.connected .av { box-shadow: 0 0 0 3px rgba(22,163,74,.2); }

.spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cab-add {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 13px; margin-top: 4px;
  border: 1.5px dashed var(--line); border-radius: var(--r-md);
  background: none; cursor: pointer;
  font-size: 13.5px; font-weight: 700; color: var(--muted);
  transition: border-color .15s, color .15s, background .15s;
}
.cab-add:hover { border-color: var(--blue); color: var(--blue); background: #f7faff; }

.logout {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  margin: 22px auto 0; padding: 8px 14px; border-radius: 10px;
  transition: color .15s, background .15s;
}
.logout:hover { color: var(--coral-dark); background: #fff4ec; }

/* footer */
.foot {
  padding: 16px 40px 22px;
  border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted-2);
}
.foot .links { display: flex; gap: 16px; }
.foot a { color: var(--muted); text-decoration: none; font-weight: 600; }
.foot a:hover { color: var(--blue); }
.foot .build { font-variant-numeric: tabular-nums; }

/* success overlay toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: var(--navy); color: #fff; padding: 13px 20px; border-radius: 13px;
  font-size: 14px; font-weight: 600; z-index: 80;
  box-shadow: 0 20px 44px -14px rgba(6,18,43,.6);
  animation: toastin .3s var(--ease);
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .brand {
    padding: 22px 24px;
    flex-direction: row; align-items: center; gap: 18px;
    min-height: 0;
  }
  .brand .steps, .brand .route, .brand .chips, .brand .bhead p { display: none; }
  .brand .bhead { margin: 0 0 0 auto; text-align: right; }
  .brand .bhead .kick { margin: 0; }
  .brand .bhead h2 { display: none; }
  .topbar { padding: 16px 22px 0; }
  .stage { padding: 22px; }
  .foot { padding: 14px 22px 20px; }
}
@media (max-width: 460px) {
  .otp { gap: 7px; }
  .otp input { height: 54px; font-size: 20px; }
  .foot .links { gap: 12px; }
}
