/* ==========================================================================
   ZyJobs Auth — KINETIC LUXURY (v3.0.0)
   Landing v4.5.0 design language ported to Login / Register / Verify-OTP.
   Deep Nocturne Onyx · Champagne Gold · Celestial Ice · Grain & Gridlines.
   Scoped to body.ld-auth-body — additive only, zero logic coupling.
   All IDs / form behavior / JS-injected classes (zy-auth-alert, zy-spinner)
   are styled here but never renamed or removed.
   ========================================================================== */

:root {
  --ld-bg: #060709;
  --ld-bg-2: #0c0e14;
  --ld-bg-3: #131722;
  --ld-bg-glass: rgba(12, 14, 20, 0.82);

  --ld-line: rgba(255, 255, 255, 0.08);
  --ld-line-soft: rgba(255, 255, 255, 0.04);
  --ld-line-gold: rgba(212, 175, 55, 0.28);

  --ld-gold: #d4af37;
  --ld-gold-light: #f3e5ab;
  --ld-gold-glow: rgba(212, 175, 55, 0.18);
  --ld-gold-dark: #8c7322;

  --ld-ice: #38bdf8;
  --ld-ice-glow: rgba(56, 189, 248, 0.18);
  --ld-emerald: #10b981;
  --ld-crimson: #f43f5e;

  --ld-txt: #f8fafc;
  --ld-mut: #94a3b8;
  --ld-dim: #64748b;
  --ld-ink: #060709;

  --ld-font-display: 'Anton', 'Space Grotesk', -apple-system, sans-serif;
  --ld-font-body: 'Space Grotesk', -apple-system, sans-serif;
  --ld-font-mono: 'Space Mono', monospace;
  --ld-font-serif: 'Playfair Display', Georgia, serif;
}

/* ── Global Canvas & Grain ─────────────────────────────────────────────── */
body.ld-auth-body {
  background-color: var(--ld-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 175, 55, 0.08), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 96px);
  color: var(--ld-txt);
  font-family: var(--ld-font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

body.ld-auth-body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.ld-auth-body .zy-auth-bg {
  display: none;
}

::selection {
  background: var(--ld-gold);
  color: var(--ld-ink);
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--ld-bg); }
::-webkit-scrollbar-thumb {
  background: var(--ld-line);
  border: 2px solid var(--ld-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--ld-gold); }

:focus-visible {
  outline: 2px solid var(--ld-gold);
  outline-offset: 3px;
}

/* Typography primitives (landing parity) */
.ld-text-gold {
  color: var(--ld-gold);
  background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 60%, #b89628 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ld-text-ice { color: var(--ld-ice); }
.ld-text-emerald { color: var(--ld-emerald); }

/* ── Split Shell ───────────────────────────────────────────────────────── */
.ld-auth-shell {
  display: grid;
  grid-template-columns: 58fr 42fr;
  min-height: 100vh;
  position: relative;
}

/* ── Visual Side ───────────────────────────────────────────────────────── */
.ld-auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.6vh, 26px);
  padding: clamp(20px, 3.5vh, 44px) clamp(28px, 4vw, 64px) clamp(104px, 15vh, 156px);
  overflow: hidden;
  min-height: 100vh;
}

.ld-auth-visual-grid {
  position: absolute;
  inset: -96px 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 96px);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 45% 35%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 70% at 45% 35%, #000 30%, transparent 78%);
  animation: ld-auth-grid-drift 16s linear infinite;
  will-change: transform;
}

@keyframes ld-auth-grid-drift {
  to { transform: translateY(96px); }
}

.ld-auth-aurora {
  position: absolute;
  top: 12%;
  right: -8%;
  width: clamp(320px, 42vw, 620px);
  height: clamp(320px, 42vw, 620px);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(4px);
}

.ld-auth-visual-words {
  margin-top: auto;
  position: relative;
  z-index: 1;
  user-select: none;
}

.ld-vw {
  display: block;
  font-family: var(--ld-font-display);
  font-weight: 400;
  font-size: clamp(3rem, min(9.5vw, 12vh), 9.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  will-change: transform, clip-path;
}

.ld-vw--outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--ld-txt);
}

.ld-vw--gold {
  color: var(--ld-gold);
  background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 60%, #b89628 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: clamp(32px, 7vw, 140px);
}

@supports not (-webkit-text-stroke: 1px #000) {
  .ld-vw--outline { color: var(--ld-txt); }
}

