/* Login page (index.php). All motion stops under prefers-reduced-motion. */
:root {
    --bg: #0a1224; --ink: #f4f6fb; --muted: #aab6d0; --line: rgba(170, 186, 220, .24);
    --cyan: #f5a81c; --violet: #fcd34d; --pink: #f59e0b; --indigo: #14213d; --danger: #fda4af;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* Background layers */
.fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.fx-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: transform; }
.fx-glow.a { width: 620px; height: 620px; left: -160px; top: -200px; background: #1e3a6e; animation: drift 18s ease-in-out infinite alternate; }
.fx-glow.b { width: 520px; height: 520px; right: -120px; top: 12%; background: #7e22ce; animation: drift 22s ease-in-out infinite alternate-reverse; }
.fx-glow.c { width: 460px; height: 460px; left: 34%; bottom: -240px; background: #0e7490; opacity: .45; animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(70px, 50px) scale(1.12); } }
.fx-grid { position: absolute; left: -50%; right: -50%; bottom: -8%; height: 56%; background-image: linear-gradient(rgba(129, 140, 248, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(129, 140, 248, .2) 1px, transparent 1px); background-size: 64px 64px; transform: perspective(520px) rotateX(62deg); transform-origin: center top; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); animation: gridMove 7s linear infinite; }
@keyframes gridMove { to { background-position: 0 64px, 0 64px; } }
#fxCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Layout */
.lg { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; max-width: 1440px; margin: 0 auto; }
.lg-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 56px; min-width: 0; }
.lg-form-side { display: flex; align-items: center; justify-content: center; padding: 32px 40px; min-width: 0; }

/* Brand */
.lg-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.lg-brand-mark { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--indigo), #b86e00); box-shadow: 0 0 26px rgba(42, 63, 110, .65); }
.lg-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: #c9d6ec; background: rgba(42, 63, 110, .12); }
.lg-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.lg-hero h1 { font-size: clamp(34px, 4vw, 54px); line-height: 1.08; margin: 0 0 16px; font-weight: 800; letter-spacing: -.03em; max-width: 620px; }
.lg-hero h1 span { background: linear-gradient(90deg, var(--cyan), var(--violet) 50%, var(--pink)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 7s linear infinite; }
@keyframes sheen { to { background-position: -200% center; } }
.lg-hero p { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0 0 36px; max-width: 500px; }

/* Thread joining the workflow steps */
.lg-flow { position: relative; display: flex; justify-content: space-between; max-width: 580px; }
.lg-flow::before { content: ""; position: absolute; left: 24px; right: 24px; top: 23px; border-top: 2px dashed rgba(165, 180, 252, .4); }
.lg-flow::after { content: ""; position: absolute; left: 24px; top: 21px; width: 90px; height: 6px; border-radius: 6px; background: linear-gradient(90deg, transparent, var(--cyan), #fff); box-shadow: 0 0 16px var(--cyan); animation: stitch 5s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes stitch { from { left: 24px; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } to { left: calc(100% - 114px); opacity: 0; } }
.lg-node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: #cbd5ff; }
.lg-node span { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #dce6f5; background: rgba(15, 18, 45, .88); border: 1px solid rgba(165, 180, 252, .4); box-shadow: 0 0 18px rgba(42, 63, 110, .28); }
.lg-foot { font-size: 12.5px; color: #8390b8; }

/* Glass card */
.lg-card { position: relative; width: 100%; max-width: 430px; padding: 34px 32px 26px; border-radius: 24px; background: rgba(13, 16, 42, .72); -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%); box-shadow: 0 30px 80px rgba(2, 4, 20, .7), inset 0 1px 0 rgba(255, 255, 255, .08); }
.lg-card::before { content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; pointer-events: none; background: linear-gradient(140deg, rgba(34, 211, 238, .85), rgba(42, 63, 110, .25) 38%, rgba(232, 121, 249, .8)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.lg-logo { display: inline-flex; padding: 8px 12px; margin-bottom: 18px; background: #fff; border-radius: 12px; }
.lg-logo img { height: 52px; max-width: 100%; width: auto; display: block; }
.lg-logo.is-plain { padding: 0; background: none; border-radius: 0; }
.lg-card h2 { font-size: 26px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.02em; }
.lg-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.lg-alert { display: flex; gap: 10px; align-items: flex-start; background: rgba(225, 29, 72, .16); border: 1px solid rgba(251, 113, 133, .5); color: #ffe4e6; border-radius: 12px; padding: 11px 13px; font-size: 13.5px; margin-bottom: 18px; animation: shake .35s ease; }
.lg-alert svg { flex-shrink: 0; margin-top: 1px; color: var(--danger); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.lg-field { margin-bottom: 15px; }
.lg-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #dbe2ff; }
.lg-input { position: relative; }
.lg-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8c98c4; pointer-events: none; display: flex; transition: color .15s; }
.lg-input input { width: 100%; height: 50px; padding: 0 14px 0 44px; border: 1px solid var(--line); border-radius: 13px; font-size: 15px; font-family: inherit; color: var(--ink); caret-color: var(--cyan); background: rgba(6, 8, 28, .66); transition: border-color .15s, box-shadow .15s; }
.lg-input input::placeholder { color: #7f8bb3; }
.lg-input input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .2), 0 0 22px rgba(34, 211, 238, .2); }
.lg-input:focus-within .lg-ico { color: var(--cyan); }
/* Browsers paint saved logins white, which would hide the light text */
.lg-input input:-webkit-autofill, .lg-input input:-webkit-autofill:hover, .lg-input input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 1000px #0d1730 inset; caret-color: var(--cyan); transition: background-color 9999s; }
.lg-has-error .lg-input input { border-color: rgba(251, 113, 133, .7); }
.lg-input.pass input { padding-right: 52px; }
.toggle-pass { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: none; background: transparent; color: #a3aed0; cursor: pointer; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.toggle-pass:hover { background: rgba(148, 163, 255, .14); color: #fff; }
.toggle-pass:focus-visible, .lg-btn:focus-visible, .lg-check input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.lg-caps { display: none; margin-top: 6px; font-size: 12.5px; color: #fcd34d; font-weight: 600; }
.lg-caps.on { display: block; }

.lg-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin: 2px 0 20px; font-size: 13px; }
.lg-check { display: inline-flex; align-items: center; gap: 8px; color: #cbd5ff; cursor: pointer; user-select: none; }
.lg-check input { width: 16px; height: 16px; accent-color: var(--indigo); }
.lg-help { color: var(--muted); }

.lg-btn { position: relative; overflow: hidden; width: 100%; height: 52px; border: none; border-radius: 13px; background: linear-gradient(100deg, #14213d, #2a3f6e 55%, #e08e00); color: #fff; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; box-shadow: 0 10px 34px rgba(42, 63, 110, .55); display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s, box-shadow .15s, filter .15s; }
.lg-btn::after { content: ""; position: absolute; top: 0; bottom: 0; width: 70px; left: -110px; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .4), transparent); transform: skewX(-20deg); animation: shine 4.5s ease-in-out infinite; }
@keyframes shine { 55%, 100% { left: 110%; } }
.lg-btn:hover { filter: brightness(1.1); box-shadow: 0 14px 42px rgba(42, 63, 110, .75); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn[disabled] { opacity: .85; cursor: wait; }
.lg-spin { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.lg-btn.loading .lg-spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.lg-copy { display: flex; align-items: center; justify-content: center; gap: 6px; color: #8d99c2; font-size: 12px; margin-top: 18px; }

@media (max-width: 991.98px) {
    .lg { grid-template-columns: minmax(0, 1fr); }
    .lg-panel { padding: 24px 20px 0; gap: 20px; }
    .lg-hero h1 { font-size: 30px; }
    .lg-hero p { font-size: 14.5px; margin-bottom: 0; }
    .lg-kicker, .lg-flow, .lg-foot { display: none; }
    .lg-form-side { align-items: flex-start; padding: 22px 16px 36px; }
    .lg-card { max-width: 480px; padding: 26px 20px 20px; }
    .fx-glow { filter: blur(70px); }
}
@media (prefers-reduced-motion: reduce) {
    .fx-glow, .fx-grid, .lg-hero h1 span, .lg-flow::after, .lg-btn::after, .lg-kicker i { animation: none; }
    .lg-flow::after { display: none; }
    .lg-btn::after { display: none; }
}

/* Navy + amber brand */
.fx-glow.a { background: #1e3a8a; }
.fx-glow.b { background: #b86e00; opacity: .3; }
.fx-glow.c { background: #1d4ed8; opacity: .32; }
.fx-grid { background-image: linear-gradient(rgba(170, 186, 220, .17) 1px, transparent 1px), linear-gradient(90deg, rgba(170, 186, 220, .17) 1px, transparent 1px); }
.lg-brand-mark { color: #14213d; background: linear-gradient(135deg, #f5a81c, #e08e00); box-shadow: 0 0 22px rgba(245, 168, 28, .5); }
.lg-kicker { color: #fde9bd; background: rgba(245, 168, 28, .12); }
.lg-hero h1 span { background-image: linear-gradient(90deg, #f5a81c, #fcd34d 50%, #f59e0b); }
.lg-flow::before { border-top-color: rgba(245, 168, 28, .45); }
.lg-flow::after { background: linear-gradient(90deg, transparent, #f5a81c, #fff); box-shadow: 0 0 14px #f5a81c; }
.lg-node span { color: #fde9bd; background: rgba(16, 26, 50, .9); border-color: rgba(245, 168, 28, .38); box-shadow: 0 0 16px rgba(245, 168, 28, .14); }
.lg-node, .lg-field label, .lg-check { color: #dbe3f4; }
.lg-card { background: rgba(16, 26, 50, .8); }
.lg-card::before { background: linear-gradient(140deg, rgba(245, 168, 28, .85), rgba(170, 186, 220, .22) 40%, rgba(245, 168, 28, .55)); }
.lg-input input { background: rgba(8, 14, 32, .66); }
.lg-input input:focus { border-color: #f5a81c; box-shadow: 0 0 0 3px rgba(245, 168, 28, .2), 0 0 20px rgba(245, 168, 28, .18); }
.toggle-pass:hover { background: rgba(170, 186, 220, .14); }
.lg-check input { accent-color: #f5a81c; }
.lg-btn { background: linear-gradient(100deg, #f5a81c, #fbbf3c 55%, #f5a81c); color: #14213d; box-shadow: 0 10px 30px rgba(245, 168, 28, .35); }
.lg-btn:hover { box-shadow: 0 14px 38px rgba(245, 168, 28, .5); }
.lg-btn::after { background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); }
.lg-spin { border-color: rgba(20, 33, 61, .3); border-top-color: #14213d; }
.lg-btn-text, .lg-spin { position: relative; z-index: 1; }
