/* ========================================================================
   NEXUS ERP — Login
   HiTech, dark, minimal. Designed to feel like a service screen, not an ad.
   ======================================================================== */

:root {
  --bg-0: #04060c;
  --bg-1: #07101e;
  --bg-2: #0a1628;

  --fg:        #e9eef9;
  --fg-muted:  #8a9bb6;
  --fg-dim:    #5b6a85;

  --line:      rgba(255, 255, 255, 0.07);
  --line-2:    rgba(255, 255, 255, 0.14);

  --cyan:      #00d4ff;
  --cyan-2:    #4f8cff;
  --cyan-soft: rgba(0, 212, 255, 0.14);

  --ok:        #2bd49c;
  --warn:      #ffb547;
  --err:       #ff5b6a;

  --r-card:    18px;
  --r-input:   12px;
  --r-btn:     12px;

  --shadow-card:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 30px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 60px -10px rgba(0, 140, 255, 0.18);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-0);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(120% 80% at 50% -10%, #0d1c33 0%, transparent 55%),
    radial-gradient(80% 60% at 100% 100%, #08182b 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  position: relative;
}

/* ========================================================================
   Background
   ======================================================================== */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.bg__grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(120, 170, 230, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 170, 230, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 45%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 45%, #000 30%, transparent 75%);
  animation: gridDrift 60s linear infinite;
}

@keyframes gridDrift {
  to { background-position: 56px 56px, 56px 56px; }
}

.bg__orb {
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

.bg__orb--a {
  left: -180px;
  top: -200px;
  background: radial-gradient(circle, rgba(0, 180, 255, 0.55), transparent 60%);
  animation: orbDriftA 22s var(--ease) infinite alternate;
}

.bg__orb--b {
  right: -220px;
  bottom: -260px;
  background: radial-gradient(circle, rgba(80, 110, 255, 0.45), transparent 60%);
  animation: orbDriftB 28s var(--ease) infinite alternate;
}

@keyframes orbDriftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(80px, 60px, 0) scale(1.1); }
}

@keyframes orbDriftB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-90px, -50px, 0) scale(1.08); }
}

.bg__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 140px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 212, 255, 0.045) 45%,
    rgba(0, 212, 255, 0.09) 50%,
    rgba(0, 212, 255, 0.045) 55%,
    transparent 100%
  );
  animation: scan 9s linear infinite;
  opacity: 0.7;
}

@keyframes scan {
  0%   { transform: translateY(-30%); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(110vh); opacity: 0; }
}

.bg__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(0, 0, 0, 0.55), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 0, 0, 0.4), transparent 60%);
}

/* ========================================================================
   Top bar
   ======================================================================== */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: 0.04em;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(79, 140, 255, 0.1));
  border: 1px solid var(--line-2);
  box-shadow: 0 0 30px -8px rgba(0, 212, 255, 0.5);
}

.brand__name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand__name em {
  font-style: normal;
  color: var(--cyan);
  font-weight: 500;
}
.brand__dot {
  color: var(--fg-dim);
  margin: 0 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 999px;
  font-size: 12px;
  color: var(--fg-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

/* ========================================================================
   Stage / card
   ======================================================================== */

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 38px 36px 32px;
  border-radius: var(--r-card);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    rgba(10, 18, 32, 0.6);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-card);
  isolation: isolate;
  animation: cardIn 0.8s var(--ease) both;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.45), rgba(79, 140, 255, 0.05) 40%, transparent 70%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card__corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid var(--cyan);
  opacity: 0.8;
}
.card__corner--tl { top: -1px; left: -1px;  border-right: none; border-bottom: none; border-top-left-radius: var(--r-card); }
.card__corner--tr { top: -1px; right: -1px; border-left: none;  border-bottom: none; border-top-right-radius: var(--r-card); }
.card__corner--bl { bottom: -1px; left: -1px;  border-right: none; border-top: none; border-bottom-left-radius: var(--r-card); }
.card__corner--br { bottom: -1px; right: -1px; border-left: none;  border-top: none; border-bottom-right-radius: var(--r-card); }

/* Card head */

.card__head {
  margin-bottom: 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--cyan);
  text-transform: uppercase;
}
.eyebrow__bar {
  display: inline-block;
  width: 22px;
  height: 1px;
  background: linear-gradient(to right, var(--cyan), transparent);
}

.title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.subtitle {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
}

/* ========================================================================
   Form
   ======================================================================== */

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

.field {
  position: relative;
}

.field__input {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 44px;
  border-radius: var(--r-input);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.25s var(--ease);
}

.field__input::placeholder { color: transparent; }

.field__input:hover {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.035);
}

.field__input:focus {
  border-color: rgba(0, 212, 255, 0.6);
  background: rgba(0, 212, 255, 0.04);
  box-shadow:
    0 0 0 4px var(--cyan-soft),
    0 0 30px -10px rgba(0, 212, 255, 0.6);
}

