/* =====================================================================
   Animated login page  (template: templates/admin/login.html)
   The themed scene is painted only inside the card; the page stays plain.
   ===================================================================== */

/* ---------- Page (plain, neutral) ---------- */
.lg-body { overflow-x: hidden; }
.lg-page {
  min-height: 100vh; display: flex; flex-direction: column;
  background-color: #eef2f7;
  background-image: radial-gradient(rgba(100,116,139,.18) 1px, transparent 1px);
  background-size: 22px 22px;
}
html.dark .lg-page {
  background-color: #0b1120;
  background-image: radial-gradient(rgba(148,163,184,.08) 1px, transparent 1px);
}
.lg-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.lg-themeswitch { margin-left: auto; }
.lg-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 16px 56px; perspective: 1200px; }

/* ---------- Card ---------- */
.lg-card {
  /* per-scene accents (overridden below) */
  --a1: #0ea5e9; --a2: #6366f1; --shadow: rgba(14,116,184,.45);
  /* glass + text tokens (light) */
  --glass: rgba(255,255,255,.62); --glass-border: rgba(255,255,255,.75);
  --ink: #0f172a; --muted: #64748b;
  --field-bg: rgba(255,255,255,.72); --field-border: rgba(148,163,184,.45);
  /* pointer-driven values (set by login.js) */
  --rx: 0deg; --ry: 0deg; --px: 0; --py: 0; --gx: 50%; --gy: 0%;

  position: relative; width: 100%; max-width: 440px; min-height: 520px;
  border-radius: 28px; overflow: hidden; isolation: isolate;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .8s ease;
  box-shadow: 0 30px 70px -22px var(--shadow), 0 2px 6px rgba(0,0,0,.08);
  animation: lg-enter .9s cubic-bezier(.2,.8,.2,1) backwards;
}
.lg-card.is-tracking { transition: transform .12s linear, box-shadow .8s ease; }
html.dark .lg-card {
  --glass: rgba(15,23,42,.58); --glass-border: rgba(148,163,184,.22);
  --ink: #e2e8f0; --muted: #94a3b8;
  --field-bg: rgba(2,6,23,.5); --field-border: rgba(148,163,184,.25);
}
@keyframes lg-enter { from { opacity: 0; transform: translateY(30px) rotateX(10deg) scale(.96); } }
.lg-card.shake { animation: lg-shake .5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes lg-shake { 20%,80% { translate: -3px 0; } 40%,60% { translate: 6px 0; } 50% { translate: -6px 0; } }

.lg-card[data-scene="night"]  { --a1: #818cf8; --a2: #c084fc; --shadow: rgba(49,46,129,.6); }
.lg-card[data-scene="sunset"] { --a1: #f97316; --a2: #db2777; --shadow: rgba(219,39,119,.42); }
.lg-card[data-scene="ocean"]  { --a1: #06b6d4; --a2: #0369a1; --shadow: rgba(3,105,161,.45); }
.lg-card[data-scene="aurora"] { --a1: #10b981; --a2: #8b5cf6; --shadow: rgba(16,185,129,.38); }

/* glare that follows the pointer */
.lg-glare {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255,255,255,.28), transparent 45%);
  mix-blend-mode: soft-light;
}
.lg-card.is-tracking .lg-glare { opacity: 1; }

/* ---------- Scene container ---------- */
.lg-scene { position: absolute; inset: 0; z-index: 0; }
.lg-defs { position: absolute; }
.sc { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; overflow: hidden; }
.sc, .sc * { animation-play-state: paused !important; }
.lg-card[data-scene="clouds"] .sc-clouds,
.lg-card[data-scene="night"]  .sc-night,
.lg-card[data-scene="sunset"] .sc-sunset,
.lg-card[data-scene="ocean"]  .sc-ocean,
.lg-card[data-scene="aurora"] .sc-aurora { opacity: 1; }
.lg-card[data-scene="clouds"] .sc-clouds *,
.lg-card[data-scene="night"]  .sc-night *,
.lg-card[data-scene="sunset"] .sc-sunset *,
.lg-card[data-scene="ocean"]  .sc-ocean *,
.lg-card[data-scene="aurora"] .sc-aurora * { animation-play-state: running !important; }

/* parallax layers – deeper numbers move more */
.px { position: absolute; inset: -24px; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.px-1 { transform: translate3d(calc(var(--px) * -4px),  calc(var(--py) * -3px), 0); }
.px-2 { transform: translate3d(calc(var(--px) * -9px),  calc(var(--py) * -6px), 0); }
.px-3 { transform: translate3d(calc(var(--px) * -15px), calc(var(--py) * -9px), 0); }
.px-4 { transform: translate3d(calc(var(--px) * -22px), calc(var(--py) * -12px), 0); }

/* ---------- 1. Clouds ---------- */
.sc-clouds { background: linear-gradient(180deg, #3b9ae6 0%, #74bdf5 38%, #b9e0ff 70%, #e8f5ff 100%); }
.sc-clouds .sun {
  position: absolute; top: 44px; right: 54px; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle, #fffbe6 0 40%, #ffe27a 70%, #ffcf4a 100%);
  box-shadow: 0 0 40px 14px rgba(255,226,122,.55), 0 0 90px 40px rgba(255,255,255,.25);
  animation: lg-pulse 5s ease-in-out infinite;
}
@keyframes lg-pulse { 50% { box-shadow: 0 0 55px 20px rgba(255,226,122,.65), 0 0 110px 50px rgba(255,255,255,.3); } }
.cloud {
  position: absolute; left: 0; fill: #fff; overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(30,90,160,.16));
  animation: lg-drift linear infinite;
}
@keyframes lg-drift { from { transform: translateX(-180px); } to { transform: translateX(520px); } }
.c1 { top: 40px;  width: 90px;  height: 56px; opacity: .85; animation-duration: 46s; animation-delay: -6s; }
.c2 { top: 112px; width: 60px;  height: 38px; opacity: .7;  animation-duration: 60s; animation-delay: -34s; }
.c3 { top: 250px; width: 72px;  height: 45px; opacity: .75; animation-duration: 52s; animation-delay: -20s; }
.c4 { top: 80px;  width: 125px; height: 78px; opacity: .95; animation-duration: 34s; animation-delay: -14s; }
.c5 { top: 330px; width: 110px; height: 68px; opacity: .9;  animation-duration: 38s; animation-delay: -28s; }
.c6 { top: 160px; width: 170px; height: 105px; animation-duration: 28s; animation-delay: -9s; }
.c7 { top: 470px; width: 160px; height: 100px; animation-duration: 26s; animation-delay: -21s; }
.plane {
  position: absolute; top: 26px; left: 0; width: 30px; height: 11px; color: rgba(255,255,255,.95);
  animation: lg-fly 24s linear infinite; animation-delay: -4s;
}
@keyframes lg-fly {
  0% { transform: translate(-60px, 20px) rotate(-6deg); }
  45%, 100% { transform: translate(520px, -16px) rotate(-6deg); }
}

/* ---------- 2. Night ---------- */
.sc-night { background: linear-gradient(180deg, #070b1f 0%, #141c45 45%, #2f2763 80%, #4a2f73 100%); }
.star {
  position: absolute; width: var(--s, 2px); height: var(--s, 2px); border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,.8);
  animation: lg-twinkle var(--d, 3s) ease-in-out infinite; animation-delay: var(--dl, 0s);
}
@keyframes lg-twinkle { 0%,100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
.sc-night .moon {
  position: absolute; top: 50px; right: 58px; width: 62px; height: 62px; border-radius: 50%;
  box-shadow: inset -16px 8px 0 0 #fdf6d8;
  filter: drop-shadow(0 0 14px rgba(253,246,216,.55));
  transform: rotate(-20deg);
  animation: lg-moon 8s ease-in-out infinite;
}
@keyframes lg-moon { 50% { filter: drop-shadow(0 0 24px rgba(253,246,216,.8)); } }
.shoot {
  position: absolute; width: 110px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff);
  transform-origin: right center;
  animation: lg-shoot 7s ease-in infinite;
}
.shoot.s1 { top: 40px; left: 60px; }
.shoot.s2 { top: 120px; left: 180px; animation-delay: 3.6s; animation-duration: 9s; }
@keyframes lg-shoot {
  0%   { opacity: 0; transform: rotate(25deg) translateX(0) scaleX(.3); }
  3%   { opacity: 1; }
  12%  { opacity: 0; transform: rotate(25deg) translateX(220px) scaleX(1); }
  100% { opacity: 0; transform: rotate(25deg) translateX(220px) scaleX(1); }
}
.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 26%; fill: #060a1c; }
.hills.snow { fill: #0d1830; height: 32%; }

/* ---------- 3. Sunset ---------- */
.sc-sunset { background: linear-gradient(180deg, #2b1b4d 0%, #6d2f78 28%, #d9536f 52%, #ff9a5a 70%, #ffd48a 100%); }
.bigsun {
  position: absolute; left: 50%; top: 70px; width: 170px; height: 170px; margin-left: -85px; border-radius: 50%;
  background: linear-gradient(180deg, #fff1a8 0%, #ffc56b 45%, #ff7a59 100%);
  -webkit-mask: linear-gradient(#000 52%, transparent 52% 56%, #000 56% 64%, transparent 64% 68%, #000 68% 75%, transparent 75% 79%, #000 79% 85%, transparent 85% 89%, #000 89%);
          mask: linear-gradient(#000 52%, transparent 52% 56%, #000 56% 64%, transparent 64% 68%, #000 68% 75%, transparent 75% 79%, #000 79% 85%, transparent 85% 89%, #000 89%);
  filter: drop-shadow(0 0 30px rgba(255,170,90,.7));
  animation: lg-sink 14s ease-in-out infinite alternate;
}
@keyframes lg-sink { to { transform: translateY(18px); } }
.mtn { position: absolute; left: 0; bottom: 0; width: 100%; }
.mtn.m1 { height: 66%; fill: #8a3d78; opacity: .75; }
.mtn.m2 { height: 52%; fill: #5a2766; }
.mtn.m3 { height: 38%; fill: #2d1440; }
.birds { position: absolute; inset: 0; }
.bird { position: absolute; left: 0; width: 18px; height: 8px; color: #2d1440; animation: lg-birdfly 30s linear infinite; }
.bird.b1 { top: 70px;  animation-delay: -2s; }
.bird.b2 { top: 84px;  width: 14px; animation-delay: -3.2s; }
.bird.b3 { top: 62px;  width: 12px; animation-delay: -4.1s; }
.bird use { animation: lg-flap .5s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
@keyframes lg-birdfly { from { transform: translate(-40px, 10px); } to { transform: translate(500px, -30px); } }
@keyframes lg-flap { to { transform: scaleY(-.5); } }

/* ---------- 4. Ocean ---------- */
.sc-ocean { background: linear-gradient(180deg, #3aa6e6 0%, #7cccf3 35%, #c9ecfb 62%, #e9f8ff 70%); }
.seasun {
  position: absolute; right: 64px; top: 52px; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, #fffde8 0 45%, #ffe9a6 75%, rgba(255,233,166,0) 100%);
  box-shadow: 0 0 60px 20px rgba(255,248,210,.6);
}
.wave { position: absolute; left: 0; width: 200%; height: 75%; animation: lg-wave linear infinite;
        background: linear-gradient(var(--c) 0 0) 0 39px / 100% 100% no-repeat; }
.wave svg { display: block; width: 100%; height: 40px; fill: var(--c); }
.wave.w1 { --c: #38bdf8; top: 64%; animation-duration: 14s; }
.wave.w2 { --c: #0284c7; top: 72%; animation-duration: 9s; animation-direction: reverse; }
.wave.w3 { --c: #075985; top: 81%; animation-duration: 6.5s; }
.boat { position: absolute; left: 16%; top: calc(72% - 22px); width: 46px; height: 38px; z-index: 0;
        animation: lg-bobboat 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes lg-bobboat { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(5px) rotate(4deg); } }
.gull { position: absolute; top: 40px; left: 0; width: 16px; height: 7px; color: #0c4a6e; animation: lg-birdfly 26s linear infinite; animation-delay: -8s; }
.gull use { animation: lg-flap .6s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
@keyframes lg-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.bubble {
  position: absolute; bottom: -20px; width: var(--s, 8px); height: var(--s, 8px); border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.12);
  animation: lg-bubble var(--d, 9s) ease-in infinite; animation-delay: var(--dl, 0s);
}
@keyframes lg-bubble {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(8px, -80px); }
  90%  { opacity: .8; }
  100% { transform: translate(-6px, -170px); opacity: 0; }
}

/* ---------- 5. Aurora ---------- */
.sc-aurora { background: linear-gradient(180deg, #020617 0%, #071a33 55%, #0b2b4a 100%); }
.ribbon {
  position: absolute; left: -25%; width: 150%; height: 120px; border-radius: 50%;
  filter: blur(22px); mix-blend-mode: screen; opacity: .85;
  animation: lg-sway 11s ease-in-out infinite alternate;
}
.ribbon.r1 { top: 40px;  background: linear-gradient(90deg, transparent, rgba(52,211,153,.85), rgba(34,211,238,.6), transparent); }
.ribbon.r2 { top: 110px; background: linear-gradient(90deg, transparent, rgba(167,139,250,.7), rgba(52,211,153,.6), transparent); animation-duration: 14s; animation-delay: -4s; }
.ribbon.r3 { top: 190px; height: 90px; background: linear-gradient(90deg, transparent, rgba(34,211,238,.55), rgba(236,72,153,.45), transparent); animation-duration: 17s; animation-delay: -8s; }
@keyframes lg-sway {
  0%   { transform: translateX(-8%) skewX(-18deg) scaleY(.75) rotate(-4deg); }
  50%  { transform: translateX(4%)  skewX(10deg)  scaleY(1.25) rotate(3deg); }
  100% { transform: translateX(10%) skewX(-6deg)  scaleY(.9) rotate(-2deg); }
}

/* ---------- Content ---------- */
.lg-content { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 520px; }
.lg-head { display: flex; align-items: center; gap: 14px; padding: 30px 28px 26px; color: #fff; }
.lg-logo {
  flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
  animation: lg-bob 5s ease-in-out infinite;
}
.lg-logo .material-symbols-outlined { font-size: 28px; }
@keyframes lg-bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
/* sign-in: the Arvalyx logo (white version) on the scene, a soft shadow keeps it crisp on bright skies */
.lg-head-brand { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 34px; }
.lg-brand { margin: 0; line-height: 0; padding: 10px 16px 10px 12px; border-radius: 16px;
  background: rgba(11,31,58,.58); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 10px 26px -10px rgba(4,12,28,.55), inset 0 1px 0 rgba(255,255,255,.14); }
.lg-brand img { height: 48px; width: auto; max-width: 240px; display: block; }
/* agency copies: "Powered by Arvalyx" inside the card, under the theme dots, on a small dark glass chip
   (same treatment as the logo at the top) so the white logo stays readable on every scene, light or dark */
.lg-powered { display: flex; align-items: center; gap: 7px; align-self: center; margin: 0 0 18px;
  padding: 5px 11px 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: .02em; color: rgba(255,255,255,.88);
  background: rgba(11,31,58,.5); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lg-powered img { height: 14px; width: auto; display: block; }
.lg-themes:has(+ .lg-powered) { padding-bottom: 12px; }
.lg-hello { margin: 0; font-size: 13px; font-weight: 500; opacity: .92; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.lg-title { margin: 2px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; text-shadow: 0 2px 12px rgba(0,0,0,.35); }

.lg-glass {
  margin: 0 20px; padding: 24px 22px 20px; border-radius: 22px;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--ink);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.35);
  animation: lg-rise .9s .15s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes lg-rise { from { opacity: 0; transform: translateY(24px); } }

.lg-alert {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 10px 12px; border-radius: 12px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #b91c1c; font-size: 13px; line-height: 1.45;
}
html.dark .lg-alert { color: #fecaca; background: rgba(239,68,68,.16); }
.lg-alert p { margin: 0; }
.lg-alert .material-symbols-outlined { font-size: 20px; }

/* fields with floating labels */
.lg-field {
  --mx: 0px; --my: 0px; --near: 0; --sx: 50%; --sy: 50%;
  position: relative; margin-bottom: 14px; border-radius: 14px; overflow: hidden;
  background: var(--field-bg); border: 1.5px solid var(--field-border);
  transform: translate3d(var(--mx), var(--my), 0) scale(calc(1 + var(--near) * .015));
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s;
  box-shadow: 0 calc(var(--near) * 10px) calc(var(--near) * 24px) -10px var(--shadow);
}
.lg-field.is-near { transition: transform .12s ease-out, border-color .25s, box-shadow .25s; }
.lg-field:focus-within { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 22%, transparent); }
.lg-field.has-error { border-color: #ef4444; }
.lg-field input {
  position: relative; z-index: 1; display: block; width: 100%; height: 56px;
  padding: 20px 46px 4px 46px; border: 0; outline: 0; background: transparent;
  color: var(--ink); font-size: 15px; font-family: inherit;
}
.lg-field input:-webkit-autofill { -webkit-text-fill-color: var(--ink); transition: background-color 9999s 0s; }
.lg-field label {
  position: absolute; z-index: 1; left: 46px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
  transition: top .2s ease, font-size .2s ease, color .2s ease;
}
.lg-field input:focus + label,
.lg-field input:not(:placeholder-shown) + label,
.lg-field input:-webkit-autofill + label {
  top: 17px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--a1);
}
.lg-ico {
  position: absolute; z-index: 1; left: 14px; top: 50%; translate: 0 -50%; font-size: 21px; color: var(--muted);
  transition: color .25s, transform .3s cubic-bezier(.2,.8,.2,1);
  transform: rotate(calc(var(--near) * -12deg)) scale(calc(1 + var(--near) * .12));
}
.lg-field:focus-within .lg-ico, .lg-field.is-near .lg-ico { color: var(--a1); }
.lg-spot {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: var(--near);
  background: radial-gradient(160px circle at var(--sx) var(--sy), color-mix(in srgb, var(--a1) 22%, transparent), transparent 70%);
  transition: opacity .3s;
}
.lg-eye {
  position: absolute; z-index: 2; right: 8px; top: 50%; translate: 0 -50%;
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
}
.lg-eye:hover { color: var(--a1); background: color-mix(in srgb, var(--a1) 12%, transparent); }
.lg-eye .material-symbols-outlined { font-size: 20px; }
.lg-err { margin: -8px 0 12px 4px; font-size: 12px; color: #ef4444; }
.lg-caps { display: flex; align-items: center; gap: 6px; margin: -6px 0 12px 4px; font-size: 12px; color: #d97706; }
.lg-caps[hidden] { display: none; }
.lg-caps .material-symbols-outlined { font-size: 16px; }

/* submit */
.lg-submit {
  --mx: 0px; --my: 0px; --near: 0;
  position: relative; overflow: hidden; width: 100%; height: 50px; margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; cursor: pointer; color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .01em;
  background: linear-gradient(120deg, var(--a1), var(--a2), var(--a1)); background-size: 200% 100%;
  box-shadow: 0 12px 26px -10px var(--shadow);
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), background-position .6s ease, box-shadow .3s;
}
.lg-submit.is-near { transition: transform .12s ease-out, background-position .6s ease, box-shadow .3s; }
.lg-submit:hover { background-position: 100% 0; box-shadow: 0 16px 32px -10px var(--shadow); }
.lg-submit:active { transform: translate3d(var(--mx), var(--my), 0) scale(.98); }
.lg-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--a1) 45%, transparent); outline-offset: 2px; }
.lg-submit::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg); animation: lg-shine 4.5s ease-in-out infinite;
}
@keyframes lg-shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.lg-arrow { font-size: 20px; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.lg-submit:hover .lg-arrow { transform: translateX(5px); }
.lg-spinner {
  display: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: lg-spin .7s linear infinite;
}
.lg-submit.loading { pointer-events: none; }
.lg-submit.loading .lg-submit-text, .lg-submit.loading .lg-arrow { display: none; }
.lg-submit.loading .lg-spinner { display: block; }
@keyframes lg-spin { to { transform: rotate(360deg); } }

.lg-forgot { display: block; margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.lg-forgot:hover { color: var(--a1); }

/* theme picker */
.lg-themes { margin-top: auto; display: flex; justify-content: center; gap: 10px; padding: 18px 0 20px; }
.lg-dot {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.lg-dot:hover { transform: translateY(-2px) scale(1.12); }
.lg-dot.on { transform: scale(1.22); box-shadow: 0 0 0 3px rgba(255,255,255,.45), 0 4px 12px rgba(0,0,0,.3); }
.lg-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.lg-dot[data-scene="clouds"] { background: linear-gradient(160deg, #3b9ae6, #e8f5ff); }
.lg-dot[data-scene="night"]  { background: linear-gradient(160deg, #070b1f, #4a2f73); }
.lg-dot[data-scene="sunset"] { background: linear-gradient(160deg, #6d2f78, #ff9a5a); }
.lg-dot[data-scene="ocean"]  { background: linear-gradient(160deg, #8fd6f7 0 40%, #0369a1 41%); }
.lg-dot[data-scene="aurora"] { background: linear-gradient(160deg, #34d399, #8b5cf6 60%, #020617); }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .lg-stage { padding: 0 12px 32px; }
  .lg-card, .lg-content { min-height: 500px; }
  .lg-card { border-radius: 24px; }
  .lg-head { padding: 24px 22px 22px; }
  .lg-title { font-size: 21px; }
  .lg-brand img { height: 34px; }
  .lg-glass { margin: 0 14px; padding: 20px 16px 16px; }
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  .lg-card, .lg-card *, .lg-card *::before { animation: none !important; transition: none !important; }
  .lg-card { transform: none !important; }
}

/* =====================================================================
   Two-factor code page (templates/two_factor/verify.html)
   ===================================================================== */

/* minimal reset: this page doesn't load Unfold's stylesheet */
.lg-standalone, .lg-standalone *, .lg-standalone *::before, .lg-standalone *::after { box-sizing: border-box; }
body.lg-standalone { margin: 0; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 14px; color: #0f172a; -webkit-font-smoothing: antialiased; }
.lg-standalone p, .lg-standalone h1, .lg-standalone form { margin: 0; }
.lg-standalone button, .lg-standalone input { font: inherit; }
.lg-standalone a { text-decoration: none; }
:where(.lg-standalone) .material-symbols-outlined {
  font-family: 'Material Symbols Outlined'; font-weight: 400; font-style: normal; font-size: 18px; line-height: 1;
  display: inline-block; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal;
  direction: ltr; font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
}

button.lg-back { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.lg-standalone .lg-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; color: rgb(var(--color-primary-600, 8 145 178)); }
html.dark .lg-standalone .lg-back { color: rgb(var(--color-primary-500, 6 182 212)); }
.lg-standalone .lg-back:hover { text-decoration: underline; }

.lg-text { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.lg-note {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 10px 12px; border-radius: 12px;
  background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); color: #047857; font-size: 13px; line-height: 1.45;
}
html.dark .lg-note { color: #a7f3d0; }
.lg-note p { margin: 0; }
.lg-note .material-symbols-outlined { font-size: 20px; }

/* six digit boxes */
.lg-otp {
  --mx: 0px; --my: 0px; --near: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 4px repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.lg-otp.is-near { transition: transform .12s ease-out; }
.lg-otp[hidden], [data-otp-text][hidden], .lg-link[hidden] { display: none; }
.lg-otp-box:nth-child(4) { grid-column: 5; }  /* small gap between the two groups of three */
.lg-otp-box {
  width: 100%; min-width: 0; height: 58px; padding: 0; text-align: center;
  font-size: 24px; font-weight: 700; color: var(--ink); caret-color: var(--a1);
  background: var(--field-bg); border: 1.5px solid var(--field-border); border-radius: 13px; outline: 0;
  transition: border-color .2s, box-shadow .2s, transform .25s cubic-bezier(.2,.8,.2,1);
  /* boxes nearer the cursor lift a little more (set by --near on the group) */
  box-shadow: 0 calc(var(--near) * 8px) calc(var(--near) * 18px) -10px var(--shadow);
}
.lg-otp-box:focus { border-color: var(--a1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a1) 22%, transparent); transform: translateY(-3px); }
.lg-otp-box.filled { border-color: color-mix(in srgb, var(--a1) 65%, var(--field-border)); animation: lg-pop .28s cubic-bezier(.2,.8,.2,1); }
@keyframes lg-pop { 50% { transform: translateY(-3px) scale(1.1); } }
.lg-otp.bad .lg-otp-box { border-color: #ef4444; }

.lg-link {
  display: block; margin: 16px auto 0; padding: 4px 8px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 13px; text-decoration: underline dotted; text-underline-offset: 3px;
}
.lg-link:hover { color: var(--a1); }

@media (max-width: 400px) {
  .lg-otp { gap: 6px; }
  .lg-otp-box { height: 50px; font-size: 20px; }
}

/* ---------- 2FA: setup / backup codes / My security ---------- */
.lg-standalone .lg-glass b { color: var(--ink); }
a.lg-submit { text-decoration: none; }
.lg-link { text-align: center; }

/* numbered steps */
.lg-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.lg-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.lg-step-n {
  flex: none; width: 24px; height: 24px; margin-top: -1px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2));
  box-shadow: 0 4px 10px -4px var(--shadow);
}

/* QR code with a scanning line */
.lg-qr {
  position: relative; width: 184px; margin: 4px auto 14px; padding: 10px; border-radius: 18px; background: #fff; overflow: hidden;
  box-shadow: 0 14px 30px -12px var(--shadow), 0 0 0 4px color-mix(in srgb, var(--a1) 28%, transparent);
  animation: lg-pop-in .6s .3s cubic-bezier(.2,.8,.2,1) backwards;
}
.lg-qr img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.lg-qr-scan {
  position: absolute; left: 8px; right: 8px; top: 10px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--a1), transparent); box-shadow: 0 0 12px var(--a1);
  animation: lg-scan 2.6s ease-in-out infinite alternate;
}
@keyframes lg-scan { to { top: calc(100% - 13px); } }
@keyframes lg-pop-in { from { opacity: 0; transform: scale(.9) rotate(-3deg); } }

/* secret key */
.lg-key {
  display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 6px 6px 12px; border-radius: 12px;
  background: var(--field-bg); border: 1.5px dashed var(--field-border);
}
.lg-key-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lg-key code { flex: 1; min-width: 0; font: 600 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; color: var(--ink); word-break: break-all; }
.lg-iconbtn {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: color .2s, background .2s;
}
.lg-iconbtn:hover { color: var(--a1); background: color-mix(in srgb, var(--a1) 12%, transparent); }
.lg-iconbtn.done { color: #10b981; }

/* backup codes */
.lg-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.lg-codes code {
  display: block; padding: 11px 6px; text-align: center; border-radius: 11px;
  font: 600 15px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; color: var(--ink);
  background: var(--field-bg); border: 1px solid var(--field-border);
  animation: lg-code-in .45s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(.35s + var(--i, 0) * .07s);
}
@keyframes lg-code-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }

/* secondary buttons */
.lg-row { display: flex; gap: 8px; margin-bottom: 14px; }
.lg-row > * { flex: 1; }
.lg-btn2 {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 14px;
  border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink);
  background: var(--field-bg); border: 1.5px solid var(--field-border);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.lg-btn2:hover { color: var(--a1); border-color: var(--a1); transform: translateY(-1px); }
.lg-btn2.done { color: #10b981; border-color: #10b981; }
.lg-btn2 .material-symbols-outlined { font-size: 19px; }
.lg-btn2.wide { width: 100%; margin-top: 10px; }
.lg-btn2.danger { color: #ef4444; border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.07); }
.lg-btn2.danger:hover { color: #dc2626; border-color: #ef4444; background: rgba(239,68,68,.14); }
.lg-btn2 .lg-spinner { border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; }
.lg-btn2.loading { pointer-events: none; }
.lg-btn2.loading > :not(.lg-spinner) { display: none; }
.lg-btn2.loading .lg-spinner { display: block; }

/* on / off status */
.lg-status { display: flex; gap: 12px; align-items: center; padding: 14px; margin-bottom: 16px; border-radius: 16px; }
.lg-status.on  { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); }
.lg-status.off { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.4); }
.lg-status-ico {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff;
}
.lg-status-ico .material-symbols-outlined { font-size: 25px; }
.lg-status.on  .lg-status-ico { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 18px -8px rgba(16,185,129,.9); }
.lg-status.off .lg-status-ico { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 8px 18px -8px rgba(245,158,11,.9); }
.lg-status-ico::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid currentColor; opacity: 0;
  animation: lg-ring 2.4s ease-out infinite;
}
.lg-status.on  .lg-status-ico::after { color: #10b981; }
.lg-status.off .lg-status-ico::after { color: #f59e0b; }
@keyframes lg-ring { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
.lg-status b { display: block; font-size: 16px; }
.lg-status p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* backup codes left meter */
.lg-meter { margin: 0 0 18px; }
.lg-meter-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.lg-meter-bar { height: 8px; border-radius: 99px; overflow: hidden; background: var(--field-bg); border: 1px solid var(--field-border); }
.lg-meter-bar span {
  display: block; height: 100%; width: var(--w); border-radius: inherit;
  background: linear-gradient(90deg, var(--a1), var(--a2)); animation: lg-grow 1s .35s cubic-bezier(.2,.8,.2,1) backwards;
}
@keyframes lg-grow { from { width: 0; } }
.lg-meter.low .lg-meter-bar span { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.lg-meter-warn { margin: 6px 0 0; font-size: 12px; color: #d97706; }

@media (prefers-reduced-motion: reduce) {
  .lg-qr-scan { display: none; }
}
