/* The login page: a moving background of garment pattern pieces (templates/login.html), as a
   faint watermark: outlines only. A shirt (front, back, yoke, sleeve, collar, pocket), a hood,
   a frock, a kurta, a saree blouse, a skirt, a trouser leg, buttons, scissors and a tape measure
   on a cutting mat, in the app's indigo with a warm tape colour. They draw
   themselves in, then float slowly; the dashed seam lines move like a cutting line. Nothing here
   can be clicked, and with "reduce motion" on everything stands still. */

.login-page {
  --lb-ink: 79, 70, 229;          /* the app's indigo (dashboard --accent) */
  --lb-slate: 71, 85, 105;
  background: #f1f5f9;
  overflow-x: hidden;
}

/* ── the background layers ─────────────────────────────────────────────────── */
.login-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(var(--lb-ink), .10), transparent 60%),
    radial-gradient(900px 600px at 90% 90%, rgba(14, 165, 233, .10), transparent 60%),
    linear-gradient(160deg, #f8fafc 0%, #eef2ff 55%, #f1f5f9 100%);
}

/* soft lights moving slowly behind everything */
.lb-glow {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .4;
  animation: lb-glow 26s ease-in-out infinite alternate;
}
.lb-glow.g1 { width: 420px; height: 420px; left: -80px; top: 20%; background: rgba(var(--lb-ink), .22); }
.lb-glow.g2 { width: 380px; height: 380px; right: -60px; top: -60px; background: rgba(139, 92, 246, .18); animation-duration: 32s; }
.lb-glow.g3 { width: 360px; height: 360px; right: 18%; bottom: -120px; background: rgba(14, 165, 233, .16); animation-duration: 38s; }

/* the cutting mat: fine and bold grid lines, drifting slowly */
.lb-grid {
  position: absolute; inset: -120px;
  background-image:
    linear-gradient(rgba(var(--lb-ink), .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--lb-ink), .055) 1px, transparent 1px),
    linear-gradient(rgba(var(--lb-ink), .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--lb-ink), .035) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  animation: lb-grid 60s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
}

/* ── the pattern pieces ───────────────────────────────────────────────────── */
.lb-piece {
  position: absolute;
  width: var(--w, 200px); height: auto;
  animation: lb-float var(--t, 22s) ease-in-out var(--d, 0s) infinite;
  transform-origin: center;
  will-change: transform;
}
.lb-piece .cut {                 /* the cut line: drawn in once, then stays (no fill: a watermark) */
  fill: none;
  stroke: rgba(var(--lb-ink), .3); stroke-width: 1.3; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: lb-draw 2.6s cubic-bezier(.45, .05, .25, 1) var(--d0, .2s) forwards;
}
.lb-piece .seam {                /* the seam allowance: a dashed line that keeps moving */
  fill: none;
  stroke: rgba(var(--lb-ink), .2); stroke-width: 1; stroke-dasharray: 6 5;
  animation: lb-march 3.5s linear infinite;
}
.lb-piece .mark {                /* grainline, notches, button marks */
  fill: none; stroke: rgba(var(--lb-slate), .28); stroke-width: 1; stroke-linecap: round;
}
.lb-piece .dot { fill: none; stroke: rgba(var(--lb-ink), .28); stroke-width: 1; }   /* buttons */
.lb-piece text {
  font: 600 9px/1 Poppins, system-ui, sans-serif; letter-spacing: .12em;
  fill: rgba(var(--lb-ink), .32);
}