.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg);
  -webkit-box-shadow: 0 0 0 1000px rgba(10, 18, 32, 0.95) inset;
  caret-color: var(--fg);
  transition: background-color 9999s ease-in-out 0s;
}

.field__label {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-muted);
  font-size: 14px;
  pointer-events: none;
  transition: all 0.18s var(--ease);
  background: linear-gradient(180deg, transparent 45%, rgba(10, 18, 32, 0.92) 45%);
  padding: 0 6px;
}

.field__input:focus ~ .field__label,
.field__input:not(:placeholder-shown) ~ .field__label {
  top: 0;
  transform: translateY(-50%) scale(0.92);
  left: 36px;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.field__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-dim);
  display: inline-grid;
  place-items: center;
  pointer-events: none;
  transition: color 0.2s var(--ease);
}
.field__input:focus ~ .field__icon { color: var(--cyan); }

.field__line {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--cyan), transparent);
  transform: scaleX(0);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
  transform-origin: center;
}
.field__input:focus ~ .field__line { transform: scaleX(1); opacity: 0.8; }

.field__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.field__toggle:hover { color: var(--fg); background: rgba(255, 255, 255, 0.04); }
.field__toggle .i-eye-off { display: none; }
.field__toggle[aria-pressed="true"] .i-eye { display: none; }
.field__toggle[aria-pressed="true"] .i-eye-off { display: block; }

/* Row */

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px 6px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: var(--fg-muted);
  font-size: 13px;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  display: inline-grid;
  place-items: center;
  color: transparent;
  transition: all 0.18s var(--ease);
}
.check input:checked ~ .check__box {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  border-color: transparent;
  color: #04101e;
  box-shadow: 0 0 18px -4px rgba(0, 212, 255, 0.7);
}
.check input:focus-visible ~ .check__box {
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.check:hover .check__label { color: var(--fg); }

.link {
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  position: relative;
  transition: color 0.2s var(--ease);
}
.link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.link:hover { color: var(--cyan); }
.link:hover::after { transform: scaleX(1); transform-origin: left; }

/* Buttons */

.btn {
  position: relative;
  height: 52px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--cyan-soft); }

.btn--primary {
  color: #051120;
  background: linear-gradient(135deg, #00e6ff 0%, #4f8cff 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 12px 30px -10px rgba(0, 200, 255, 0.55),
    0 0 40px -8px rgba(80, 130, 255, 0.45);
  font-weight: 600;
  margin-top: 4px;
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn--primary:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 14px 36px -8px rgba(0, 200, 255, 0.7), 0 0 50px -6px rgba(80, 130, 255, 0.55); }
.btn--primary:hover::before { transform: translateX(120%); }
.btn--primary .btn__icon { transition: transform 0.25s var(--ease); }
.btn--primary:hover .btn__icon { transform: translateX(3px); }

.btn--ghost {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-2);
  font-size: 14px;
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--cyan);
}

.btn__loader {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: inherit;
}
.btn__loader::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(5, 17, 32, 0.25);
  border-top-color: #051120;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn__label,
.btn.is-loading .btn__icon { opacity: 0; }
.btn.is-loading .btn__loader { display: flex; }
.btn[disabled] { cursor: not-allowed; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg-dim);
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 6px 0 -2px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-2), transparent);
}

/* Status under form */

.status {
  margin: 14px 2px 0;
  min-height: 18px;
  font-size: 13px;
  color: var(--fg-muted);
  text-align: center;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.status.is-visible { opacity: 1; transform: translateY(0); }
.status.is-error { color: var(--err); }
.status.is-ok    { color: var(--ok); }

/* ========================================================================
   Footer
   ======================================================================== */

.footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  font-size: 12px;
  color: var(--fg-dim);
}

.footer__group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer__group--mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.04em;
}

.footer__sep { color: var(--line-2); }
.footer__text { color: var(--fg-muted); }

.pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
}
.pulse__core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.pulse__ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  opacity: 0.6;
  animation: pulseRing 2s var(--ease) infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(0.7); opacity: 0.7; }
  80%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ========================================================================
   Responsive
   ======================================================================== */

@media (max-width: 640px) {
  body { overflow: auto; }
  .topbar { padding: 16px 18px; }
  .stage  { padding: 16px; }
  .card   { padding: 28px 22px 24px; max-width: 100%; }
  .title  { font-size: 24px; }
  .topbar__meta .chip span:last-child { display: none; }
  .footer {
    padding: 14px 18px;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  .footer__group--mono { flex-wrap: wrap; }
}

/* Reduce motion */

@media (prefers-reduced-motion: reduce) {
  .bg__orb--a,
  .bg__orb--b,
  .bg__grid,
  .bg__scan,
  .pulse__ring,
  .card { animation: none !important; }
}
