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

:root {
  --bg:         #06040e;
  --card-bg:    rgba(255,255,255,0.035);
  --border:     rgba(168,85,247,0.18);
  --border-glow:rgba(168,85,247,0.55);
  --purple:     #a855f7;
  --indigo:     #6366f1;
  --violet:     #7c3aed;
  --text:       #e8e0f5;
  --muted:      rgba(220,210,245,0.88);
  --input-bg:   rgba(255,255,255,0.045);
  --input-border:rgba(168,85,247,0.22);
  --success:    #34d399;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ─── PAGE SHELL ─── */
.page-shell {
  position: relative;
  height: 100dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ─── BACKGROUND LAYERS ─── */
.bg-wrap {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
}

.bg-circuit {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(130,80,220,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(130,80,220,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, #000 40%, transparent 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0;
  animation: orbPulse 8s ease-in-out infinite;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(124,58,237,0.22), transparent 70%);
  top: -200px; left: -150px;
  animation-delay: 0s;
}
.orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.18), transparent 70%);
  bottom: -180px; right: -120px;
  animation-delay: 2.5s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(168,85,247,0.15), transparent 70%);
  top: 40%; left: 55%;
  animation-delay: 5s;
}
@keyframes orbPulse {
  0%,100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

#canvas {
  position: absolute; inset: 0;
  opacity: 0.35;
}

.bg-svg {
  position: absolute;
  width: 100%; height: 100%;
  opacity: 0.045;
}

/* ─── LAYOUT ─── */
.page {
  position: relative; z-index: 10;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
}

/* ─── TOP BAR ─── */
.topbar {
  position: relative; flex-shrink: 0;
  z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
}
.logo-icon span {
  border-radius: 3px;
  background: var(--purple);
  display: block;
  opacity: 0.9;
}
.logo-icon span:nth-child(1) { opacity: 1; }
.logo-icon span:nth-child(2) { opacity: 0.6; }
.logo-icon span:nth-child(3) { opacity: 0.6; }
.logo-icon span:nth-child(4) { opacity: 0.85; }

.logo-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}
.logo-name span { color: var(--purple); }

.topbar-logo-img {
  height: auto;
  max-height: 36px;
  width: auto;
  display: block;
}

.topbar-right {
  display: flex; align-items: center; gap: 16px;
}

.lang-switcher {
  display: flex; align-items: center; gap: 4px;
}
.lang-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: var(--muted); text-decoration: none;
  border-radius: 10px;
  letter-spacing: 0.06em;
  transition: all 0.2s;
  border: 3px solid rgba(168,85,247,0.12);
}
.lang-btn:hover {
  color: var(--text);
  background: rgba(168,85,247,0.1);
}
.lang-btn.active {
  color: var(--purple);
  border-color: rgba(168,85,247,0.3);
  background: rgba(168,85,247,0.08);
}

.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.05em;
}
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: blink 2.2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ─── CARD ─── */
.card-wrap {
  perspective: 1200px;
  margin-top: 16px;
}

.card {
  width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 44px 40px 36px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.06),
    0 24px 60px rgba(0,0,0,0.55),
    0 0 80px rgba(124,58,237,0.12) inset;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  transform-style: preserve-3d;
}
.card.tilted {
  box-shadow:
    0 0 0 1px var(--border-glow),
    0 28px 70px rgba(0,0,0,0.65),
    0 0 100px rgba(124,58,237,0.18) inset;
}

.card-header {
  text-align: center;
  margin-bottom: 30px;
}
.badge-private {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px; color: var(--purple);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 18px;
}
.card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  background: linear-gradient(135deg, #e9d5ff 0%, #a855f7 50%, #818cf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.card-sub {
  font-size: 13px; color: var(--muted); font-weight: 400;
}

.sso-row {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 22px;
}
.sso-btn { flex: 1; max-width: 160px; }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px; font-weight: 500;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}
.sso-btn:hover {
  background: rgba(168,85,247,0.1);
  border-color: rgba(168,85,247,0.3);
  color: var(--text);
}
.sso-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
  color: var(--muted); font-size: 11px; letter-spacing: 0.06em;
}
.divider::before, .divider::after {
  content:''; flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(168,85,247,0.5), transparent);
}

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11.5px; font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 7px;
}
.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: rgba(168,85,247,0.45);
  pointer-events: none;
  display: flex; align-items: center;
}
.form-input {
  width: 100%;
  padding: 11px 40px 11px 38px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px; font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-input::placeholder { color: rgba(220,210,245,0.25); }
.form-input:focus {
  border-color: var(--purple);
  background: rgba(168,85,247,0.07);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}
.form-input.error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.1);
}
.toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: rgba(168,85,247,0.45);
  display: flex; align-items: center;
  transition: color 0.2s;
  padding: 0;
}
.toggle-pw:hover { color: var(--purple); }

