/* FAKTUUR sign-in screens (Tastes 63-66): login, forgot password, reset password, two-step code.
   The app's own blue and white; RTL follows <html dir>. */
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body.fk-au{min-height:100vh;background:#f4f7fb;color:#1e293b;font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased}
html[dir="rtl"] body.fk-au{font-family:'Noto Sans Arabic',Inter,system-ui,sans-serif}
.au{min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}

/* brand side */
.au-side{position:relative;overflow:hidden;background:linear-gradient(150deg,#1565c0 0%,#0d47a1 60%,#0a3a85 100%);color:#fff;padding:48px 56px;display:flex;flex-direction:column}
.au-brand img{height:38px;width:auto;display:block}
.au-side h2{margin:auto 0 10px;font-size:34px;line-height:41px;font-weight:800;max-width:440px;color:#fff;letter-spacing:-.01em}
.au-side .lead{margin:0 0 28px;font-size:15px;line-height:23px;color:#dbeafe;max-width:430px}
.au-side .own{margin:-12px 0 0;font-size:20px;line-height:28px;font-weight:700;color:#fff;letter-spacing:-.005em;max-width:430px}
.au-glimpse{background:#fff;border-radius:16px;box-shadow:0 24px 60px rgba(4,24,64,.35);color:#1e293b;max-width:430px;overflow:hidden}
.au-glimpse .gh{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid #eef2f6;font-size:12.5px;color:#64748b}
.au-glimpse .gh b{color:#1e293b;font-size:13.5px}
.au-glimpse .gr{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 16px;border-top:1px solid #f1f5f9;font-size:13px}
.au-glimpse .gr:first-of-type{border-top:0}
.au-glimpse .gr b{font-weight:700}
.au-glimpse .gr small{display:block;color:#64748b;font-size:11.5px}
.au-glimpse .num{font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;direction:ltr;unicode-bidi:isolate}
.au-glimpse .eg{font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#94a3b8}
.au-pill{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:999px;font-size:11px;font-weight:700;margin-inline-start:6px}
.au-pill.paid{background:#d1fae5;color:#065f46}.au-pill.late{background:#fee2e2;color:#991b1b}.au-pill.peppol{background:#e3effd;color:#1565c0}
.au-facts{display:flex;flex-wrap:wrap;gap:12px 24px;margin-top:28px;font-size:12.5px;color:#dbeafe}
.au-facts b{display:block;font-size:15px;color:#fff}

/* form side */
.au-main{display:flex;flex-direction:column;padding:28px 56px 24px;min-width:0}
.au-top{display:flex;justify-content:flex-end}
.au-lang{height:38px;padding:0 34px 0 14px;border:1px solid #e2e8f0;border-radius:10px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;font:inherit;font-size:13px;font-weight:600;color:#334155;cursor:pointer;-webkit-appearance:none;appearance:none}
html[dir="rtl"] .au-lang{padding:0 14px 0 34px;background-position:left 12px center}
.au-lang:focus{outline:none;border-color:#1565c0;box-shadow:0 0 0 4px rgba(21,101,192,.12)}
.au-form{margin:auto 0;width:100%;max-width:400px;align-self:center;padding:24px 0}
.au h1{margin:0 0 6px;font-size:28px;line-height:34px;font-weight:800;color:#0f172a;letter-spacing:-.01em}
.au .sub{margin:0 0 28px;font-size:14.5px;line-height:21px;color:#475569}
.au-fld{display:grid;gap:6px;margin-bottom:20px}
.au-fld .lr{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
/* A link shown beside the label but placed after the input in the DOM (Tab order: label's field first) */
.au-fld.lk{grid-template-columns:1fr auto;column-gap:10px}
.au-fld.lk>label{grid-row:1;grid-column:1;align-self:baseline;justify-self:start}
.au-fld.lk>.au-lk{grid-row:1;grid-column:2;align-self:baseline}
.au-fld.lk>.au-in{grid-row:2;grid-column:1/-1}
.au-fld label,.au-fld .lbl{font-size:13px;font-weight:700;color:#334155}
.au-in{position:relative;display:flex;align-items:center}
.au-in input{width:100%;height:46px;padding:0 2px;background:transparent;border:0;border-bottom:2px solid #cbd5e1;border-radius:0;font:inherit;font-size:15px;color:#0f172a;transition:border-color .15s,box-shadow .15s}
.au-in input::placeholder{color:#94a3b8}
.au-in input:focus{outline:none;border-bottom-color:#1565c0;box-shadow:0 1px 0 0 #1565c0}
.au-in input[type="email"]{direction:ltr;text-align:start}
html[dir="rtl"] .au-in input[type="email"]{text-align:right}
.au-in .password-toggle{position:absolute;inset-inline-end:6px;height:34px;min-width:34px;padding:0 8px;border:0;border-radius:8px;background:transparent;color:#1565c0;font-size:15px;cursor:pointer}
.au-in .password-toggle:hover{background:#eef5ff}
.au-in input[type="password"],.au-in input.has-toggle{padding-inline-end:48px}
.au a.au-lk{font-size:13px;font-weight:600;color:#1565c0;text-decoration:none}
.au a.au-lk:hover{text-decoration:underline}
.au-btn{height:48px;width:100%;border:0;border-radius:12px;background:#1565c0;color:#fff;font:inherit;font-size:15px;font-weight:700;display:flex;align-items:center;justify-content:center;gap:8px;cursor:pointer;box-shadow:0 8px 20px rgba(21,101,192,.25);transition:background .15s}
.au-btn:hover{background:#0d47a1}
.au-btn:focus-visible{outline:3px solid rgba(21,101,192,.35);outline-offset:2px}
.au a.au-btn:link,.au a.au-btn:visited{color:#fff;text-decoration:none}
.au-alert{display:flex;gap:10px;align-items:flex-start;padding:11px 14px;border-radius:12px;font-size:13.5px;line-height:19px;margin-bottom:20px}
.au-alert i{margin-top:2px}
.au-alert.err{background:#fef2f2;border:1px solid #fecaca;color:#991b1b}
.au-alert.ok{background:#ecfdf5;border:1px solid #a7f3d0;color:#065f46}
.au-alert.warn{background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.au-links{display:grid;gap:10px;margin-top:18px;text-align:center}
.au-foot{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:6px 12px;font-size:12px;color:#475569;padding-top:18px}
.au-foot a{color:#475569;text-decoration:none}
.au-foot a:hover{color:#1565c0}

/* reset password: strength and rules */
.password-strength{height:6px;border-radius:999px;background:#eef2f7;overflow:hidden;margin-top:8px}
.password-strength-bar{display:block;height:100%;width:0;border-radius:999px;transition:width .2s,background .2s}
.password-strength-text,.password-match-text{font-size:12px;font-weight:600;min-height:16px;margin-top:4px}
.au-rules{list-style:none;margin:-4px 0 20px;padding:0;display:grid;gap:6px;font-size:12.5px}
.au-rules li{display:flex;align-items:center;gap:8px;color:#64748b}
.au-rules li b{flex:none;width:16px;height:16px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:9px;background:#e2e8f0;color:#64748b}
.au-rules li.ok{color:#065f46}.au-rules li.ok b{background:#10b981;color:#fff}

/* two-step */
.au-who{display:flex;align-items:center;gap:10px;padding:10px 12px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;margin-bottom:20px;font-size:13.5px}
.au-who .av{flex:none;width:32px;height:32px;border-radius:50%;background:#e3effd;color:#1565c0;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800}
.au-who b{display:block}.au-who small{display:block;color:#64748b;font-size:12px;direction:ltr;unicode-bidi:isolate;text-align:start}
.au-in input.code-input{height:58px;padding:0 0 0 calc((100% - 6ch * 1.9) / 2);direction:ltr;font-size:26px;font-weight:800;letter-spacing:.9ch;font-variant-numeric:tabular-nums;text-align:left;font-family:'SF Mono',ui-monospace,Menlo,Consolas,monospace}
.au-in input.backup-input{height:54px;direction:ltr;text-align:center;font-size:20px;font-weight:800;letter-spacing:.3em;font-family:'SF Mono',ui-monospace,Menlo,Consolas,monospace;text-transform:uppercase}
.au .timer{margin:8px 0 0;font-size:12.5px;color:#64748b}
.au .au-small{display:block;margin-top:8px;font-size:12px;color:#92400e}

/* phone */
@media (max-width:900px){
  .au{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 1fr}
  .au-side{padding:26px 24px 24px}
  .au-brand img{height:30px}
  .au-side h2{margin:20px 0 0;font-size:24px;line-height:30px}
  .au-glimpse,.au-facts{display:none}
  .au-side .lead{margin:6px 0 0;font-size:13.5px;line-height:19px}
  .au-side .own{margin:2px 0 0;font-size:15px;line-height:22px}
  .au-main{padding:20px 24px 18px}
  .au-form{margin:14px 0 auto;max-width:none;padding:8px 0 16px}
  .au h1{font-size:24px;line-height:30px}
  .au .sub{margin-bottom:22px}
  .au-foot{flex-direction:column;justify-content:center;text-align:center}
}
@media (prefers-reduced-motion:reduce){.au-in input,.au-btn,.password-strength-bar{transition:none}}
.au-arr{display:inline-block}
html[dir="rtl"] .au-arr{transform:scaleX(-1)}

/* Sign-in <-> forgot password switch (2.6.2), scoped to login.php (body.au-login) and
   forgot-password.php (body.au-forgot); reset-password and 2fa-verify are untouched.
   The blue is a full-card curtain (.au::before) cut on a diagonal; the forgot page is an
   exact mirror of login. Leaving: assets/js/auth-motion.js adds .is-leaving/.is-covering
   (fields out, curtain covers the card), then opens the other page; arriving it adds
   html.au-arriving (curtain retreats, fields come in). Phones, reduced motion and
   browsers without the script just load the page. */
body.au-login .au,body.au-forgot .au{position:relative;isolation:isolate;--shape:polygon(0 0,58% 0,42% 100%,0 100%);--out:1}
body.au-forgot .au{--shape:polygon(42% 0,100% 0,100% 100%,58% 100%);--out:-1}
html[dir="rtl"] body.au-login .au{--shape:polygon(42% 0,100% 0,100% 100%,58% 100%);--out:-1}
html[dir="rtl"] body.au-forgot .au{--shape:polygon(0 0,58% 0,42% 100%,0 100%);--out:1}
body.au-login .au::before,body.au-forgot .au::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(150deg,#1565c0 0%,#0d47a1 60%,#0a3a85 100%);clip-path:var(--shape)}
body.au-login .au-main,body.au-forgot .au-main{position:relative;z-index:0}
/* side text sits on the curtain; padding on the diagonal's side grows with the width
   (the diagonal reaches 8% of the card into the blue column) */
body.au-login .au-side,body.au-forgot .au-side{background:transparent;z-index:2;padding-inline-end:calc(8vw + 40px)}
body.au-forgot .au-side{order:2;padding-inline-start:calc(8vw + 40px);padding-inline-end:56px;align-items:flex-end;text-align:end}
body.au-forgot .au-top{justify-content:flex-start}
/* item index for the one-by-one timing */
body.au-login .au-form>:nth-child(2),body.au-forgot .au-form>:nth-child(2){--au-i:1}
body.au-login .au-form>:nth-child(3),body.au-forgot .au-form>:nth-child(3){--au-i:2}
body.au-login .au-form>:nth-child(4),body.au-forgot .au-form>:nth-child(4){--au-i:3}
body.au-login .au-form>:nth-child(n+5),body.au-forgot .au-form>:nth-child(n+5){--au-i:4}
/* leaving (old page): fields out toward the outer edge, top first; side text blurs; curtain covers */
.au.is-leaving .au-form>*{transform:translateX(calc(140px * var(--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))}
.au.is-leaving .au-side>*{opacity:0;filter:blur(10px);transition:opacity 400ms ease,filter 400ms ease}
body.au-login .au.is-covering::before,body.au-forgot .au.is-covering::before{clip-path:polygon(0 0,100% 0,100% 100%,0 100%);transition:clip-path 450ms cubic-bezier(.65,0,.35,1) 250ms}
/* arriving (new page): starts covered, curtain retreats to this page's side, fields come in */
html.au-arriving .au::before{animation:au-retreat 450ms cubic-bezier(.65,0,.35,1) 50ms both}
@keyframes au-retreat{from{clip-path:polygon(0 0,100% 0,100% 100%,0 100%)}}
html.au-arriving .au-side>*{animation:au-blur-in 450ms ease 150ms both}
@keyframes au-blur-in{from{opacity:0;filter:blur(10px)}}
html.au-arriving .au-form>*{animation:au-in 450ms cubic-bezier(.2,.8,.2,1) calc(150ms + 80ms * var(--au-i,0)) both}
@keyframes au-in{from{opacity:0;transform:translateX(calc(140px * var(--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}
/* phone: stacked layout as before, no curtain */
@media (max-width:900px){
  body.au-login .au::before,body.au-forgot .au::before{display:none}
  body.au-login .au-side,body.au-forgot .au-side{order:0;background:linear-gradient(150deg,#1565c0 0%,#0d47a1 60%,#0a3a85 100%);padding:26px 24px 24px;align-items:stretch;text-align:start}
  body.au-forgot .au-top{justify-content:flex-end}
}
@media (prefers-reduced-motion:reduce){
  @view-transition{navigation:none}
  .au.is-leaving .au-form>*,.au.is-leaving .au-side>*,.au.is-covering::before{transition:none}
  html.au-arriving .au::before,html.au-arriving .au-side>*,html.au-arriving .au-form>*{animation:none}
}

/* ===== Sign-in mascot (ui-motion #32): invoice sheet, FAKTUUR blue ===== */
.mascot { --m-body: #ffffff; --m-line: #cbd5e1; --m-ink: #0f172a; --m-accent: var(--accent, #2563eb);
  width: 96px; margin: 0 auto -8px; }
.m-svg { display: block; width: 100%; overflow: visible; }
.m-body { fill: var(--m-body); stroke: var(--m-accent); stroke-width: 3; }
.m-fold { fill: none; stroke: var(--m-accent); stroke-width: 3; stroke-linejoin: round; }
.m-ln { fill: var(--m-line); }
.m-white { fill: #fff; stroke: var(--m-ink); stroke-width: 2.5; }
.m-pupil { fill: var(--m-ink); transform-box: view-box;
  transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform 90ms ease-out; }
/* lids: a sheet-coloured square clipped to the eye; parked above (open) or slid down (closed) */
.m-lid { fill: var(--m-body); transform-box: fill-box; transform: translateY(-100%);
  transition: transform 260ms cubic-bezier(.2,.8,.2,1); }
.m-happy { fill: none; stroke: var(--m-ink); stroke-width: 3; stroke-linecap: round; opacity: 0; }
.m-mouth { fill: none; stroke: var(--m-ink); stroke-width: 3; stroke-linecap: round;
  transition: d 200ms ease; }
.m-head { transform-box: view-box; transform-origin: 60px 130px; }
/* hiding: both lids close; mouth goes small and flat */
.mascot[data-state="hiding"] .m-lid { transform: none; }
.mascot[data-state="hiding"] .m-mouth { d: path("M56 78q4 1 8 0"); }
/* peeking: left closed, right half open (the "one eye sneaks out") */
.mascot[data-state="peeking"] .m-eye-l .m-lid { transform: none; }
.mascot[data-state="peeking"] .m-eye-r .m-lid { transform: translateY(-55%); }
/* oops: eyes wide, head shakes */
.mascot[data-state="oops"] .m-head { animation: m-shake 480ms cubic-bezier(.36,.07,.19,.97); }
.mascot[data-state="oops"] .m-mouth { d: path("M56 79q4-4 8 0"); }
@keyframes m-shake { 15% { rotate: -9deg; } 35% { rotate: 8deg; } 55% { rotate: -6deg; } 75% { rotate: 3deg; } }
/* happy: eyes become arcs, bigger smile */
.mascot[data-state="happy"] .m-white, .mascot[data-state="happy"] .m-pupil { opacity: 0; }
.mascot[data-state="happy"] .m-happy { opacity: 1; }
.mascot[data-state="happy"] .m-mouth { d: path("M52 75q8 9 16 0"); }
/* blink (idle/watching only) */
.mascot.is-blink[data-state="idle"] .m-lid, .mascot.is-blink[data-state="watching"] .m-lid { transform: none; transition-duration: 90ms; }
@media (prefers-reduced-motion: reduce) {
  .m-lid, .m-pupil, .m-mouth { transition: none; }
  .mascot[data-state="oops"] .m-head { animation: none; }
}
.au-form>.mascot{--m-accent:#1565c0;--m-line:#dbe3ee;width:78px;margin:0 0 14px}
/* phones: smaller; hidden on short screens so the sign-in button stays above the fold */
@media (max-width:900px){.au-form>.mascot{width:56px;margin-bottom:10px}}
@media (max-width:900px) and (max-height:700px){.au-form>.mascot{display:none}}
/* iPhone / iPad: Safari zooms the page when a field under 16px is focused (these are 15px). iOS only;
   the 2FA code and backup-code fields are designed larger and keep their size. */
@supports (-webkit-touch-callout: none){body.fk-au :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"]), select, textarea){font-size:16px!important}
body.fk-au .au-in input.backup-input{font-size:20px!important}body.fk-au .au-in input.code-input{font-size:26px!important}}
