/* ===================== */
/*        TOKENS         */
/* ===================== */

:root {
  --nx-bg-dark: #020617;
  --nx-card-bg: #020617;
  --nx-card-border: rgba(148, 163, 184, 0.45);

  --nx-text-main: #f9fafb;
  --nx-text-muted: #9ca3af;

  --nx-input-bg: #020818;
  --nx-input-border: rgba(148, 163, 184, 0.6);
  --nx-input-border-focus: #38bdf8; /* ELECTRIC BLUE */
  --nx-accent: #38bdf8;
  --nx-accent-soft: rgba(56, 189, 248, 0.55);

  --nx-radius-xl: 24px;
  --nx-shadow-soft: 0 32px 80px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--nx-text-main);
}

/* ===================== */
/*      BACKGROUND       */
/* ===================== */

.nx-body {
  min-height: 100vh;
  background-color: var(--nx-bg-dark);
  color: var(--nx-text-main);
  position: relative;
  overflow-x: hidden;   /* allow vertical scroll for tall forms */
}

/* shared animated glow layer (same for login & register) */
.nx-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 15%, #1d4ed8 0, transparent 55%),
    radial-gradient(circle at 80% 80%, #f97316 0, transparent 60%),
    radial-gradient(circle at 0% 100%, #a855f7 0, transparent 55%);
  filter: blur(55px);
  opacity: 0.6;
  animation: nx-bg-move 22s ease-in-out infinite alternate;
}

@keyframes nx-bg-move {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-40px, 20px, 0);
  }
}

/* we keep modifier classes for later, but same background for both now */
.nx-body--login .nx-bg,
.nx-body--register .nx-bg {
  background:
    radial-gradient(circle at 15% 15%, #1d4ed8 0, transparent 55%),
    radial-gradient(circle at 80% 80%, #f97316 0, transparent 60%),
    radial-gradient(circle at 0% 100%, #a855f7 0, transparent 55%);
}

/* ===================== */
/*       LAYOUT          */
/* ===================== */

.nx-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* register page: more space at top, but still centered-ish */
.nx-shell--top {
  align-items: flex-start;
  padding-top: 72px;
  padding-bottom: 48px;
}

/* ===================== */
/*         CARD          */
/* ===================== */

.nx-card {
  width: 100%;
  max-width: 460px;
  background: radial-gradient(circle at top, #020617 0, #020617 45%, #000 100%);
  background-color: rgba(15, 23, 42, 0.96);
  border-radius: var(--nx-radius-xl);
  border: 1px solid var(--nx-card-border);
  padding: 32px 32px 28px;
  box-shadow: var(--nx-shadow-soft);
  backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
}

/* auth cards (login / register) */
.nx-card--auth {
  max-width: 520px;
}

.nx-card--wide,
.nx-card--register {
  max-width: 640px;
  padding-top: 40px;
}

/* subtle inner border */
.nx-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(248, 250, 252, 0.06);
  pointer-events: none;
}

/* rhythmic glowing halo behind card */
.nx-card::after {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(56, 189, 248, 0.22), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.22), transparent 62%);
  mix-blend-mode: screen;
  opacity: 0.28;
  transform: scale(1);
  animation: nx-card-pulse 16s ease-in-out infinite;
}

@keyframes nx-card-pulse {
  0% {
    opacity: 0.16;
    transform: scale(0.99);
  }
  50% {
    opacity: 0.45;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.18;
    transform: scale(0.99);
  }
}

/* ===================== */
/*        HEADER         */
/* ===================== */

.nx-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

/* electric-blue glowing pill with tick (shared login/register) */
.nx-logo-pill {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(circle at 20% 0%, #e0f2fe 0, #0ea5e9 35%, #0369a1 70%, #020617 100%);

  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.8),
    0 0 24px rgba(56, 189, 248, 0.9);

  transform: translateY(2px);
  animation: nx-logo-pulse 7s ease-in-out infinite;
}

.nx-logo-tick {
  color: #f9fafb;
  font-size: 20px;
  line-height: 1;
}

@keyframes nx-logo-pulse {
  0% {
    box-shadow:
      0 0 0 2px rgba(56, 189, 248, 0.7),
      0 0 18px rgba(56, 189, 248, 0.6);
    transform: translateY(2px) scale(1);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(56, 189, 248, 1),
      0 0 32px rgba(125, 211, 252, 1);
    transform: translateY(0) scale(1.03);
  }
  100% {
    box-shadow:
      0 0 0 2px rgba(56, 189, 248, 0.7),
      0 0 18px rgba(56, 189, 248, 0.6);
    transform: translateY(2px) scale(1);
  }
}

.nx-brand {
  font-size: 22px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #f9fafb;
  margin: 0 0 4px;
}

.nx-subtitle {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}

/* small line above register card */
.nx-tagline {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(156, 163, 175, 0.9);
}

/* ===================== */
/*      INTRO / TEXT     */
/* ===================== */

.nx-intro {
  margin: 8px 0 22px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--nx-text-muted);
}

