/* Company colour (Ustawienia → Wygląd aplikacji). The server puts the same --app-* values on <html>
   as on every app page (appearance.css_variables) and they map to Tabler exactly as in
   common/app_layout.css: fills use the colour with the readable text on it (--app-primary-fg, white
   or dark), text, links, active tabs and focus rings use the shade with at least 4.5:1 on light
   surfaces (--app-primary-text, darker for light colours such as yellow). */
html[data-app-theme] {
  --tblr-primary: var(--app-primary);
  --tblr-primary-rgb: var(--app-primary-rgb);
  --tblr-primary-darken: var(--app-primary-darken);
  --tblr-primary-fg: var(--app-primary-fg, #fff);
  --tblr-link-color: var(--app-primary-text, var(--app-primary));
  --tblr-link-color-rgb: var(--app-primary-text-rgb, var(--app-primary-rgb));
  --tblr-link-hover-color: var(--app-primary-text-hover, var(--app-primary-darken));
  --tblr-focus-ring-color: rgba(var(--app-primary-rgb), .3);
}
/* Dark mode (N34: the mode remembered on this device, or the company default): links and
   accents use the light shade of the company colour, as in common/app_layout.css. */
html[data-app-theme][data-bs-theme="dark"] {
  --tblr-link-color: var(--app-link-dark);
  --tblr-link-color-rgb: var(--app-link-dark-rgb);
  --tblr-link-hover-color: var(--app-link-dark-hover);
}
html[data-primary-on="dark"] .auth-card .form-check-input:checked[type=checkbox] { --tblr-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3e%3cpath fill='none' stroke='%23111827' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8.5l2.5 2.5l5.5 -5.5'/%3e%3c/svg%3e"); border-color: color-mix(in srgb, var(--tblr-primary) 70%, #000); }
/* Dark text on a light company colour (e.g. yellow): the hover shade gets lighter, not darker,
   so „Zaloguj się” keeps 4.5:1 while hovered or pressed. */
html[data-primary-on="dark"] .auth-card .btn-primary { --tblr-btn-hover-bg: color-mix(in srgb, var(--tblr-primary) 85%, #fff); --tblr-btn-active-bg: color-mix(in srgb, var(--tblr-primary) 85%, #fff); }
.auth-page {
  --auth-primary: var(--tblr-primary);
  --auth-accent: var(--tblr-link-color);
  --auth-accent-hover: var(--tblr-link-hover-color);
  --auth-accent-border: color-mix(in srgb, var(--tblr-primary) 35%, #fff);
  --auth-ink: light-dark(#182b45,#cbdaed);
  --auth-muted: light-dark(#69798e,#a1abba);
  --auth-border: light-dark(#dce3ec,#31435a);
  margin: 0;
  background: light-dark(#f5f7fa,var(--tblr-bg-surface-secondary));
  color: var(--auth-ink);
}
.auth-page [hidden] { display: none !important; }
.auth-shell { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: -.4px; margin-bottom: 24px; }
.auth-brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--auth-primary); color: var(--tblr-primary-fg); border-radius: 8px; font-size: 21px; }
.auth-card { width: 100%; max-width: 440px; background: light-dark(white,var(--tblr-bg-surface)); border: 1px solid var(--auth-border); border-radius: 12px; box-shadow: 0 3px 12px #14243c05; padding: 32px; }
.auth-card h1 { font-size: 24px; line-height: 1.3; letter-spacing: -.5px; margin: 0 0 8px; font-weight: 600; }
.auth-intro { font-size: 14px; color: var(--auth-muted); margin: 0 0 26px; line-height: 1.6; }
.auth-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: light-dark(#f3f5f8,var(--tblr-bg-surface-secondary)); border: 1px solid var(--auth-border); border-radius: 8px; padding: 4px; margin-bottom: 26px; }
.auth-methods a { min-width: 0; min-height: 42px; border: 1px solid transparent; border-radius: 5px; color: light-dark(#65748a,#a1abba); font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; text-decoration: none; }
.auth-methods a[aria-current] { background: light-dark(white,var(--tblr-bg-surface)); color: var(--auth-accent); border-color: var(--auth-accent-border); box-shadow: 0 1px 3px #192e4710; }
.auth-methods a:hover { color: var(--auth-accent-hover); }
.auth-methods svg { width: 18px; height: 18px; flex: none; }
.auth-card button:focus-visible, .auth-card a:focus-visible { outline: 3px solid var(--auth-accent); outline-offset: 3px; }
.auth-card .form-check-input:focus { border-color: var(--auth-accent); }
.auth-field { margin-bottom: 20px; }
.auth-card .form-label { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.auth-card input:not([type=hidden]):not([type=checkbox]) { display: block; width: 100%; height: 46px; border: 1px solid var(--auth-border); border-radius: 6px; color: var(--auth-ink); font-size: 16px; box-shadow: 0 1px 2px #14243c03; padding: 10px 12px; background: light-dark(white,var(--tblr-bg-surface)); }
.auth-card input:not([type=hidden]):not([type=checkbox]):focus { border-color: var(--auth-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tblr-primary) 18%, transparent); outline: 0; }
.auth-secret { position: relative; }
.auth-card .auth-secret input { padding-right: 50px; }
.auth-reveal { position: absolute; right: 3px; top: 3px; height: 40px; width: 40px; display: grid; place-items: center; border: 0; background: transparent; color: light-dark(#7a899b,#a2abb9); border-radius: 4px; }
.auth-reveal:hover { background: light-dark(#f3f5f8,var(--tblr-bg-surface-secondary)); }
.auth-reveal svg { width: 20px; height: 20px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.auth-label-row .form-label { margin: 0; }
.auth-forgot { color: var(--auth-accent); font-size: 13px; text-decoration: none; }
.auth-forgot:hover { color: var(--auth-accent-hover); text-decoration: underline; }
.auth-submit { width: 100%; min-height: 46px; border-radius: 6px; font-size: 14px; font-weight: 600; margin-top: 6px; }
.auth-help { font-size: 13px; line-height: 1.65; color: var(--auth-muted); margin: 12px 0 20px; }
.auth-card .auth-pin input { letter-spacing: .32em; font-variant-numeric: tabular-nums; font-size: 21px; }
.auth-pin-support { text-align: center; color: var(--auth-muted); font-size: 13px; line-height: 1.65; margin: 20px 4px 0; }
.auth-pin-label { display: flex; align-items: center; gap: 3px; margin-bottom: 4px; }
.auth-pin-label .form-label { margin: 0; }
.auth-page .popover { max-width: 280px; }
.auth-notice { padding: 12px 14px; border: 1px solid light-dark(#cbdcf2,#24446d); background: light-dark(#f2f7ff,#182840); border-radius: 6px; font-size: 13px; line-height: 1.6; margin: 0 0 20px; color: light-dark(#34587f,#a0bbd8); overflow-wrap: anywhere; }
.auth-notice.is-error { border-color: light-dark(#f1c9a5,#5d3a1c); background: light-dark(#fff6ee,#2b2016); color: light-dark(#7a420f,#efbf91); }
.auth-notice.is-lock { border-color: light-dark(#eab0b0,#6a2c2c); background: light-dark(#fff1f1,#2c1a1d); color: light-dark(#8a2424,#f0a6a6); }
.auth-notice-sub { display: block; margin-top: 4px; font-size: 12.5px; opacity: .9; }
.auth-card input.auth-code { text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.auth-card input.auth-code::placeholder { text-transform: none; letter-spacing: normal; font-weight: 400; }
.auth-remember { display: flex; align-items: center; gap: 4px; margin: 14px 0 6px; font-size: 14px; }
.auth-remember .form-check { display: flex; align-items: center; gap: 8px; padding-left: 0; min-height: 28px; }
.auth-remember .form-check-input { float: none; margin: 0; width: 20px; height: 20px; flex: none; }
.auth-loc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 18px; border: 1px solid var(--auth-border); border-radius: 8px; background: light-dark(#f9fafb,var(--tblr-bg-surface-secondary)); }
.auth-loc > svg { width: 22px; height: 22px; flex: none; color: var(--auth-muted); }
.auth-loc-text { flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.auth-loc-text small { display: block; font-size: 12px; color: var(--auth-muted); }
.auth-loc-text strong { font-size: 15px; }
.auth-loc-change { display: inline-flex; align-items: center; color: var(--auth-accent); font-size: 13px; font-weight: 500; min-height: 40px; padding: 0 6px; border-radius: 6px; text-decoration: none; white-space: nowrap; }
.auth-loc-change:hover { color: var(--auth-accent-hover); text-decoration: underline; }
.auth-submit:disabled { background: light-dark(#e9ecef,#2a3446); border-color: light-dark(#dce3ec,#31435a); color: var(--auth-muted); opacity: 1; font-variant-numeric: tabular-nums; }
.auth-card .errorlist { list-style: none; margin: 6px 0 12px; padding: 0; font-size: 13px; color: light-dark(#945314,#efbf91); }
.auth-notice .errorlist { margin: 0; color: inherit; }
.auth-back { width: 100%; margin-top: 12px; min-height: 44px; border-color: var(--auth-border); color: light-dark(#5c6b80,#a1abba); }
.auth-recover-copy { font-size: 14px; color: var(--auth-muted); line-height: 1.65; margin: 16px 0 24px; }
@media (max-width: 480px) {
  .auth-shell { justify-content: flex-start; padding: 48px 16px 28px; }
  .auth-card { padding: 26px 22px; }
  .auth-card h1 { font-size: 23px; }
  .auth-methods a { gap: 6px; font-size: 13px; }
  .auth-intro { margin-bottom: 24px; }
}
@media (max-width: 767px) {
  .auth-pin-label { gap: 0; }
  .auth-methods a { min-height: 44px; }
  .auth-reveal { top: 1px; right: 1px; width: 44px; height: 44px; }
  .auth-remember .form-check { min-height: 44px; }
  .auth-loc-change { min-height: 44px; }
}
@media (max-height: 650px) { .auth-shell { justify-content: flex-start; padding-top: 24px; } }
@media (prefers-reduced-motion: reduce) { .auth-page * { transition: none !important; } }
.auth-brand-logo { max-height: 44px; max-width: 220px; object-fit: contain; }
