/* ============================================================
 * TrenovaCodes — Glassy Login (v3)
 * Modern slate + blue (Theme Lab default accent).
 * Cool aurora, frosted-glass card, light pill inputs, pill CTA.
 * Pure CSS. No CDN, no Tailwind dependency.
 * ============================================================ */

:root {
  --lg-blue: #2563eb;
  --lg-blue-deep: #1d4ed8;
  --lg-cyan: #06b6d4;
  --lg-slate: #0f172a;
  --lg-ink: #020617;
  --lg-text: #f1f5f9;
  --lg-muted: #94a3b8;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.lg-body {
  margin: 0;
  min-height: 100vh;
  color: var(--lg-text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  padding: 28px 18px;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 38%, #0c4a6e 62%, #0f172a 100%);
  background-size: 320% 320%;
  animation: lg-bg-pan 20s ease-in-out infinite alternate;
}
@keyframes lg-bg-pan {
  from { background-position: 0% 35%; }
  to   { background-position: 100% 65%; }
}

/* ---------- flowing aurora blobs ---------- */
.lg-orbs { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.lg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .8; will-change: transform; }
.lg-orb-a {
  width: 680px; height: 680px; left: -6%; top: -14%;
  background: radial-gradient(circle, rgba(37,99,235,.7), transparent 70%);
  animation: lg-drift-a 26s ease-in-out infinite alternate;
}
.lg-orb-b {
  width: 760px; height: 760px; right: -8%; bottom: -18%;
  background: radial-gradient(circle, rgba(6,182,212,.55), transparent 70%);
  animation: lg-drift-b 32s ease-in-out infinite alternate;
}
.lg-orb-c {
  width: 520px; height: 520px; left: 56%; top: 22%;
  background: radial-gradient(circle, rgba(59,130,246,.45), transparent 70%);
  animation: lg-drift-c 38s ease-in-out infinite alternate;
}
.lg-orb-d {
  width: 600px; height: 600px; left: 18%; bottom: -22%;
  background: radial-gradient(circle, rgba(14,165,233,.5), transparent 70%);
  animation: lg-drift-d 44s ease-in-out infinite alternate;
}
@keyframes lg-drift-a { from { transform: translate(0,0) scale(1); } to { transform: translate(130px,90px) scale(1.15); } }
@keyframes lg-drift-b { from { transform: translate(0,0) scale(1.08); } to { transform: translate(-120px,-100px) scale(.94); } }
@keyframes lg-drift-c { from { transform: translate(0,0) scale(1); } to { transform: translate(-110px,90px) scale(1.2); } }
@keyframes lg-drift-d { from { transform: translate(0,0) scale(.95); } to { transform: translate(100px,-80px) scale(1.12); } }

.lg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 30%, transparent 75%);
}

.lg-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 50%, rgba(2,6,23,.65) 100%);
}