/* ===================== */
/*         FORM          */
/* ===================== */

.nx-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nx-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nx-label {
  font-size: 12px;
  color: rgba(209, 213, 219, 0.9);
}

/* simple grid helper for 2-column on desktop */
.nx-grid {
  display: grid;
  gap: 14px;
}

.nx-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* inputs & selects */

.nx-field input,
.nx-field select {
  width: 100%;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;

  border: 1px solid var(--nx-input-border);
  background-color: #020617;
  background-image: radial-gradient(circle at top, var(--nx-input-bg), #000000);

  color: var(--nx-text-main);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    transform 0.08s ease;
  box-shadow: 0 0 0 1px #020617;
}

.nx-field input::placeholder,
.nx-field select::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

/* textarea styled to match */

.nx-textarea {
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid var(--nx-input-border);
  background-color: #020617;
  background-image: radial-gradient(circle at top, var(--nx-input-bg), #000000);
  color: var(--nx-text-main);
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    transform 0.08s ease;
}

/* focus = electric blue glow */

.nx-field input:focus,
.nx-field select:focus,
.nx-textarea:focus {
  border-color: var(--nx-input-border-focus);
  box-shadow:
    0 0 0 1px #020617,
    0 0 0 1px var(--nx-accent-soft),
    0 0 26px var(--nx-accent-soft);
  background-image: radial-gradient(circle at top, #020617, #020617);
  transform: translateY(-1px);
}

/* Chrome autofill fix */

.nx-field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #020617 inset;
  -webkit-text-fill-color: var(--nx-text-main);
  border-color: var(--nx-input-border-focus);
}

/* row under password / general flex rows */

.nx-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 2px;
}

.nx-form-row--stack {
  align-items: flex-start;
  justify-content: flex-start;
}

/* checkbox + link row */

.nx-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nx-text-muted);
}

.nx-remember input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--nx-accent);
  cursor: pointer;
}

/* links */

.nx-link {
  color: #e5e7eb;
  text-decoration: none;
  position: relative;
}

.nx-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0%;
  height: 1px;
  background: linear-gradient(to right, var(--nx-accent), #a855f7);
  transition: width 0.16s ease;
}

.nx-link:hover::after {
  width: 100%;
}

/* ===================== */
/*      PRIMARY BTN      */
/* ===================== */

.nx-btn-primary {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #020617;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
  box-shadow: 0 16px 30px rgba(56, 189, 248, 0.35);
  animation: nx-btn-pulse 6s ease-in-out infinite;
}

.nx-btn-primary span {
  position: relative;
  z-index: 1;
}

.nx-btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, #ffffff55 0, transparent 40%);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nx-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 40px rgba(56, 189, 248, 0.45);
  filter: brightness(1.02);
}

.nx-btn-primary:hover::before {
  opacity: 1;
  transform: translate3d(4px, 4px, 0);
}

.nx-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 12px 24px rgba(56, 189, 248, 0.38);
}

@keyframes nx-btn-pulse {
  0% {
    box-shadow: 0 16px 30px rgba(56, 189, 248, 0.32);
  }
  50% {
    box-shadow: 0 22px 46px rgba(56, 189, 248, 0.6);
  }
  100% {
    box-shadow: 0 16px 30px rgba(56, 189, 248, 0.32);
  }
}

/* ===================== */
/*      MESSAGES / FOOT  */
/* ===================== */

.nx-error {
  margin-top: 8px;
  font-size: 12px;
  color: #fca5a5;
}

.nx-success {
  margin-top: 8px;
  font-size: 12px;
  color: #a7f3d0;
}

.nx-footnote {
  margin-top: 10px;
  font-size: 12px;
  color: var(--nx-text-muted);
}

/* ===================== */
/*      RESPONSIVE       */
/* ===================== */

@media (max-width: 640px) {
  .nx-shell,
  .nx-shell--top {
    padding: 16px;
    padding-top: 72px;
  }

  .nx-card {
    padding: 24px 20px 22px;
    border-radius: 20px;
  }

  .nx-brand {
    font-size: 18px;
    letter-spacing: 0.22em;
  }

  .nx-grid--2 {
    grid-template-columns: 1fr;
  }
}