.form-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
  margin-top: -4px;
}
.remember {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); cursor: pointer;
  user-select: none;
}
.remember input[type=checkbox] { display: none; }
.check-box {
  width: 15px; height: 15px;
  border: 1px solid rgba(168,85,247,0.35);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.remember input:checked + .check-box {
  background: var(--purple);
  border-color: var(--purple);
}
.check-box svg { opacity: 0; transition: opacity 0.15s; width: 10px; height: 10px; }
.remember input:checked + .check-box svg { opacity: 1; }
.forgot-link {
  font-size: 12px; color: var(--purple);
  text-decoration: none; opacity: 0.8;
  transition: opacity 0.2s;
}
.forgot-link:hover { opacity: 1; }

.btn-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--violet) 0%, var(--purple) 50%, var(--indigo) 100%);
  border: none; border-radius: 11px;
  color: #fff;
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  position: relative; overflow: hidden;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 30px rgba(124,58,237,0.4);
}
.btn-submit:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 36px rgba(124,58,237,0.55);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { cursor: default; opacity: 0.8; }

.btn-inner { display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-text { position: relative; z-index: 1; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: rippleAnim 0.5s linear;
  pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.check-anim { display: none; }
.check-anim svg { width: 18px; height: 18px; }
.check-anim path {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.35s ease forwards;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.error-msg {
  font-size: 11.5px; color: #f87171;
  margin-top: 4px; display: none;
  padding-left: 2px;
}

.card-bottom {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(168,85,247,0.1);
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: rgba(220,210,245,0.7);
}
.trust-item svg { width: 11px; height: 11px; color: rgba(168,85,247,0.4); }

.footer {
  position: relative; flex-shrink: 0;
  z-index: 20;
  text-align: center;
  padding: 14px 24px;
  font-size: 13px; color: rgba(220,210,245,0.55);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.04em;
}
.footer a {
  color: rgba(168,85,247,0.4);
  text-decoration: none;
}
.footer a:hover { color: var(--purple); }

@media (max-width: 480px) {
  .card { width: 100%; padding: 36px 24px 28px; }
  .sso-btn { max-width: none; }
  .topbar { padding: 14px 18px; }
  .card-bottom { display: none; }
  .status-pill { display: none; }
}
/* ─── SPLIT LAYOUT OVERRIDES ─── */

.split-body {
  overflow: hidden;
}

.split-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  width: 100vw;
}

/* form-right: brand | form */
.split-wrap.form-right { direction: ltr; }
/* form-left: form | brand */
.split-wrap.form-left  { direction: rtl; }
.split-wrap.form-left > * { direction: ltr; }

/* ─── BRAND PANEL ─── */
.split-brand {
  position: relative;
  background: #06040e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-brand-bg {
  position: absolute; inset: 0;
  overflow: hidden;
}

.split-brand-bg .orb-1 {
  width: 500px; height: 500px;
  top: -120px; left: -100px;
}
.split-brand-bg .orb-2 {
  width: 400px; height: 400px;
  bottom: -100px; right: -80px;
}

#canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.4;
}

.split-brand-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  gap: 32px;
  padding: 48px;
}

.split-logo {
  align-self: flex-start;
}

.split-brand-tagline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 36px; font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e9d5ff 0%, #a855f7 50%, #818cf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  max-width: 340px;
}

.split-brand-badges {
  display: flex; flex-direction: column; gap: 12px;
}

.split-brand-badges .trust-item {
  font-size: 13px;
  color: rgba(220,210,245,0.6);
}
.split-brand-badges .trust-item svg {
  width: 14px; height: 14px;
  color: rgba(168,85,247,0.6);
}

.split-status {
  margin-top: 0;
}

/* ─── FORM PANEL ─── */
.split-form-panel {
  position: relative;
  background: #08050f;
  border-left: 1px solid rgba(168,85,247,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 48px;
}

.split-wrap.form-left .split-form-panel {
  border-left: none;
  border-right: 1px solid rgba(168,85,247,0.1);
}

.split-lang {
  position: absolute;
  top: 24px; right: 24px;
}

.split-wrap.form-left .split-lang {
  right: auto; left: 24px;
}

.split-form-inner {
  width: 100%;
  max-width: 380px;
}

.split-form-inner .card-header {
  text-align: left;
  margin-bottom: 28px;
}

.split-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  padding: 14px;
  font-size: 11px;
  color: rgba(220,210,245,0.3);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.04em;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .split-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto; min-height: 100vh;
  }
  .split-brand {
    min-height: 200px;
    padding: 32px;
  }
  .split-brand-tagline { font-size: 24px; }
  .split-brand-badges  { display: none; }
  .split-form-panel    { border-left: none; border-top: 1px solid rgba(168,85,247,0.1); padding: 36px 24px 60px; }
  .split-wrap.form-left .split-form-panel { border-right: none; border-top: 1px solid rgba(168,85,247,0.1); }
}

/* ─── FLASH MESSAGES ─── */
.flash-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.flash-danger  { background: rgba(239,68,68,.12);  border-color: rgba(239,68,68,.3);  color: #fca5a5; }
.flash-success { background: rgba(34,197,94,.12);  border-color: rgba(34,197,94,.3);  color: #86efac; }
.flash-warning { background: rgba(234,179,8,.12);  border-color: rgba(234,179,8,.3);  color: #fde047; }
.flash-info    { background: rgba(99,102,241,.12); border-color: rgba(99,102,241,.3); color: #a5b4fc; }
