/* =========================================================================
   AI PM ROADMAP — MODULAR EXTENSIONS STYLESHEET
   FEATURE 01: LIQUID-GLASS 120HZ AUTHENTICATION GATE (LIGHT + DARK + MOBILE)
   ========================================================================= */

:root {
  --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --auth-spring: cubic-bezier(0.22, 1.38, 0.36, 1);
  --auth-card-bg: rgba(255, 255, 255, 0.54);
  --auth-input-bg: rgba(255, 255, 255, 0.62);
  --auth-rim: rgba(255, 255, 255, 0.88);
  --auth-stroke: rgba(17, 17, 17, 0.12);
  --auth-text: #111111;
  --auth-sub: #4B4B52;
  --auth-muted: #71717A;
  --auth-shadow: 0 32px 80px -16px rgba(17, 24, 39, 0.22),
                 0 8px 24px rgba(17, 24, 39, 0.08),
                 inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
                 inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

:root.ix-dark {
  --auth-card-bg: rgba(18, 20, 27, 0.62);
  --auth-input-bg: rgba(12, 14, 20, 0.58);
  --auth-rim: rgba(255, 255, 255, 0.22);
  --auth-stroke: rgba(255, 255, 255, 0.14);
  --auth-text: #F5F4EE;
  --auth-sub: #C8C7C0;
  --auth-muted: #8E8D86;
  --auth-shadow: 0 36px 90px -14px rgba(0, 0, 0, 0.72),
                 0 10px 28px rgba(0, 0, 0, 0.42),
                 inset 0 1px 0 rgba(255, 255, 255, 0.24),
                 inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* BLUR & LOCK UNDERLYING DECK CLEANLY WHILE LOCKED */
html.auth-locked .deck-shell {
  filter: blur(14px) saturate(135%);
  transform: scale(0.985) translateZ(0);
  pointer-events: none !important;
  user-select: none !important;
  transition: filter 0.36s var(--auth-ease), transform 0.36s var(--auth-ease);
}
html:not(.auth-locked) .deck-shell {
  transition: filter 0.36s var(--auth-ease), transform 0.36s var(--auth-ease);
}

/* FULL-VIEWPORT GLASS LOCK OVERLAY */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(at 15% 20%, rgba(230, 57, 0, 0.26) 0px, transparent 52%),
    radial-gradient(at 85% 18%, rgba(29, 78, 216, 0.24) 0px, transparent 54%),
    radial-gradient(at 80% 84%, rgba(15, 118, 110, 0.24) 0px, transparent 54%),
    radial-gradient(at 18% 82%, rgba(147, 51, 234, 0.16) 0px, transparent 50%),
    rgba(240, 238, 231, 0.56);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.34s var(--auth-ease), visibility 0.34s var(--auth-ease);
}

:root.ix-dark .auth-overlay {
  background:
    radial-gradient(at 15% 20%, rgba(230, 57, 0, 0.30) 0px, transparent 54%),
    radial-gradient(at 85% 18%, rgba(37, 99, 235, 0.32) 0px, transparent 54%),
    radial-gradient(at 80% 84%, rgba(15, 118, 110, 0.30) 0px, transparent 54%),
    radial-gradient(at 18% 82%, rgba(124, 58, 237, 0.22) 0px, transparent 52%),
    rgba(8, 9, 14, 0.68);
}

.auth-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ZERO-BLUR FEATHERED AMBIENT ORBS (TRUE 120HZ GPU MOTION) */
.auth-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  contain: strict;
}
.auth-orb-a {
  width: 560px;
  height: 560px;
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.42) 0%, rgba(255, 90, 31, 0.12) 40%, transparent 70%);
  animation: authFloatA 22s ease-in-out infinite alternate;
}
.auth-orb-b {
  width: 600px;
  height: 600px;
  bottom: -180px;
  right: -140px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.38) 0%, rgba(13, 148, 136, 0.12) 42%, transparent 70%);
  animation: authFloatB 26s ease-in-out infinite alternate;
}
@keyframes authFloatA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(70px, 50px, 0) scale(1.1); }
}
@keyframes authFloatB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-75px, -55px, 0) scale(1.08); }
}

/* LIQUID-GLASS LOGIN CARD */
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 28px 28px 24px;
  border-radius: 20px;
  background: var(--auth-card-bg);
  backdrop-filter: blur(34px) saturate(215%) brightness(1.04);
  -webkit-backdrop-filter: blur(34px) saturate(215%) brightness(1.04);
  border: 1px solid var(--auth-rim);
  box-shadow: var(--auth-shadow);
  color: var(--auth-text);
  overflow: hidden;
  contain: layout style paint;
  transform: translate3d(0, 22px, 0) scale(0.95);
  opacity: 0;
  transition: transform 0.42s var(--auth-spring), opacity 0.3s var(--auth-ease), border-color 0.2s ease;
}

