/* Sign in and lock screen (views/login.php, views/lockscreen.php, mockup/login.html).
   Always dark glass and gold, whatever theme the person picked inside the system
   (partials/head_brand.php with force_dark).
   The canvases are drawn by dist/js/auth.js. Kept apart from the admin CSS so these pages
   load fast. */

:root {
    --ax-bg: #030712;
    --ax-text: #f8fafc;
    --ax-muted: #94a3b8;
    --ax-gold: #d4af37;
    --ax-gold-2: #b8860b;
    --ax-gold-hi: #fcd34d;
    --ax-cyan: #22d3ee;
    --ax-glass: rgba(15, 23, 42, .74);
    --ax-glass-line: rgba(255, 255, 255, .12);
    --ax-input: rgba(30, 41, 59, .7);
    --ax-input-line: rgba(255, 255, 255, .15);
    --ax-input-focus: rgba(15, 23, 42, .95);
    --ax-tab-bg: rgba(15, 23, 42, .8);
    --ax-tab-line: rgba(51, 65, 85, .6);
    --ax-veil: radial-gradient(circle at center, rgba(3, 7, 18, .55) 0%, rgba(3, 7, 18, .9) 100%);
    --ax-bad: #f87171;
    --ax-good: #34d399;
    --ax-shadow: 0 30px 90px -15px rgba(0, 0, 0, .8), 0 0 50px 0 rgba(212, 175, 55, .15), inset 0 1px 0 0 rgba(255, 255, 255, .18);
    --ax-orb-1: rgba(245, 158, 11, .15);
    --ax-orb-2: rgba(6, 182, 212, .1);
    --ax-sans: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ax-head: "Syne", "Inter", "Segoe UI", Roboto, sans-serif;
    --ax-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.ax-page { margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: var(--ax-bg); color: var(--ax-text); font: 14px/1.5 var(--ax-sans); -webkit-font-smoothing: antialiased; }
.ax-page [hidden] { display: none !important; }
.ax-page a { color: inherit; }

/* ---- background layers (bottom to top) ---- */
.ax-wall, .ax-fluid, .ax-veil, .ax-rain { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.ax-wall { z-index: 0; }
.has-wp .ax-wall { background: #0b1220 var(--ax-wp) no-repeat; background-position: var(--ax-wp-pos, center); background-size: cover; }
.ax-fluid { z-index: 1; opacity: 1; transition: opacity .8s; }
/* a wallpaper keeps the fluid colours as a soft tint, stronger as the wallpaper is darkened */
.has-wp .ax-fluid { mix-blend-mode: soft-light; opacity: .45; }
.no-gl .ax-fluid { display: none; }
.no-gl:not(.has-wp) .ax-wall { background: radial-gradient(ellipse at 20% 30%, rgba(212, 175, 55, .35), transparent 55%), radial-gradient(ellipse at 80% 70%, rgba(0, 153, 230, .35), transparent 55%), radial-gradient(ellipse at 60% 20%, rgba(204, 26, 128, .25), transparent 50%), #070b16; }
.ax-veil { z-index: 2; background: var(--ax-veil); }
/* always dark enough for the falling characters; the wallpaper panel's darkness can only add to it */
.has-wp .ax-veil { background: radial-gradient(circle at center, rgba(3, 7, 18, max(.55, calc(var(--ax-wp-dim, .5) * .8))) 0%, rgba(3, 7, 18, max(.78, calc(var(--ax-wp-dim, .5) + .15))) 100%); }
.ax-orb { position: fixed; z-index: 2; width: 560px; height: 560px; border-radius: 50%; filter: blur(140px); pointer-events: none; animation: axGlow 8s ease-in-out infinite; }
.ax-orb.is-1 { top: 25%; left: 25%; transform: translate(-50%, -50%); background: var(--ax-orb-1); }
.ax-orb.is-2 { bottom: 25%; right: 33%; transform: translate(33%, 33%); background: var(--ax-orb-2); animation-delay: -4s; }
@keyframes axGlow { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
.ax-rain { z-index: 3; }


/* ---- layout ---- */
/* wide screens: OPENXUL and the card as one pair in the middle, the title hugging the card */
.ax-main { position: relative; z-index: 10; display: grid; grid-template-columns: auto 440px; justify-content: center; align-items: center; column-gap: clamp(48px, 5vw, 64px); width: 100%; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 40px 24px; }

/* ---- left: OPENXUL cipher ---- */
.ax-hero { display: flex; flex-direction: column; align-items: flex-end; text-align: right; user-select: none; }
.ax-cipher { font: 800 clamp(64px, 8vw, 112px)/1 var(--ax-mono); letter-spacing: -.02em; white-space: nowrap; }
.ax-cipher > span { display: inline-block; -webkit-background-clip: text; background-clip: text; color: transparent; }
/* OPEN: the gold as before; XUL: crimson to deep wine, top to bottom, with a soft red halo */
.ax-c-open { background-image: linear-gradient(90deg, #fde68a, #fbbf24 88%, #f8b419); filter: drop-shadow(0 0 24px rgba(212, 175, 55, .45)); }
.ax-c-xul { background-image: linear-gradient(180deg, #dc2626 0%, #b91c1c 45%, #991b1b 70%, #7f1d1d 100%); filter: drop-shadow(0 0 18px rgba(220, 38, 38, .35)) drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }

/* ---- card ---- */
.ax-card-w { display: flex; justify-content: flex-start; perspective: 1200px; }
.ax-card { width: 100%; max-width: 440px; transform-style: preserve-3d; transition: transform .25s ease-out; will-change: transform; }
.ax-card-in { position: relative; overflow: hidden; padding: 34px 36px 22px; border: 1px solid var(--ax-glass-line); border-radius: 26px; background: var(--ax-glass); box-shadow: var(--ax-shadow); backdrop-filter: blur(28px) saturate(200%); -webkit-backdrop-filter: blur(28px) saturate(200%); }
/* a light sweep across the glass that follows the tilt */
.ax-card-in::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at var(--ax-gx, 30%) var(--ax-gy, 0%), rgba(255, 255, 255, .12), transparent 45%); pointer-events: none; }
.ax-card.is-shake { animation: axShake .45s; }
@keyframes axShake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
.ax-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--ax-text); text-decoration: none; }
.ax-logo { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 5px; border: 1px solid rgba(212, 175, 55, .45); border-radius: 18px; background: rgba(255, 255, 255, .95); box-shadow: 0 0 24px rgba(212, 175, 55, .25); overflow: hidden; }
.ax-logo img { width: 100%; height: 100%; object-fit: contain; }
.ax-logo b { color: #0f172a; font: 800 22px/1 var(--ax-head); }
.ax-logo.is-photo { padding: 0; border-radius: 50%; }
.ax-logo.is-photo img { object-fit: cover; }
.ax-brand-t { display: flex; flex-direction: column; min-width: 0; }
.ax-brand h1 { display: -webkit-box; margin: 0; overflow: hidden; font: 700 19px/1.25 var(--ax-sans); letter-spacing: -.01em; overflow-wrap: anywhere; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ax-brand-t > span { margin-top: 2px; color: var(--ax-muted); font-size: 12px; font-weight: 500; }

/* role switch */
.ax-roles { display: flex; gap: 4px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--ax-tab-line); border-radius: 16px; background: var(--ax-tab-bg); }
.ax-role { flex: 1; margin: 0; }
.ax-role input { position: absolute; opacity: 0; pointer-events: none; }
.ax-role span { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 10px; border: 1px solid transparent; border-radius: 12px; color: var(--ax-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .25s ease; }
.ax-role span:hover { color: var(--ax-text); }
.ax-role input:checked + span { border-color: rgba(212, 175, 55, .4); background: rgba(212, 175, 55, .2); color: var(--ax-gold-hi); font-weight: 700; box-shadow: 0 0 15px rgba(212, 175, 55, .2); }
.ax-role input:focus-visible + span { outline: 2px solid var(--ax-gold); outline-offset: 2px; }

/* floating-label fields */
.ax-form { margin: 0; }
.ax-in { position: relative; margin-bottom: 14px; }
.ax-in input { width: 100%; height: 54px; padding: 22px 46px 8px 16px; border: 1px solid var(--ax-input-line); border-radius: 14px; background: var(--ax-input); color: var(--ax-text); font: 500 14.5px/1.2 var(--ax-sans); transition: all .25s cubic-bezier(.16, 1, .3, 1); -webkit-appearance: none; appearance: none; }
.ax-in input:focus { outline: none; border-color: rgba(212, 175, 55, .9); background: var(--ax-input-focus); box-shadow: 0 0 20px rgba(212, 175, 55, .3), 0 0 2px rgba(212, 175, 55, .8); }
.ax-in input:-webkit-autofill { -webkit-text-fill-color: var(--ax-text); -webkit-box-shadow: 0 0 0 40px var(--ax-input-focus) inset; caret-color: var(--ax-text); }
.ax-in label { position: absolute; left: 17px; top: 17px; color: var(--ax-muted); font: 600 11.5px/1.2 var(--ax-mono); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; transform-origin: left top; transition: all .25s cubic-bezier(.16, 1, .3, 1); }
.ax-in input:focus ~ label, .ax-in input:not(:placeholder-shown) ~ label, .ax-in input:-webkit-autofill ~ label { transform: translateY(-9px) scale(.82); color: var(--ax-gold); font-weight: 700; }
.ax-in.is-bad input { border-color: var(--ax-bad); box-shadow: 0 0 0 3px rgba(248, 113, 113, .2); }
.ax-in-ic { position: absolute; right: 17px; top: 19px; color: var(--ax-muted); font-size: 15px; pointer-events: none; }
.ax-eye { position: absolute; right: 8px; top: 9px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--ax-muted); font-size: 15px; cursor: pointer; }
.ax-eye:hover, .ax-eye:focus-visible { color: var(--ax-text); background: rgba(148, 163, 184, .15); outline: none; }
.ax-caps { margin: -6px 0 12px 4px; color: #fbbf24; font-size: 12px; font-weight: 600; }
.ax-note { margin: 0 0 16px; color: var(--ax-muted); font-size: 13px; }
.ax-note .fa { color: var(--ax-gold); margin-right: 4px; }

.ax-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 16px; font-size: 12.5px; }
.ax-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ax-muted); font-weight: 500; cursor: pointer; }
.ax-check:hover { color: var(--ax-text); }
.ax-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ax-gold); }
.ax-link { padding: 0; border: 0; background: none; color: #fbbf24; font: 600 12.5px var(--ax-sans); cursor: pointer; text-underline-offset: 3px; }
.ax-link:hover, .ax-link:focus-visible { text-decoration: underline; outline: none; }
.ax-forgot { margin: -4px 0 16px; padding: 12px 14px; border: 1px solid rgba(212, 175, 55, .3); border-radius: 14px; background: rgba(212, 175, 55, .08); font-size: 12.5px; animation: axIn .25s ease-out; }
.ax-forgot p { margin: 0; color: var(--ax-text); }
.ax-contacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ax-contacts a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--ax-input-line); border-radius: 999px; background: var(--ax-input); text-decoration: none; font-weight: 600; }
.ax-contacts a:hover { border-color: var(--ax-gold); }
.ax-contacts .fa { color: var(--ax-gold); }
@keyframes axIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* gold button with the shine sweep */
.ax-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 52px; overflow: hidden; border: 0; border-radius: 14px; background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%); color: #0d0f17; font: 800 14px/1 var(--ax-head); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; box-shadow: 0 0 25px rgba(212, 175, 55, .4); transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s; }
.ax-btn::before { content: ""; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, .6) 50%, transparent 100%); transform: rotate(30deg) translateY(-100%); transition: transform .6s ease; }
.ax-btn:hover::before { transform: rotate(30deg) translateY(100%); }
.ax-btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 35px rgba(212, 175, 55, .7); color: #000; }
.ax-btn:focus-visible { outline: 3px solid rgba(252, 211, 77, .6); outline-offset: 3px; }
.ax-btn:disabled { cursor: progress; transform: none; opacity: .85; }
.ax-btn .fa-spin, .ax-btn .ax-spin { animation: axSpin 1s linear infinite; }
@keyframes axSpin { to { transform: rotate(360deg); } }
.ax-progress { height: 3px; margin-top: 12px; overflow: hidden; border-radius: 3px; background: rgba(148, 163, 184, .15); opacity: 0; transition: opacity .2s; }
.ax-progress.is-on { opacity: 1; }
.ax-progress i { display: block; width: 0; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #fcd34d, #d4af37); box-shadow: 0 0 10px rgba(212, 175, 55, .6); transition: width .3s ease; }
.ax-progress.is-bad i { background: var(--ax-bad); box-shadow: none; }
.ax-progress.is-ok i { background: var(--ax-good); }
.ax-msg { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border: 1px solid rgba(248, 113, 113, .35); border-radius: 12px; background: rgba(248, 113, 113, .1); color: var(--ax-bad); font-size: 13px; font-weight: 600; animation: axIn .2s ease-out; }
.ax-msg.is-ok { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .1); color: var(--ax-good); }
.ax-msg.is-info { border-color: rgba(212, 175, 55, .35); background: rgba(212, 175, 55, .1); color: var(--ax-gold-hi); }
.ax-msg .fa { margin-top: 2px; }
.ax-alt { margin: 16px 0 0; color: var(--ax-muted); font-size: 12.5px; text-align: center; }
.ax-alt a { color: #fbbf24; font-weight: 700; text-underline-offset: 3px; }
.ax-foot { display: flex; justify-content: center; margin-top: 20px; color: var(--ax-muted); }
.ax-foot .ox-powered { display: inline-flex; align-items: center; gap: 6px; font: 600 10px/16px var(--ax-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.ax-foot .ox-mark { height: 14px; width: auto; }

/* ---- smaller screens ---- */
@media (max-width: 1023px) {
    .ax-main { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0; padding: 72px 16px 28px; }
    .ax-hero { display: none; }
    .ax-card-w { justify-content: center; width: 100%; }
    .ax-orb { width: 340px; height: 340px; filter: blur(100px); }
}
@media (max-width: 480px) {
    .ax-card-in { padding: 26px 20px 18px; border-radius: 22px; }
    .ax-brand h1 { font-size: 17px; }
    .ax-logo { width: 50px; height: 50px; border-radius: 14px; }
    .has-wp .ax-wall { background-image: var(--ax-wp-m, var(--ax-wp)); }
}
@media (max-width: 900px) {
    .has-wp .ax-wall { background-image: var(--ax-wp-m, var(--ax-wp)); }
}

/* ---- calmer motion ---- */
@media (prefers-reduced-motion: reduce) {
    .ax-orb { animation: none; }
    .ax-card, .ax-btn, .ax-btn::before { transition: none; }
    .ax-card.is-shake { animation: none; }
    .ax-forgot, .ax-msg { animation: none; }
}

/* Cloudflare Turnstile above Sign in / Unlock (views/partials/turnstile.php) */
.ax-ts { display: flex; justify-content: center; min-height: 65px; margin: 4px 0 14px; }
.ax-ts iframe { max-width: 100%; }
