/* ============================================================
   auth-v3.css — sign-in pages (client login, forgot / reset password, admin login).
   Replaces each page's inline dark styling. A deep-blue brand panel (1.png) beside the form
   card. Light only, like the portal and admin (dark mode and its toggle were removed 2026-11).
   Form markup, field names, CSRF, reCAPTCHA and scripts are unchanged.
   Logical properties so dir="rtl" mirrors.
   ============================================================ */
html[data-theme="light"] {
    --a-page: #f4f6fa; --a-sheet: #ffffff; --a-raised: #f8fafc; --a-line: #e2e8f0; --a-line-strong: #cbd5e1;
    --a-text: #0f172a; --a-body: #334155; --a-muted: #475569; --a-accent: #1d4ed8;
    --a-err-bg: #fee2e2; --a-err-ink: #7f1d1d; --a-ok-bg: #dcfce7; --a-ok-ink: #14532d; --a-info-bg: #e0f2fe; --a-info-ink: #0c4a6e;
    color-scheme: light;
}

html, body.fk-auth { margin: 0; }
body.fk-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 5fr) minmax(0, 7fr); background: var(--a-page) !important; color: var(--a-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body.fk-auth *, body.fk-auth *::before, body.fk-auth *::after { box-sizing: border-box; }
body.fk-auth #currencyRain, body.fk-auth .rain-veil, body.fk-auth .fk-aurora { display: none !important; }

/* ---------- Brand panel ---------- */
.auth-brand { background: #1e40af; color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 100vh; position: sticky; top: 0; }
.auth-brand-logo { display: inline-block; line-height: 0; }
.auth-brand-logo img { height: 40px; width: auto; }
.auth-brand h2 { margin: 0; font-size: clamp(32px, 3vw, 44px); line-height: 1.08; font-weight: 800; letter-spacing: -.025em; color: #fff; max-width: 16ch; }
.auth-brand p { margin: 16px 0 0; font-size: 18px; line-height: 1.5; color: #dbe6ff; max-width: 36ch; }
.auth-brand small { font-size: 13px; color: #c9d7ff; }

/* ---------- Form side ---------- */
body.fk-auth .login-wrapper { grid-column: 2; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 96px 24px 40px; background: transparent !important; position: relative; overflow: visible; }
body.fk-auth .login-card { width: min(420px, 100%); background: var(--a-sheet); border: 1px solid var(--a-line); border-radius: 14px; box-shadow: none !important; overflow: visible; }
body.fk-auth .login-header { background: transparent !important; padding: 28px 28px 0; text-align: start; color: var(--a-text); }
body.fk-auth .login-header .login-logo, body.fk-auth .login-header .logo-icon { display: none; }
body.fk-auth .login-header h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; color: var(--a-text); font-family: inherit; }
body.fk-auth .login-header p { margin: 6px 0 0; font-size: 15px; color: var(--a-muted); }
body.fk-auth .login-body { padding: 20px 28px 28px; }
body.fk-auth .form-group { margin-bottom: 16px; }
body.fk-auth .form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--a-text); letter-spacing: 0; text-transform: none; }
body.fk-auth .input-wrapper { position: relative; }
body.fk-auth .input-wrapper .input-icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--a-muted); font-size: 14px; pointer-events: none; left: auto; right: auto; }
body.fk-auth .form-control { width: 100%; height: 46px; padding-block: 0; padding-inline: 40px 44px; border: 1px solid var(--a-line-strong) !important; border-radius: 8px !important; background: var(--a-sheet) !important; color: var(--a-text) !important; font-weight: 500; font-size: 15px; font-family: inherit; box-shadow: none; outline: none; transition: border-color .15s, box-shadow .15s; }
body.fk-auth .form-control::placeholder { color: var(--a-muted); opacity: .8; }
body.fk-auth .form-control:focus { border-color: #2563eb !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18) !important; }
body.fk-auth .toggle-password { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; color: var(--a-muted); cursor: pointer; border-radius: 6px; padding: 0; left: auto; right: auto; }
[dir="ltr"] body.fk-auth .toggle-password { right: 6px; } [dir="rtl"] body.fk-auth .toggle-password { left: 6px; }
[dir="ltr"] body.fk-auth .input-wrapper .input-icon { left: 14px; } [dir="rtl"] body.fk-auth .input-wrapper .input-icon { right: 14px; }
body.fk-auth .toggle-password:hover { color: var(--a-text); background: var(--a-raised); }
body.fk-auth .toggle-password svg { width: 18px; height: 18px; display: block; }
body.fk-auth .toggle-password svg.eye-slash { display: none; }
body.fk-auth .toggle-password.active svg.eye { display: none; }
body.fk-auth .toggle-password.active svg.eye-slash { display: block; }
body.fk-auth .btn, body.fk-auth .login-card .btn, body.fk-auth .login-card .btn-primary { width: 100%; height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 8px; background: #2563eb !important; color: #fff !important; font-weight: 600; font-size: 15px; font-family: inherit; cursor: pointer; box-shadow: none !important; transform: none; margin-top: 4px; text-decoration: none; }
body.fk-auth .btn:hover { background: #1d4ed8 !important; }
body.fk-auth .btn:disabled { opacity: .7; cursor: progress; }

/* messages */
body.fk-auth .error, body.fk-auth .success, body.fk-auth .notice, body.fk-auth .info-text { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.45; margin-bottom: 16px; border: 0; }
body.fk-auth .error { background: var(--a-err-bg); color: var(--a-err-ink); }
body.fk-auth .success { background: var(--a-ok-bg); color: var(--a-ok-ink); }
body.fk-auth .notice, body.fk-auth .info-text { background: var(--a-info-bg); color: var(--a-info-ink); }
body.fk-auth .error i, body.fk-auth .success i, body.fk-auth .notice i, body.fk-auth .info-text i { margin-top: 2px; }

/* reset-password: strength meter + rules */
body.fk-auth .password-requirements { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--a-line); border-radius: 8px; background: var(--a-raised); }
body.fk-auth .password-requirements h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--a-text); display: flex; gap: 8px; align-items: center; letter-spacing: 0; text-transform: none; }
body.fk-auth .password-requirements h4 i { color: var(--a-accent); }
body.fk-auth .password-requirements ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
body.fk-auth .password-requirements li { font-size: 13px; color: var(--a-muted); display: flex; gap: 8px; align-items: center; }
body.fk-auth .password-requirements li i { font-size: 12px; color: var(--a-muted); }
body.fk-auth .password-requirements li.valid { color: var(--a-text); }
body.fk-auth .password-requirements li.valid i { color: #16a34a; }

body.fk-auth .strength-bar { height: 6px; border-radius: 3px; background: var(--a-line); overflow: hidden; margin-top: 8px; }
body.fk-auth .strength-bar-fill { height: 100%; width: 0; border-radius: 3px; transition: width .3s ease, background-color .3s ease; }
body.fk-auth .strength-weak { background: #dc2626; width: 33%; }
body.fk-auth .strength-medium { background: #d97706; width: 66%; }
body.fk-auth .strength-strong { background: #16a34a; width: 100%; }

/* footers and links */
body.fk-auth .login-footer, body.fk-auth .footer-text { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--a-line); text-align: center; font-size: 14px; color: var(--a-muted); }
body.fk-auth .login-footer p { margin: 0; }
body.fk-auth .login-footer a, body.fk-auth .footer-text a, body.fk-auth .back-link { color: var(--a-accent); text-decoration: none; font-weight: 500; }
body.fk-auth .login-footer a:hover, body.fk-auth .footer-text a:hover, body.fk-auth .back-link:hover { text-decoration: underline; }
body.fk-auth .back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 14px; }
[dir="rtl"] body.fk-auth .back-link i, [dir="rtl"] body.fk-auth .back-arrow { transform: scaleX(-1); display: inline-block; }
body.fk-auth .recaptcha-notice { font-size: 12px; color: var(--a-muted); text-align: center; margin: 14px 0 0; line-height: 1.6; }
body.fk-auth .recaptcha-notice a { color: var(--a-accent); }
body.fk-auth .grecaptcha-badge { visibility: hidden; }
body.fk-auth .login-credit { margin-top: 14px; text-align: center; font-size: 13px; color: var(--a-muted); }
body.fk-auth .login-credit strong { font-family: 'Montserrat', sans-serif; font-weight: 700; color: var(--a-text); }

/* top-right: language + theme */
body.fk-auth .login-lang, body.fk-auth .auth-tools { position: fixed; top: 16px; inset-inline-end: 16px; left: auto; right: auto; z-index: 20; display: flex; align-items: center; gap: 8px; }
[dir="ltr"] body.fk-auth .login-lang, [dir="ltr"] body.fk-auth .auth-tools { right: 16px; } [dir="rtl"] body.fk-auth .login-lang, [dir="rtl"] body.fk-auth .auth-tools { left: 16px; }
html[data-theme="light"] body.fk-auth .lang-dropdown-btn { color: #334155; background: #fff; border-color: #e2e8f0; }
html[data-theme="light"] body.fk-auth .lang-dropdown-menu { background: #fff; border-color: #e2e8f0; }
html[data-theme="light"] body.fk-auth .lang-dropdown-menu a { color: #1e293b; }
html[data-theme="light"] body.fk-auth .lang-dropdown-menu a:hover, html[data-theme="light"] body.fk-auth .lang-dropdown-menu a.active { background: #f1f5f9; }

@media (prefers-reduced-motion: reduce) { body.fk-auth .form-control, body.fk-auth .strength-bar-fill { transition: none; } }

/* ---------- Phone: brand becomes a slim bar on top ---------- */
@media (max-width: 860px) {
    body.fk-auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-brand { position: static; min-height: 0; padding: 16px 20px; flex-direction: row; align-items: center; }
    .auth-brand-copy, .auth-brand small { display: none; }
    .auth-brand-logo img { height: 30px; }
    body.fk-auth .login-wrapper { grid-column: 1; min-height: 0; justify-content: flex-start; padding: 28px 16px 32px; }
    body.fk-auth .login-lang, body.fk-auth .auth-tools { position: absolute; top: 12px; }
    body.fk-auth .login-header { padding: 22px 20px 0; }
    body.fk-auth .login-body { padding: 18px 20px 22px; }
}

/* The language menu opens towards the page, never off-screen (RTL put it past the left edge) */
body.fk-auth { overflow-x: clip; }
body.fk-auth .login-lang .lang-dropdown-menu { inset-inline-end: 0; inset-inline-start: auto; }
[dir="ltr"] body.fk-auth .login-lang .lang-dropdown-menu { right: 0; left: auto; }
[dir="rtl"] body.fk-auth .login-lang .lang-dropdown-menu { left: 0; right: auto; transform-origin: top left; }

/* No underlines on links or buttons (hover/focus included); links read by colour and weight instead */
a, a:hover, a:focus, a:active, a:visited { text-decoration: none !important; }

/* ---------- Page transition (ported from FAKTUUR 2.6.2 auth-v5.css; script: assets/js/auth-motion.js) ----------
   The curtain is a fixed blue layer that normally covers exactly the brand panel (same colour, so it is
   invisible). Leaving: the form fields slide out away from it and blur, top first, the brand text blurs, and
   the curtain grows over the whole screen. Arriving: it starts full and pulls back to the brand panel while
   the fields come in. Phones and reduced motion: no curtain, the page just loads. */
body.fk-auth { --au-side: max(340px, 41.667vw); --au-out: 1; }
[dir="rtl"] body.fk-auth { --au-out: -1; }
.au-curtain { position: fixed; inset: 0; z-index: 40; pointer-events: none; background: #1e40af; clip-path: inset(0 calc(100% - var(--au-side)) 0 0); }
[dir="rtl"] .au-curtain { clip-path: inset(0 0 0 calc(100% - var(--au-side))); }
.auth-brand { z-index: 50; }
body.fk-auth .login-wrapper { z-index: 10; }
body.au-leaving .login-header > *, body.au-leaving .login-body > *, body.au-leaving .login-wrapper > :not(.login-card), body.au-leaving .login-card {
    transform: translateX(calc(140px * var(--au-out))); opacity: 0; filter: blur(10px);
    transition: transform 450ms cubic-bezier(.2,.8,.2,1) calc(60ms * var(--au-i, 0)), opacity 450ms ease calc(60ms * var(--au-i, 0)), filter 450ms ease calc(60ms * var(--au-i, 0)); }
body.au-leaving .login-card { transition-delay: 200ms; }
body.au-leaving .auth-brand > * { opacity: 0; filter: blur(10px); transition: opacity 400ms ease, filter 400ms ease; }
body.au-leaving .login-lang, body.au-leaving .auth-tools { opacity: 0; transition: opacity 300ms ease; }
body.au-covering .au-curtain { z-index: 60; clip-path: inset(0 0 0 0) !important; transition: clip-path 450ms cubic-bezier(.65,0,.35,1) 250ms; }
html.au-arriving .au-curtain { z-index: 60; animation: au-retreat 450ms cubic-bezier(.65,0,.35,1) 50ms both; }
@keyframes au-retreat { from { clip-path: inset(0 0 0 0); } }
html.au-arriving .auth-brand > * { animation: au-blur-in 450ms ease 300ms both; }
@keyframes au-blur-in { from { opacity: 0; filter: blur(10px); } }
html.au-arriving .login-card { animation: au-in 450ms cubic-bezier(.2,.8,.2,1) 250ms both; }
html.au-arriving .login-wrapper > :not(.login-card) { animation: au-in 450ms cubic-bezier(.2,.8,.2,1) 400ms both; }
@keyframes au-in { from { opacity: 0; transform: translateX(calc(140px * var(--au-out))); filter: blur(10px); } }
/* same-origin page change: no default cross-fade (both pages are covered at that moment) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
@media (max-width: 860px) { .au-curtain { display: none; } }
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    .au-curtain { display: none; }
    body.au-leaving *, html.au-arriving * { transition: none !important; animation: none !important; }
}