.auth-overlay.open .auth-card {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

.auth-overlay.unlocking .auth-card {
  transform: translate3d(0, -18px, 0) scale(1.04);
  opacity: 0;
  transition: transform 0.34s var(--auth-ease), opacity 0.28s var(--auth-ease);
}

/* Fresnel specular top-left glass reflection */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    132deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.08) 32%,
    transparent 58%
  );
}
:root.ix-dark .auth-card::before {
  background: linear-gradient(
    132deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.03) 30%,
    transparent 56%
  );
}

/* Cursor-tracking glass sheen (desktop only via JS) */
.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    260px circle at var(--ax, -300px) var(--ay, -300px),
    rgba(255, 255, 255, 0.26),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.24s ease;
}
:root.ix-dark .auth-card::after {
  background: radial-gradient(
    260px circle at var(--ax, -300px) var(--ay, -300px),
    rgba(255, 122, 77, 0.14),
    transparent 65%
  );
}
.auth-card:hover::after { opacity: 1; }

.auth-card.auth-error-shake {
  border-color: #E63900 !important;
  animation: authShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes authShake {
  15%, 85% { transform: translate3d(-5px, 0, 0); }
  30%, 70% { transform: translate3d(7px, 0, 0); }
  45%, 55% { transform: translate3d(-8px, 0, 0); }
}

/* CARD HEADER */
.auth-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent, #E63900);
}
.auth-theme-btn {
  border: 1px solid var(--auth-stroke);
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.24s var(--auth-spring), border-color 0.16s ease, background 0.16s ease;
}
.auth-theme-btn:hover {
  transform: translate3d(0, -1.5px, 0) scale(1.06);
  border-color: var(--accent, #E63900);
}

.auth-title {
  position: relative;
  z-index: 1;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--auth-text);
}
.auth-sub {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: var(--auth-sub);
  margin-top: 6px;
  margin-bottom: 20px;
  line-height: 1.45;
}

/* FORM FIELDS */
.auth-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.auth-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-sub);
  margin-bottom: 5px;
}
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--auth-stroke);
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.2s ease, transform 0.22s var(--auth-ease), background 0.18s ease;
}
.auth-input:focus {
  border-color: var(--accent, #E63900);
  box-shadow: 0 0 0 3px rgba(230, 57, 0, 0.16);
  transform: translate3d(0, -1px, 0);
}
.auth-input-pw { padding-right: 62px; }

.auth-eye {
  position: absolute;
  right: 8px;
  border: 1px solid var(--auth-stroke);
  background: transparent;
  color: var(--auth-sub);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.22s var(--auth-spring), color 0.15s ease, border-color 0.15s ease;
}
.auth-eye:hover {
  transform: scale(1.07);
  color: var(--auth-text);
  border-color: var(--accent, #E63900);
}

/* REMEMBER TOGGLE & META ROW */
.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--auth-sub);
  cursor: pointer;
  user-select: none;
}
.auth-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent, #E63900);
  cursor: pointer;
}
.auth-deck-stat {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--auth-muted);
}

/* ERROR BANNER */
.auth-msg {
  min-height: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #E63900;
  transition: opacity 0.18s ease;
}
.auth-msg.ok { color: #0F766E; }
:root.ix-dark .auth-msg.ok { color: #5EEAD4; }

/* PRIMARY LIQUID-GLASS SUBMIT BUTTON */
.auth-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 12px 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #E63900 0%, #FF5A1F 100%);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 26px -6px rgba(230, 57, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.26s var(--auth-spring), box-shadow 0.24s ease, filter 0.18s ease;
}
.auth-submit:hover:not(:disabled) {
  transform: translate3d(0, -2.5px, 0) scale(1.02);
  box-shadow: 0 16px 32px -6px rgba(230, 57, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.auth-submit:active:not(:disabled) {
  transform: translate3d(0, 0, 0) scale(0.98);
}
.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.auth-submit.success {
  background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
  box-shadow: 0 12px 26px -6px rgba(15, 118, 110, 0.45);
}

.auth-foot {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--auth-stroke);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--auth-muted);
}

/* MOBILE 120HZ OPTIMIZATIONS */
@media (max-width: 820px) {
  .auth-orb { animation: none !important; opacity: 0.32; }
  .auth-overlay {
    backdrop-filter: blur(14px) saturate(170%);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    padding: 14px;
  }
  .auth-card {
    padding: 22px 18px 18px;
    border-radius: 18px;
    backdrop-filter: blur(20px) saturate(185%);
    -webkit-backdrop-filter: blur(20px) saturate(185%);
  }
  .auth-card::after { display: none; }
  .auth-input { font-size: 16px !important; } /* prevents iOS focus zoom */
  .auth-title { font-size: 21px; }
}