.ld-auth-quote {
  position: relative;
  z-index: 1;
  font-family: var(--ld-font-serif);
  font-style: italic;
  font-size: clamp(0.9rem, 1.1vw, 1.08rem);
  line-height: 1.6;
  color: var(--ld-mut);
  border-left: 2px solid var(--ld-gold);
  padding-left: 16px;
  margin: 0;
  max-width: 44ch;
}

/* Terminal readout */
.ld-terminal {
  position: relative;
  z-index: 1;
  width: min(480px, 92%);
  background: var(--ld-bg-2);
  border: 1px solid var(--ld-line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ld-terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(8px, 1.4vh, 10px) 14px;
  border-bottom: 1px solid var(--ld-line);
  background: var(--ld-bg-3);
}

.ld-terminal-name {
  font-family: var(--ld-font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--ld-mut);
}

.ld-terminal-ver {
  font-family: var(--ld-font-mono);
  font-size: 0.6rem;
  color: var(--ld-gold);
  border: 1px solid var(--ld-line-gold);
  background: var(--ld-gold-glow);
  padding: 3px 7px;
}

.ld-terminal-body {
  padding: clamp(12px, 2vh, 16px) clamp(14px, 2vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ld-terminal-body p {
  font-family: var(--ld-font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ld-mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ld-terminal-body .ld-term-ok {
  color: var(--ld-ice);
}

.ld-caret {
  display: inline-block;
  width: 8px;
  height: 13px;
  background: var(--ld-gold);
  margin-left: 4px;
  vertical-align: -2px;
  animation: ld-caret-blink 1s steps(2, start) infinite;
}

@keyframes ld-caret-blink {
  to { visibility: hidden; }
}

/* Telemetry mini-strip (landing hero-stats DNA) */
.ld-auth-telemetry {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ld-line);
  background: var(--ld-bg-2);
  width: min(480px, 92%);
}

.ld-tele-item {
  padding: clamp(10px, 1.8vh, 14px) clamp(14px, 2vw, 18px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ld-tele-item + .ld-tele-item {
  border-left: 1px solid var(--ld-line);
}

.ld-tele-num {
  font-family: var(--ld-font-display);
  font-size: clamp(1.3rem, 2.2vw, 2.1rem);
  line-height: 1;
  color: var(--ld-txt);
}

.ld-tele-label {
  font-family: var(--ld-font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ld-dim);
}

/* Sticker */
.ld-sticker--visual {
  position: absolute;
  right: clamp(24px, 4vw, 72px);
  top: 30%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 60%, #b89628 100%);
  color: var(--ld-ink);
  font-family: var(--ld-font-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 22px var(--ld-gold-glow);
  pointer-events: none;
}

.ld-sticker--visual .ld-sticker-label {
  font-size: 0.6rem;
  border: 1px solid currentColor;
  padding: 3px 6px;
}

.ld-sticker--visual .ld-sticker-value {
  font-family: var(--ld-font-display);
  font-size: 1.5rem;
}

/* Crosshair deco */
.ld-cross {
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
}

.ld-cross::before,
.ld-cross::after {
  content: '';
  position: absolute;
  background: var(--ld-line);
}

.ld-cross::before {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
}

.ld-cross::after {
  top: 50%;
  left: 0;
  height: 1px;
  width: 100%;
  transform: translateY(-50%);
}

.ld-cross--a { top: 20%; right: 6%; }
.ld-cross--b { bottom: 18%; left: 4%; }

/* Marquee strip — gold luxury (landing parity) */
.ld-auth-marquee {
  position: absolute;
  left: -4%;
  bottom: 46px;
  width: 108%;
  background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 60%, #b89628 100%);
  color: var(--ld-ink);
  border-top: 1px solid var(--ld-gold);
  border-bottom: 1px solid var(--ld-gold);
  transform: rotate(-1.2deg) scale(1.02);
  overflow: hidden;
  padding: 12px 0;
  z-index: 2;
  pointer-events: none;
}

.ld-auth-marquee-track {
  display: flex;
  width: max-content;
  animation: ld-auth-marquee 26s linear infinite;
}

.ld-auth-marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ld-auth-marquee-group span {
  font-family: var(--ld-font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  letter-spacing: 0.04em;
  padding: 0 18px;
  white-space: nowrap;
}

.ld-auth-marquee-group i {
  display: block;
  width: 10px;
  height: 10px;
  background: var(--ld-ink);
  transform: rotate(45deg);
  flex-shrink: 0;
}

@keyframes ld-auth-marquee {
  to { transform: translateX(-50%); }
}

/* ── Form Side ─────────────────────────────────────────────────────────── */
.ld-auth-form-side {
  position: relative;
  border-left: 1px solid var(--ld-line);
  background: linear-gradient(180deg, rgba(12, 14, 20, 0.6) 0%, rgba(6, 7, 9, 0.88) 100%);
  padding: clamp(20px, 3vh, 44px) clamp(24px, 3.5vw, 56px) clamp(16px, 2.4vh, 32px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ld-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ld-txt);
  width: max-content;
  max-width: 100%;
  margin-bottom: clamp(18px, 3.2vh, 44px);
  overflow: hidden;
}

.ld-auth-brand img,
.ld-auth-logo {
  height: 36px !important;
  width: auto !important;
  max-width: 160px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ld-auth-brand:hover .ld-auth-logo,
.ld-auth-brand:hover img {
  transform: scale(1.02);
  opacity: 0.95;
}

.ld-auth-form-wrap {
  margin: auto 0;
  width: 100%;
  max-width: 520px;
}

/* Head */
.ld-auth-head {
  margin-bottom: clamp(18px, 2.8vh, 36px);
}

.ld-auth-title {
  font-family: var(--ld-font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, min(4.6vw, 6.5vh), 4.4rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: clamp(16px, 2.2vh, 22px) 0 clamp(10px, 1.6vh, 14px);
}

.ld-auth-title .ld-line-inner {
  background: linear-gradient(135deg, #f8fafc 0%, #f3e5ab 18%, #d4af37 55%, #b89628 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--ld-txt);
}

.ld-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

.ld-line-inner {
  display: inline-block;
  will-change: transform;
}

.ld-auth-sub {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ld-mut);
  max-width: 40ch;
}

.ld-auth-sub strong {
  color: var(--ld-gold);
  font-weight: 600;
}

.ld-email-prompt {
  color: var(--ld-gold);
  cursor: pointer;
  text-decoration: underline;
}

/* Alerts (class names injected by existing auth JS — styled only) */
.zy-auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid;
  border-left-width: 4px;
  font-family: var(--ld-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
  background: var(--ld-bg-2);
}

.zy-auth-alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.zy-auth-alert-success {
  background: rgba(16, 185, 129, 0.07);
  border-color: var(--ld-emerald);
  color: var(--ld-emerald);
}

.zy-auth-alert-error {
  background: rgba(244, 63, 94, 0.07);
  border-color: var(--ld-crimson);
  color: var(--ld-crimson);
}

.zy-auth-alert-info {
  background: rgba(56, 189, 248, 0.06);
  border-color: var(--ld-ice);
  color: var(--ld-ice);
}

/* Form */
.ld-auth-form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vh, 20px);
}

.ld-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ld-field-label {
  font-family: var(--ld-font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ld-dim);
  transition: color 0.25s;
}

.ld-field-box {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--ld-line);
  background: var(--ld-bg-2);
  padding: 0 18px;
  height: clamp(54px, 9vh, 66px);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.ld-field-box > i {
  font-size: 1.15rem;
  color: var(--ld-dim);
  flex-shrink: 0;
  transition: color 0.25s;
}

.ld-field-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--ld-font-mono);
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  letter-spacing: 0.03em;
  color: var(--ld-txt);
}

.ld-field-box input::placeholder {
  color: var(--ld-dim);
}

.ld-field-box input:-webkit-autofill,
.ld-field-box input:-webkit-autofill:hover,
.ld-field-box input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--ld-bg-2) inset;
  -webkit-text-fill-color: var(--ld-txt);
  transition: background-color 9999s ease-in-out 0s;
}

.ld-field-box:focus-within {
  border-color: var(--ld-gold);
  box-shadow: 0 0 0 1px var(--ld-gold), 0 0 26px var(--ld-gold-glow);
  background: #0a0c10;
}

.ld-field-box:focus-within > i {
  color: var(--ld-gold);
}

.ld-field:focus-within .ld-field-label {
  color: var(--ld-gold);
}

.ld-field-box--otp input {
  font-size: 1.3rem;
  letter-spacing: 0.5em;
}

.ld-field-eye {
  background: none;
  border: none;
  color: var(--ld-dim);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 8px;
  flex-shrink: 0;
  transition: color 0.25s, transform 0.2s;
}

.ld-field-eye:hover {
  color: var(--ld-gold);
  transform: scale(1.12);
}

/* Submit — champagne gold sweep (landing .ld-btn-gold parity) */
.ld-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  padding: clamp(18px, 2.8vh, 22px) 30px;
  margin-top: 6px;
  background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 60%, #b89628 100%);
  border: 1px solid var(--ld-gold);
  color: var(--ld-ink);
  font-family: var(--ld-font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.3s cubic-bezier(0.65, 0, 0.35, 1), border-color 0.3s, box-shadow 0.3s;
}

.ld-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.34s cubic-bezier(0.65, 0, 0.35, 1);
}

.ld-submit:hover {
  border-color: #ffffff;
  box-shadow: 0 0 28px rgba(243, 229, 171, 0.35);
}

.ld-submit:hover::before {
  transform: scaleX(1);
}

.ld-submit i {
  font-size: 1.2rem;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.ld-submit:hover i {
  transform: translate(3px, -3px);
}

.ld-submit:disabled {
  cursor: wait;
  opacity: 0.85;
}

/* Spinner (class injected by existing auth JS) */
.zy-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: ld-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* Aux + foot + legal */
.ld-auth-aux {
  margin-top: 18px;
}

.ld-auth-aux--center {
  text-align: center;
}

.ld-forgot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 6px 0;
  font-family: var(--ld-font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ld-ice);
  cursor: pointer;
  transition: color 0.25s, transform 0.25s;
}

.ld-forgot-link:hover:not(:disabled) {
  color: var(--ld-gold);
  transform: translateX(4px);
}

.ld-forgot-link:disabled {
  color: var(--ld-dim);
  cursor: not-allowed;
}

.ld-forgot-link.is-active {
  color: var(--ld-gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ld-forgot-link #countdown {
  margin-left: 0.25rem;
}

.ld-auth-foot {
  margin-top: clamp(16px, 2.6vh, 26px);
  padding-top: 16px;
  border-top: 1px solid var(--ld-line);
  font-size: 0.88rem;
  color: var(--ld-mut);
}

.ld-auth-foot a {
  color: var(--ld-gold);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, color 0.25s;
}

.ld-auth-foot a:hover {
  color: var(--ld-ice);
  border-bottom-color: var(--ld-ice);
}

.ld-auth-legal {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--ld-dim);
}

.ld-auth-legal a {
  color: var(--ld-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s;
}

.ld-auth-legal a:hover {
  color: var(--ld-gold);
}

.ld-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(14px, 2.4vh, 32px);
  font-family: var(--ld-font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ld-dim);
  text-decoration: none;
  transition: color 0.25s, transform 0.25s;
  width: max-content;
}

.ld-auth-back:hover {
  color: var(--ld-gold);
  transform: translateX(-4px);
}

/* ── OTP Digit Boxes ───────────────────────────────────────────────────── */
.zy-otp-container {
  display: flex;
  gap: clamp(0.45rem, 1.2vw, 0.7rem);
  justify-content: space-between;
  margin-top: 0.5rem;
}

.zy-otp-input {
  width: clamp(2.7rem, 7vw, 3.4rem);
  height: 3.8rem;
  flex: 0 1 auto;
  text-align: center;
  padding: 0;
  font-family: var(--ld-font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ld-txt);
  background: var(--ld-bg-2);
  border: 1px solid var(--ld-line);
  outline: none;
  caret-color: var(--ld-gold);
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s, transform 0.2s;
}

.zy-otp-input:hover {
  border-color: var(--ld-line-gold);
}

.zy-otp-input:focus {
  border-color: var(--ld-gold);
  box-shadow: 0 0 0 1px var(--ld-gold), 0 0 22px var(--ld-gold-glow);
  background: #0a0c10;
  transform: translateY(-2px);
}

.zy-otp-input.is-filled {
  border-color: var(--ld-line-gold);
  color: var(--ld-gold);
}

.zy-otp-container.ld-shake {
  animation: ld-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.zy-otp-container.ld-shake .zy-otp-input:not(.is-filled) {
  border-color: var(--ld-crimson);
}

@keyframes ld-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* Success state (classes + IDs from existing verify-otp markup) */
.zy-auth-success {
  text-align: center;
  margin-top: 2rem;
}

.zy-auth-success .ld-success-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin-bottom: 1.25rem;
  font-size: 3.2rem;
  color: var(--ld-emerald);
}

.zy-auth-success .ld-success-icon::before,
.zy-auth-success .ld-success-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--ld-gold);
  opacity: 0;
  animation: ld-success-ring 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.zy-auth-success .ld-success-icon::after {
  animation-delay: 0.55s;
}

@keyframes ld-success-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

.zy-auth-success .ld-auth-title .ld-line-inner {
  background: linear-gradient(135deg, #f8fafc 0%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.zy-auth-success .ld-auth-sub {
  margin-inline: auto;
}

/* ── Modal buttons (luxury variants) ──────────────────────────────────── */
.ld-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--ld-font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 22px;
  border: 1px solid var(--ld-line);
  background: transparent;
  color: var(--ld-txt);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.28s cubic-bezier(0.65, 0, 0.35, 1), border-color 0.28s, box-shadow 0.28s;
}

.ld-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ld-gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.32s cubic-bezier(0.65, 0, 0.35, 1);
}

.ld-btn:hover {
  color: var(--ld-ink);
  border-color: var(--ld-gold);
  box-shadow: 0 0 24px var(--ld-gold-glow);
}

.ld-btn:hover::before {
  transform: scaleX(1);
}

.ld-btn:hover i {
  transform: translate(3px, -3px);
}

.ld-btn i {
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.ld-btn-gold {
  background: linear-gradient(135deg, #f3e5ab 0%, #d4af37 60%, #b89628 100%);
  border-color: var(--ld-gold);
  color: var(--ld-ink);
}

.ld-btn-gold::before {
  background: #ffffff;
}

.ld-btn-gold:hover {
  border-color: #ffffff;
  box-shadow: 0 0 26px rgba(243, 229, 171, 0.35);
}

.ld-btn-ghost::before {
  background: var(--ld-txt);
}

.ld-btn-ghost:hover {
  color: var(--ld-ink);
  border-color: var(--ld-txt);
}

.ld-btn:disabled {
  cursor: wait;
  opacity: 0.8;
}

/* ── Forgot password modal ─────────────────────────────────────────────── */
.ld-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(6, 7, 9, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}

.ld-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s;
}

.ld-modal {
  width: 100%;
  max-width: 520px;
  background: var(--ld-bg-2);
  border: 1px solid var(--ld-line);
  border-left: 4px solid var(--ld-gold);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 40px var(--ld-gold-glow);
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ld-modal-overlay.active .ld-modal {
  transform: translateY(0) scale(1);
}

.ld-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ld-line);
  background: var(--ld-bg-3);
}

.ld-modal-x {
  background: none;
  border: 1px solid var(--ld-line);
  color: var(--ld-mut);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}

.ld-modal-x:hover {
  color: var(--ld-ink);
  background: var(--ld-gold);
  border-color: var(--ld-gold);
}

.ld-modal-step {
  padding: 22px 20px 26px;
}

.ld-modal-title {
  font-family: var(--ld-font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--ld-txt);
}

.ld-modal-title--head {
  margin: 0;
}

.ld-modal-desc {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--ld-mut);
  margin-bottom: 18px;
}