/* ---------- brand mark ---------- */
.lg-brand {
  position: fixed; top: 30px; left: 34px; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  animation: lg-fade-in .9s ease both;
}
.lg-brand-badge {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--lg-blue), var(--lg-cyan));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 0 26px rgba(37,99,235,.45);
}
.lg-brand-name { font-size: 19px; font-weight: 700; letter-spacing: .04em; color: #fff; }
.lg-brand-name em { font-style: normal; color: #7dd3fc; }

/* ---------- frosted-glass card ---------- */
.lg-wrap { position: relative; z-index: 2; width: 100%; max-width: 432px; animation: lg-rise .8s cubic-bezier(.22,.9,.28,1.05) both; }

.lg-card {
  position: relative;
  padding: 42px 38px 34px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(30,41,59,.72), rgba(15,23,42,.78) 60%, rgba(30,41,59,.7));
  border: 1px solid rgba(148,163,184,.22);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  box-shadow:
    0 30px 70px -18px rgba(0,0,0,.65),
    0 0 70px -18px rgba(37,99,235,.28),
    0 0 100px -30px rgba(6,182,212,.2),
    inset 0 1px 0 rgba(255,255,255,.18);
  animation: lg-float 7s ease-in-out 1s infinite;
}
@keyframes lg-rise {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lg-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* glowing blue edge that travels around the card */
@property --lg-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.lg-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 23px; padding: 1.5px;
  background: conic-gradient(from var(--lg-angle),
    transparent 0deg, transparent 120deg,
    rgba(37,99,235,.85) 160deg, transparent 200deg,
    transparent 300deg, rgba(6,182,212,.85) 340deg, transparent 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: lg-edge-spin 8s linear infinite;
  opacity: .7; pointer-events: none;
}
@keyframes lg-edge-spin { to { --lg-angle: 360deg; } }

/* soft top sheen inside card */
.lg-card::after {
  content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  pointer-events: none;
}

/* ---------- headings / messages ---------- */
.lg-head { margin-bottom: 30px; }
.lg-msgrow { min-height: 22px; }
.lg-title {
  margin: 0 0 6px; font-size: 31px; font-weight: 800; color: #fff; letter-spacing: -.01em;
  text-shadow: 0 2px 24px rgba(37,99,235,.3);
}
.lg-sub { margin: 0; font-size: 13.5px; color: var(--lg-muted); min-height: 20px; }

.lg-msg { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }
.lg-msg svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.lg-msg-error { color: #fda4af; animation: lg-shake .45s cubic-bezier(.36,.07,.19,.97) both; }
.lg-msg-ok { color: #6ee7b7; }
@keyframes lg-shake {
  10%, 90% { transform: translate3d(-1px,0,0); }
  20%, 80% { transform: translate3d(2px,0,0); }
  30%, 50%, 70% { transform: translate3d(-4px,0,0); }
  40%, 60% { transform: translate3d(4px,0,0); }
}

/* ---------- form fields ---------- */
.lg-field { margin-bottom: 20px; }
.lg-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #7dd3fc; margin-bottom: 9px;
}
.lg-input {
  width: 100%; padding: 14px 16px; font-size: 15px; color: #fff;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 13px;
  transition: border-color .25s, box-shadow .25s, background .25s, transform .15s;
}
.lg-input::placeholder { color: #64748b; }
.lg-input:focus {
  outline: none; background: rgba(255,255,255,.1);
  border-color: rgba(37,99,235,.8);
  box-shadow: 0 0 0 3px rgba(37,99,235,.2), 0 0 26px rgba(6,182,212,.18);
}
.lg-input-light {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px;
  color: #0f172a;
  box-shadow: 0 6px 20px -8px rgba(0,0,0,.45), inset 0 1px 0 #fff;
}
.lg-input-light::placeholder { color: #94a3b8; }
.lg-input-light:focus {
  background: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.22), 0 0 28px rgba(37,99,235,.28), inset 0 1px 0 #fff;
}
.lg-input-light:-webkit-autofill {
  -webkit-text-fill-color: #0f172a;
  -webkit-box-shadow: 0 0 0 80px #f8fafc inset;
  caret-color: #0f172a;
  transition: background-color 9999s ease-in-out 0s;
}
.lg-input-wrap { position: relative; }
.lg-input-wrap .lg-input-light { padding-left: 46px; padding-right: 18px; }
.lg-input-wrap.has-eye .lg-input-light { padding-right: 46px; }
.lg-input-icon {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  display: flex; padding: 7px; color: #94a3b8; pointer-events: none;
}
.lg-input-icon svg { width: 17px; height: 17px; }
.lg-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 7px;
  color: #94a3b8; border-radius: 50%; display: flex;
  transition: color .2s, background .2s;
}
.lg-eye:hover { color: var(--lg-blue); background: rgba(37,99,235,.1); }
.lg-eye svg { width: 17px; height: 17px; }

.lg-row-between { display: flex; align-items: center; justify-content: flex-end; margin: 4px 0 22px; }
.lg-link {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 13.5px; font-weight: 600; color: #7dd3fc; text-decoration: none;
  transition: color .2s;
}
.lg-link:hover { color: #fff; }

/* ---------- pill CTA (blue → cyan) ---------- */
.lg-btn {
  position: relative; overflow: hidden;
  width: 100%; padding: 15px; border: none; border-radius: 999px; cursor: pointer;
  font-size: 15.5px; font-weight: 800; letter-spacing: .03em; color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.2);
  background: linear-gradient(135deg, var(--lg-blue) 0%, var(--lg-cyan) 100%);
  box-shadow: 0 12px 34px -8px rgba(37,99,235,.55), 0 4px 16px -4px rgba(6,182,212,.4);
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), box-shadow .25s, filter .2s;
  animation: lg-btn-glow 3.2s ease-in-out infinite;
}
@keyframes lg-btn-glow {
  0%, 100% { box-shadow: 0 12px 34px -8px rgba(37,99,235,.55), 0 4px 16px -4px rgba(6,182,212,.4); }
  50%      { box-shadow: 0 12px 48px -6px rgba(37,99,235,.75), 0 4px 26px -4px rgba(6,182,212,.55); }
}
.lg-btn:hover { transform: translateY(-2px); filter: brightness(1.07); animation-play-state: paused;
  box-shadow: 0 18px 44px -8px rgba(37,99,235,.6), 0 6px 20px -4px rgba(6,182,212,.5); }
.lg-btn:active { transform: translateY(0) scale(.99); }
.lg-btn::after {
  content: ""; position: absolute; top: 0; left: -90%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-20deg); transition: left .65s ease;
}
.lg-btn:hover::after { left: 140%; }
.lg-btn:disabled { opacity: .85; cursor: not-allowed; transform: none; }

.lg-spin {
  display: inline-block; width: 18px; height: 18px; margin-right: 9px; vertical-align: -3px;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%;
  animation: lg-rotate .7s linear infinite;
}
@keyframes lg-rotate { to { transform: rotate(360deg); } }
@keyframes lg-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- step 2: 2FA ---------- */
.lg-step-icon {
  width: 68px; height: 68px; margin: 0 auto 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #7dd3fc;
  background: rgba(37,99,235,.12);
  border: 1px solid rgba(37,99,235,.4);
  box-shadow: 0 0 30px rgba(37,99,235,.25), inset 0 0 18px rgba(37,99,235,.08);
}
.lg-step-icon svg { width: 30px; height: 30px; }
.lg-code {
  letter-spacing: .45em; text-indent: .45em; text-align: center;
  font-size: 30px; font-weight: 700; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.lg-center { text-align: center; }
.lg-cancel { display: block; text-align: center; margin-top: 18px; font-size: 12.5px; color: #94a3b8; text-decoration: none; transition: color .2s; }
.lg-cancel:hover { color: #fff; }

/* ---------- step 3: branch select ---------- */
.lg-branch {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; cursor: pointer; padding: 16px 18px; margin-bottom: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(148,163,184,.18); border-radius: 16px; color: inherit;
  transition: transform .2s, border-color .25s, background .25s, box-shadow .25s;
}
.lg-branch:hover { transform: translateY(-2px); background: rgba(255,255,255,.1); box-shadow: 0 10px 26px -10px rgba(0,0,0,.55); }
.lg-branch-live { border-color: rgba(52,211,153,.4); }
.lg-branch-live:hover { border-color: rgba(52,211,153,.8); box-shadow: 0 0 24px -6px rgba(52,211,153,.35); }
.lg-branch-test { border-color: rgba(56,189,248,.45); }
.lg-branch-test:hover { border-color: rgba(56,189,248,.85); box-shadow: 0 0 24px -6px rgba(56,189,248,.4); }
.lg-branch-off { opacity: .45; cursor: not-allowed; border-color: rgba(248,113,113,.4); }
.lg-branch-off:hover { transform: none; }
.lg-branch-name { font-weight: 700; font-size: 15px; color: #fff; display: flex; align-items: center; gap: 9px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lg-dot-live { background: #34d399; box-shadow: 0 0 10px #34d399; }
.lg-dot-test { background: #38bdf8; box-shadow: 0 0 10px #38bdf8; }
.lg-dot-off { background: #f87171; box-shadow: 0 0 10px #f87171; }
.lg-branch-env { font-size: 12px; margin-top: 4px; color: var(--lg-muted); }
.lg-branch-live .lg-branch-env { color: #6ee7b7; }
.lg-branch-test .lg-branch-env { color: #7dd3fc; }
.lg-branch-off .lg-branch-env { color: #fca5a5; }
.lg-branch-arrow { color: #94a3b8; display: flex; transition: transform .2s, color .2s; }
.lg-branch:hover .lg-branch-arrow { transform: translateX(4px); color: #7dd3fc; }
.lg-branch-arrow svg { width: 20px; height: 20px; }

.lg-branch-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 0; gap: 22px; animation: lg-fade-in .3s ease both; }
.lg-loader-ring { position: relative; width: 84px; height: 84px; }
.lg-loader-ring svg.ring { width: 84px; height: 84px; color: #7dd3fc; animation: lg-rotate 1s linear infinite; }
.lg-loader-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.lg-loader-badge span {
  width: 34px; height: 34px; border-radius: 10px; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--lg-blue), var(--lg-cyan));
  display: flex; align-items: center; justify-content: center;
}
.lg-loading-title { color: #fff; font-weight: 700; font-size: 17px; margin: 0; }
.lg-loading-sub { color: var(--lg-muted); font-size: 13px; margin: 4px 0 0; }
.lg-typing-dots { display: flex; gap: 7px; }
.lg-typing-dots i { width: 8px; height: 8px; border-radius: 50%; background: #7dd3fc; animation: lg-bounce 1.1s ease-in-out infinite; }
.lg-typing-dots i:nth-child(2) { animation-delay: .15s; }
.lg-typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes lg-bounce { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-7px); opacity: 1; } }

/* ---------- attendance challenge ---------- */
.lg-challenge-icon {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fcd34d; background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.35);
  box-shadow: 0 0 30px rgba(251,191,36,.2);
}
.lg-challenge-icon svg { width: 30px; height: 30px; }
.lg-challenge-title { color: #fff; font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.lg-challenge-text { font-size: 13.5px; color: var(--lg-muted); margin: 0 0 22px; line-height: 1.6; }
.lg-btn-amber {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 10px 32px -8px rgba(251,146,60,.55);
  color: #1a1005; text-shadow: none;
}
.lg-btn-amber:hover { box-shadow: 0 16px 40px -8px rgba(251,146,60,.65); }
.lg-attendance-note { display: flex; align-items: center; justify-content: center; gap: 8px; color: #fcd34d; font-size: 13.5px; margin-bottom: 14px; }

/* ---------- footer ---------- */
.lg-foot { margin: 26px 0 0; text-align: center; font-size: 12.5px; color: #64748b; animation: lg-fade-in 1.2s ease both; }

/* ---------- reset modal ---------- */
.lg-modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(2,6,23,.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: lg-fade-in .3s ease both;
}
.lg-modal {
  position: relative; width: 100%; max-width: 400px; padding: 32px 30px; border-radius: 20px; overflow: hidden;
  background: linear-gradient(165deg, rgba(30,41,59,.95), rgba(15,23,42,.97));
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 30px 70px -18px rgba(0,0,0,.75), 0 0 50px -12px rgba(37,99,235,.35);
  animation: lg-rise .45s cubic-bezier(.22,.9,.28,1.05) both;
}
.lg-modal::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--lg-blue), var(--lg-cyan), var(--lg-blue));
}
.lg-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.lg-modal-title { margin: 0; font-size: 19px; font-weight: 800; color: #fff; }
.lg-modal-x { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 6px; border-radius: 8px; display: flex; transition: color .2s, background .2s; }
.lg-modal-x:hover { color: #fff; background: rgba(255,255,255,.08); }
.lg-modal-x svg { width: 18px; height: 18px; }
.lg-modal .lg-field { margin-bottom: 16px; }
.lg-modal .lg-btn { padding: 13px; font-size: 14.5px; }
.lg-alert {
  display: flex; align-items: center; gap: 9px; padding: 12px 14px; margin-bottom: 16px;
  border-radius: 11px; font-size: 13px; font-weight: 600;
  background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.35); color: #fda4af;
}
.lg-alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.lg-modal-text { font-size: 13.5px; color: var(--lg-muted); margin: 0 0 14px; line-height: 1.6; }
.lg-modal-text b, .lg-modal-text .hl { color: #fff; font-weight: 700; }
.lg-modal-text .ok { color: #6ee7b7; font-weight: 600; }
.lg-resend { display: block; margin: 12px auto 0; background: none; border: none; cursor: pointer;
  font-size: 12.5px; color: #94a3b8; text-decoration: underline; transition: color .2s; }
.lg-resend:hover:not(:disabled) { color: #fff; }
.lg-resend:disabled { opacity: .45; cursor: not-allowed; text-decoration: none; }
.lg-step2-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #7dd3fc;
  background: rgba(37,99,235,.12); border: 1px solid rgba(37,99,235,.35);
}
.lg-step2-icon svg { width: 24px; height: 24px; }

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  .lg-card { padding: 34px 24px 28px; border-radius: 20px; }
  .lg-title { font-size: 27px; }
  .lg-brand { top: 20px; left: 20px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body.lg-body, .lg-orbs span, .lg-card::before, .lg-card, .lg-btn { animation: none; }
  .lg-wrap, .lg-brand, .lg-foot { animation: lg-fade-in .3s ease both; }
}