/* where each piece floats (around the card, not under it) */
.lb-front  { --w: clamp(140px, 14vw, 230px); left: 4%;  top: 10%; --t: 24s; --r: -6deg; }
.lb-collar { --w: clamp(130px, 13vw, 210px); left: 27%; top: 3%; --t: 22s; --d: -3s; --r: -4deg; --d0: 1.1s; }
.lb-sleeve { --w: clamp(130px, 13vw, 210px); left: 13%; bottom: 4%; --t: 26s; --d: -12s; --r: 8deg; --d0: .8s; }
.lb-tape   { --w: clamp(320px, 34vw, 560px); left: -4%; bottom: 30%; --t: 30s; --d: -15s; --r: -14deg; --d0: .3s; }
.lb-frock  { --w: clamp(120px, 12vw, 190px); right: 21%; top: 3%; --t: 27s; --d: -8s; --r: 6deg; --d0: .6s; }
.lb-back   { --w: clamp(140px, 14vw, 230px); right: 4%; top: 8%;  --t: 28s; --d: -6s; --r: 5deg; --d0: .5s; }
.lb-kurta  { --w: clamp(110px, 11vw, 170px); right: 9%; bottom: 3%; --t: 25s; --d: -14s; --r: -5deg; --d0: 1s; }
.lb-blouse  { --w: clamp(120px, 12vw, 180px); left: 43%; top: 2%; --t: 23s; --d: -5s; --r: 3deg; --d0: .9s; }
.lb-skirt   { --w: clamp(130px, 13vw, 200px); left: 37%; bottom: -3%; --t: 26s; --d: -10s; --r: -3deg; --d0: 1.2s; }
.lb-pants   { --w: clamp(100px, 9vw, 140px); right: 21%; top: 36%; --t: 29s; --d: -4s; --r: 4deg; --d0: 1.4s; }
.lb-pocket  { --w: clamp(70px, 6vw, 95px); left: 25%; top: 44%; --t: 21s; --d: -7s; --r: -8deg; --d0: 1.6s; }
.lb-hood    { --w: clamp(110px, 10vw, 160px); left: -1%; bottom: 3%; --t: 27s; --d: -13s; --r: 6deg; --d0: 1.5s; }
.lb-scissors { --w: clamp(170px, 15vw, 240px); right: 2%; top: 46%; --t: 24s; --d: -2s; --r: -6deg; --d0: 1.8s; }
.lb-yoke     { --w: clamp(140px, 13vw, 210px); right: 25%; bottom: 5%; --t: 25s; --d: -11s; --r: 5deg; --d0: 1.7s; }
.lb-buttons  { --w: clamp(90px, 8vw, 120px); left: 6%; top: 50%; --t: 22s; --d: -6s; --r: -10deg; --d0: 1.9s; }
.lb-tape .tape { fill: none; stroke: rgba(217, 119, 6, .32); stroke-width: 1.1; }
.lb-tape .tick { stroke: rgba(180, 83, 9, .28); stroke-width: 1; }
.lb-tape text { fill: rgba(180, 83, 9, .38); font-size: 8px; letter-spacing: 0; }

/* the login card over it: clear and a little glassy */
.login-card {
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .25), 0 0 0 1px rgba(var(--lb-ink), .06);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Remember me, under the password */
.login-remember { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.login-remember input {
  width: 18px; height: 18px; margin: 0; flex-shrink: 0;
  accent-color: rgb(var(--lb-ink)); cursor: pointer;
}
.login-remember input:focus-visible { outline: 2px solid rgba(var(--lb-ink), .5); outline-offset: 2px; }
.login-remember-title { font-size: 14px; font-weight: 500; color: #334155; }

/* phones and small windows: fewer, fainter pieces (the card is most of the screen) */
@media (max-width: 760px) {
  .lb-back, .lb-collar, .lb-kurta, .lb-sleeve, .lb-blouse, .lb-skirt, .lb-pants, .lb-pocket,
  .lb-hood, .lb-scissors, .lb-yoke, .lb-buttons { display: none; }
  .lb-front  { left: -10%; top: 4%; }
  .lb-frock  { right: -8%; top: auto; bottom: 3%; }
  .lb-tape   { bottom: 8%; left: -30%; }
  .lb-piece  { opacity: .7; }
}

/* ── movement ──────────────────────────────────────────────────────────────── */
@keyframes lb-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--r, 0deg)); }
  50%      { transform: translate3d(12px, -18px, 0) rotate(calc(var(--r, 0deg) + 3deg)); }
}
@keyframes lb-draw  { to { stroke-dashoffset: 0; } }
@keyframes lb-march { to { stroke-dashoffset: -22; } }
@keyframes lb-grid  { to { background-position: 120px 120px, 120px 120px, 24px 24px, 24px 24px; } }
@keyframes lb-glow  {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(60px, 40px, 0) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg *, .login-bg { animation: none !important; }
  .lb-piece .cut { stroke-dashoffset: 0; }
}
