/* GIFTNEX Auth v5 — production fintech, screenshot-aligned */
:root {
  --gnx-bg: #0a0a0c;
  --gnx-card: rgba(20, 20, 22, 0.72);
  --gnx-card-border: rgba(255, 255, 255, 0.06);
  --gnx-red: #e11d2e;
  --gnx-red-d: #c01020;
  --gnx-red-glow: rgba(225, 29, 46, 0.35);
  --gnx-red-soft: rgba(225, 29, 46, 0.14);
  --gnx-text: #f4f4f5;
  --gnx-muted: #a1a1aa;
  --gnx-line: #2a2a2e;
  --gnx-input: #1a1a1e;
  --gnx-ok: #22c55e;
  --gnx-warn: #fbbf24;
  --gnx-radius: 12px;
  --gnx-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html.id-auth-root { scroll-behavior: smooth; }

body.id-auth {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--gnx-bg);
  color: var(--gnx-text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient */
.id-ambient {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.id-ambient__base {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(225, 29, 46, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(225, 29, 46, 0.06), transparent 50%),
    linear-gradient(180deg, #0a0a0c 0%, #0e0e10 50%, #0a0a0c 100%);
}
.id-ambient__glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px);
  animation: gnx-glow-drift 10s ease-in-out infinite;
}
.id-ambient__glow--1 {
  width: 320px; height: 320px; top: 5%; left: 50%;
  margin-left: -160px;
  background: rgba(225, 29, 46, 0.12);
}
.id-ambient__glow--2 {
  width: 240px; height: 240px; bottom: 10%; right: -40px;
  background: rgba(225, 29, 46, 0.06);
  animation-delay: -5s;
  animation-duration: 14s;
}
@keyframes gnx-glow-drift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  50% { transform: translate(12px, -8px) scale(1.05); opacity: 1; }
}
.id-ambient__noise {
  position: absolute; inset: 0; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.id-canvas {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none; opacity: 0.5;
}

/* Deco cards behind */
.gnx-deco-cards {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none; overflow: hidden;
}
.gnx-deco-card {
  position: absolute;
  width: 100px; height: 62px;
  border-radius: 8px;
  background: rgba(28, 28, 31, 0.5);
  border: 1px solid rgba(225, 29, 46, 0.15);
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: gnx-deco-float 16s ease-in-out infinite;
}
.gnx-deco-card::before {
  content: ""; position: absolute; left: 10px; top: 10px;
  width: 18px; height: 12px; border-radius: 2px;
  background: rgba(225, 29, 46, 0.5);
}
.gnx-deco-card--a { left: 8%; top: 22%; --rot: -12deg; animation-delay: 0s; }
.gnx-deco-card--b { right: 10%; top: 30%; --rot: 8deg; animation-delay: -6s; width: 80px; height: 50px; }
.gnx-deco-card--c { left: 12%; bottom: 18%; --rot: 6deg; animation-delay: -10s; width: 88px; height: 54px; }
@keyframes gnx-deco-float {
  0%, 100% { opacity: 0; transform: translateY(0) rotate(var(--rot, 0deg)); }
  15%, 85% { opacity: 0.22; }
  50% { transform: translateY(-16px) rotate(calc(var(--rot, 0deg) + 4deg)); }
}

/* Layout — centered like screenshot */
.id-scene {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
}
.id-auth-stack {
  width: min(440px, 100%);
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
}

/* Hero visual */
.id-hero {
  position: relative;
  width: 200px; height: 140px;
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.id-hero__orbit {
  position: absolute; border: 1px solid rgba(225, 29, 46, 0.12);
  border-radius: 50%;
  animation: gnx-orbit 12s linear infinite;
}
.id-hero__orbit--1 { width: 180px; height: 60px; animation-duration: 14s; }
.id-hero__orbit--2 { width: 140px; height: 140px; border-style: dashed; opacity: 0.5; animation-direction: reverse; animation-duration: 20s; }
@keyframes gnx-orbit { to { transform: rotate(360deg); } }
.id-vault-svg {
  width: 180px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
  animation: gnx-card-hover 6s ease-in-out infinite;
}
@keyframes gnx-card-hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Glass auth card */
.id-auth-card {
  width: 100%;
  padding: 24px 22px 20px;
  background: var(--gnx-card);
  border: 1px solid var(--gnx-card-border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

/* Entry animations */
.id-enter {
  opacity: 0;
  transform: translateY(10px);
  animation: gnx-enter 0.5s var(--gnx-ease) forwards;
}
.id-enter--1 { animation-delay: 0.1s; }
.id-enter--2 { animation-delay: 0.18s; }
.id-enter--3 { animation-delay: 0.24s; }
.id-enter--4 { animation-delay: 0.3s; }
.id-enter--5 { animation-delay: 0.36s; }
.id-enter--6 { animation-delay: 0.45s; }
@keyframes gnx-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* Brand */
.id-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--gnx-text);
  margin-bottom: 22px;
  transition: opacity 0.2s ease;
}
.id-brand:hover { opacity: 0.9; }
.id-brand__mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gnx-red);
  display: grid; place-items: center;
  color: #fff; font-size: 18px;
  box-shadow: 0 6px 20px var(--gnx-red-soft);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.id-brand:hover .id-brand__mark {
  box-shadow: 0 8px 28px var(--gnx-red-glow);
  transform: scale(1.03);
}
.id-brand__text { display: flex; flex-direction: column; gap: 2px; }
.id-brand__text strong {
  font-size: 20px; font-weight: 800; letter-spacing: 1.5px; line-height: 1;
}
.id-brand__text em {
  font-size: 11px; font-style: normal; color: var(--gnx-muted); font-weight: 500;
}

/* Tabs */
.id-tabs {
  display: flex; position: relative;
  padding: 4px; margin-bottom: 22px;
  background: #141416;
  border: 1px solid var(--gnx-line);
  border-radius: 10px;
}
.id-tabs__pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  background: var(--gnx-red);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--gnx-red-soft);
  transition: transform 0.4s var(--gnx-ease), box-shadow 0.3s ease;
}
.id-scene[data-mode="register"] .id-tabs__pill { transform: translateX(100%); }
.id-tabs button {
  flex: 1; position: relative; z-index: 1;
  border: 0; background: transparent;
  color: var(--gnx-muted);
  font: inherit; font-size: 14px; font-weight: 700;
  padding: 10px 8px; border-radius: 8px;
  cursor: pointer; transition: color 0.25s ease;
}
.id-scene[data-mode="login"] [data-tab="login"],
.id-scene[data-mode="register"] [data-tab="register"] { color: #fff; }

.id-heading {
  margin: 0 0 6px;
  font-size: clamp(24px, 5.5vw, 28px);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -0.02em;
  transition: opacity 0.3s ease, transform 0.35s var(--gnx-ease);
}
.id-sub {
  margin: 0 0 22px;
  color: var(--gnx-muted); font-size: 14px; line-height: 1.5;
  transition: opacity 0.3s ease, transform 0.35s var(--gnx-ease);
}
.id-heading.is-morphing, .id-sub.is-morphing {
  opacity: 0; transform: translateY(8px);
}

/* Forms */
.id-forms { position: relative; min-height: 120px; }
.id-form {
  display: grid; gap: 14px;
  transition: opacity 0.4s var(--gnx-ease), transform 0.4s var(--gnx-ease), visibility 0.4s;
}
.id-form[hidden] {
  opacity: 0; visibility: hidden;
  position: absolute; inset: 0; pointer-events: none;
  transform: translateX(12px);
}

.id-field { display: grid; gap: 6px; }
.id-field__label {
  font-size: 12px; font-weight: 600; color: var(--gnx-muted);
  transition: color 0.25s ease;
}
.id-field.is-focused .id-field__label { color: #fca5a5; }
.id-field__wrap { position: relative; }
.id-field__input {
  width: 100%; height: 48px;
  padding: 0 14px;
  background: var(--gnx-input);
  border: 1px solid #2d2d32;
  border-radius: 10px;
  color: var(--gnx-text);
  font-size: 16px; font-family: inherit;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.id-field__input::placeholder { color: #71717a; }
.id-field__input:hover { border-color: #3f3f46; }
.id-field__input:focus {
  border-color: var(--gnx-red);
  box-shadow: 0 0 0 3px var(--gnx-red-soft);
}
.id-field.is-valid .id-field__input { border-color: rgba(34, 197, 94, 0.45); }
.id-field.is-error .id-field__input {
  border-color: rgba(225, 29, 46, 0.55);
  animation: gnx-shake 0.4s ease;
}
@keyframes gnx-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.id-field__hint {
  font-size: 12px; color: #fca5a5;
  min-height: 0; max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}
.id-field.is-error .id-field__hint { max-height: 24px; opacity: 1; }
.id-field--pw .id-field__input { padding-right: 42px; }
.id-field__toggle {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border: 0; background: transparent;
  color: var(--gnx-muted); cursor: pointer;
  border-radius: 8px;
  display: grid; place-items: center;
  transition: color 0.2s ease, background 0.2s ease;
}
.id-field__toggle:hover { color: #fff; background: rgba(255,255,255,0.05); }
.id-field__toggle i { transition: transform 0.2s ease, opacity 0.2s ease; }

.id-row {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.id-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--gnx-muted); cursor: pointer;
}
.id-check input { accent-color: var(--gnx-red); width: 16px; height: 16px; }
.id-link-btn {
  border: 0; background: none; padding: 0;
  color: var(--gnx-red); font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
}
.id-link-btn:hover { opacity: 0.85; text-decoration: underline; }

/* Password panel */
.id-pw-panel {
  margin-top: 4px; padding: 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--gnx-line);
  border-radius: 10px;
  transition: opacity 0.3s ease;
}
.id-pw-panel[hidden] { display: none; }
.id-pw-panel__title {
  margin: 0 0 8px; font-size: 12px; color: var(--gnx-muted);
}
.id-pw-panel__title span { color: #fff; font-weight: 700; }
.id-pw-panel__title span.is-weak { color: #fbbf24; }
.id-pw-panel__title span.is-fair { color: #fb923c; }
.id-pw-panel__title span.is-good { color: #86efac; }
.id-pw-panel__title span.is-strong { color: var(--gnx-ok); }
.id-pw-reqs {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 5px;
}
.id-pw-reqs li {
  font-size: 11px; color: var(--gnx-muted);
  display: flex; align-items: center; gap: 8px;
  transition: color 0.25s ease;
}
.id-pw-reqs li i { font-size: 6px; transition: color 0.25s ease; }
.id-pw-reqs li.is-ok { color: var(--gnx-ok); }
.id-pw-reqs li.is-ok i { color: var(--gnx-ok); }

.id-match {
  margin: 4px 0 0; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.id-match.is-ok { color: var(--gnx-ok); }
.id-match.is-bad { color: #fca5a5; }
.id-match[hidden] { display: none; }

.id-optional { font-weight: 400; opacity: 0.55; }
.id-terms {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12px; color: var(--gnx-muted); line-height: 1.45;
  cursor: pointer;
}
.id-terms input { margin-top: 3px; accent-color: var(--gnx-red); flex-shrink: 0; }
.id-terms a { color: var(--gnx-red); text-decoration: none; }
.id-terms a:hover { text-decoration: underline; }
.id-terms .id-field__hint { width: 100%; }

/* CTA */
.id-cta {
  width: 100%; height: 50px; margin-top: 4px;
  border: 0; border-radius: 10px;
  background: var(--gnx-red);
  color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 24px var(--gnx-red-soft);
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.2s ease;
}
.id-cta:hover:not(:disabled) {
  background: var(--gnx-red-d);
  box-shadow: 0 10px 28px var(--gnx-red-glow);
  transform: translateY(-1px);
}
.id-cta:active:not(:disabled) { transform: scale(0.98) translateY(0); }
.id-cta:disabled, .id-cta.is-loading {
  opacity: 0.75; cursor: not-allowed; pointer-events: none;
}
.id-cta.is-loading span { opacity: 0; }
.id-cta.is-loading::after {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gnx-spin 0.65s linear infinite;
}
.id-cta { position: relative; }

.id-flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  border-radius: 10px; font-size: 13px; line-height: 1.4;
  border: 1px solid rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
}
.id-flash--success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}
.id-flash[hidden] { display: none; }

.id-back {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 0;
  color: var(--gnx-muted); font: inherit; font-size: 13px;
  cursor: pointer; margin-bottom: 16px;
  transition: color 0.2s ease;
}
.id-back:hover { color: #fff; }

.id-home-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 18px;
  color: var(--gnx-muted); font-size: 13px;
  text-decoration: none; transition: color 0.2s ease;
}
.id-home-link:hover { color: #fff; }

/* Forgot view */
#idForgotView[hidden] { display: none; }
.id-scene[data-view="forgot"] #idAuthViews { display: none; }
.id-scene[data-view="forgot"] .id-tabs,
.id-scene[data-view="forgot"] .id-home-link { display: none; }

/* Desktop */
@media (min-width: 768px) {
  .id-scene { align-items: center; padding: 40px 24px; }
  .id-auth-card { padding: 28px 28px 24px; }
  .gnx-deco-card { opacity: 0.15; }
}

@media (max-width: 374px) {
  .id-auth-card { padding: 20px 16px; }
  .id-tabs button { font-size: 13px; padding: 9px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .id-enter { animation: none; opacity: 1; transform: none; }
  .id-ambient__glow, .gnx-deco-card, .id-hero__orbit,
  .id-vault-svg { animation: none !important; }
  .id-canvas { display: none; }
  .id-tabs__pill { transition-duration: 0.01ms; }
  .id-form, .id-heading, .id-sub { transition-duration: 0.01ms; }
}