.ld-modal-step .ld-field {
  margin-bottom: 18px;
}

.ld-modal-step .zy-auth-alert {
  margin-bottom: 16px;
}

.ld-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Utility (used by existing auth JS) ────────────────────────────────── */
.zy-hidden {
  display: none !important;
}

/* ── Desktop: exact viewport fit (no page scroll, visual never overflows) ─ */
@media (min-width: 769px) {
  body.ld-auth-body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
  }

  .ld-auth-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .ld-auth-visual {
    min-height: 0;
    height: 100%;
  }

  .ld-auth-form-side {
    min-height: 0;
    max-height: none;
    height: 100%;
  }
}

/* Desktop short-viewport compaction — fluid, every control stays reachable */
@media (min-width: 769px) and (max-height: 780px) {
  .ld-auth-visual {
    gap: clamp(10px, 1.8vh, 16px);
    padding-bottom: clamp(96px, 14.5vh, 118px);
  }

  .ld-vw {
    font-size: clamp(2.6rem, min(9vw, 13vh), 7rem);
  }

  .ld-auth-quote {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .ld-terminal-body p {
    font-size: 0.7rem;
  }

  .ld-auth-form-side {
    padding-top: clamp(14px, 2.4vh, 20px);
    padding-bottom: clamp(14px, 2.4vh, 20px);
  }

  .ld-auth-brand {
    margin-bottom: clamp(10px, 1.8vh, 16px);
  }

  .ld-auth-head {
    margin-bottom: clamp(10px, 1.8vh, 16px);
  }

  .ld-auth-title {
    font-size: clamp(1.9rem, min(4vw, 7vh), 2.9rem);
    margin-top: clamp(10px, 1.6vh, 14px);
  }

  .ld-auth-sub {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .ld-auth-form {
    gap: clamp(10px, 1.6vh, 14px);
  }

  .ld-field-box {
    height: clamp(46px, 8.5vh, 56px);
  }

  .ld-submit {
    padding: clamp(16px, 2.4vh, 18px) 28px;
  }

  .ld-auth-aux {
    margin-top: 12px;
  }

  .ld-auth-foot {
    margin-top: clamp(10px, 2vh, 18px);
    padding-top: 14px;
  }

  .ld-auth-foot p {
    margin: 0 0 6px;
  }

  .ld-auth-legal {
    margin-top: 6px;
  }

  .ld-auth-back {
    margin-top: clamp(10px, 2vh, 18px);
  }
}

@media (min-width: 769px) and (max-height: 640px) {
  .ld-auth-quote {
    display: none;
  }

  .ld-auth-marquee {
    bottom: 22px;
  }

  .ld-auth-visual {
    padding-bottom: clamp(88px, 14vh, 104px);
  }
}

/* ── Responsive ────────────────────────────────────────────────────────── */
/* Tablet & iPad (Pro / Air / Mini landscape) — balanced 50/50 split */
@media (min-width: 769px) and (max-width: 1180px) {
  .ld-auth-shell {
    grid-template-columns: 1fr 1fr;
  }

  .ld-auth-visual {
    padding: clamp(20px, 3.5vh, 40px) clamp(24px, 3.5vw, 48px) clamp(104px, 15vh, 150px);
  }

  .ld-vw {
    font-size: clamp(2.8rem, min(8vw, 11vh), 6.5rem);
  }

  .ld-auth-quote {
    max-width: 34ch;
  }

  .ld-terminal,
  .ld-auth-telemetry {
    width: 100%;
  }
}

/* Tablet portrait — group visual content centered, declutter sticker */
@media (min-width: 769px) and (max-width: 1180px) and (orientation: portrait) {
  .ld-auth-visual {
    justify-content: center;
  }

  .ld-auth-visual-words {
    margin-top: 0;
  }

  .ld-sticker--visual {
    display: none;
  }
}

@media (max-width: 768px) {
  .ld-auth-visual {
    display: none;
  }

  .ld-auth-shell {
    grid-template-columns: 1fr;
  }

  .ld-auth-form-side {
    border-left: none;
    max-height: none;
    min-height: 100vh;
    overflow-y: visible;
    padding: 24px 22px 30px;
  }

  .ld-auth-brand,
  .ld-auth-back {
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  .ld-auth-form-wrap {
    margin: auto;
  }

  .ld-auth-brand {
    margin-bottom: 34px;
  }

  .ld-auth-brand img,
  .ld-auth-logo {
    height: 28px !important;
    max-width: 120px !important;
  }

  .ld-auth-title {
    font-size: clamp(2.4rem, 11vw, 3.4rem);
  }

  .ld-field-box {
    height: 60px;
  }

  .ld-field-box input {
    height: 100%;
  }

  .ld-submit {
    padding: 20px 24px;
  }

  .ld-modal {
    border-left-width: 3px;
  }
}

@media (max-width: 400px) {
  .ld-auth-form-side {
    padding: 20px 16px 24px;
  }

  .ld-field-box {
    padding: 0 14px;
  }

  .ld-modal-actions {
    flex-direction: column-reverse;
  }

  .ld-modal-actions .ld-btn {
    width: 100%;
  }
}

/* ── Reduced motion safety guard ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ld-auth-marquee-track,
  .ld-auth-visual-grid,
  .ld-caret,
  .ld-success-icon::before,
  .ld-success-icon::after {
    animation: none !important;
  }

  .ld-modal {
    transition: none;
  }
}
