/* Anonymous sign-in follows device appearance; authenticated preferences stay unchanged. */
html.bp-login-page {
  color-scheme: light;
  --login-bg: #f8f9fb;
  --login-ink: #20242b;
  --login-muted: #626a77;
  --login-field: #eef0f4;
  --login-line: #dce0e7;
  --login-error-bg: #fff0f1;
  --login-error-ink: #a4223a;
  background: var(--login-bg);
}
@media (prefers-color-scheme: dark) {
  html.bp-login-page {
    color-scheme: dark;
    --login-bg: #1c1f24;
    --login-ink: #f3f4f6;
    --login-muted: #a7afbd;
    --login-field: #292d35;
    --login-line: #3b414c;
    --login-error-bg: #3b252d;
    --login-error-ink: #ffb6c3;
  }
}
html.bp-login-page body { background: var(--login-bg); color: var(--login-ink); }
.bp-login-page .bp-login {
  display: flex; flex-direction: column; width: min(100%, 440px);
  min-height: 100vh; min-height: 100svh; margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.bp-login-page .bp-login-header { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.bp-login-page .bp-login-wordmark { color: var(--login-ink); font-size: 32px; font-weight: 850; letter-spacing: -1.6px; line-height: 1.2; text-decoration: none; }
.bp-login-page .bp-login-workspace { color: var(--login-muted); font-size: 12px; overflow-wrap: anywhere; }
.bp-login-page .bp-login-content { margin: auto 0; padding: 48px 0 36px; }
.bp-login-page .bp-login-eyebrow { margin: 0 0 14px; font-size: 10px; font-weight: 650; letter-spacing: 1.25px; color: var(--login-muted); }
.bp-login-page .bp-login-intro h1 { margin: 0 0 12px; font-size: clamp(29px, 8vw, 36px); line-height: 1.12; letter-spacing: -1.2px; color: var(--login-ink); }
.bp-login-page .bp-login-intro > p:last-child { margin: 0 0 28px; color: var(--login-muted); font-size: 15px; line-height: 1.6; max-width: 33ch; }
.bp-login-page .bp-login-fields { display: flex; flex-direction: column; margin: 0; }
.bp-login-page .bp-login-fields > label:not(.bp-login-remember) { margin: 0 0 9px; color: var(--login-ink); font-size: 13px; font-weight: 600; }
.bp-login-page .bp-login-fields > input, .bp-login-page .bp-password > input {
  width: 100%; min-height: 54px; margin: 0 0 20px; padding: 14px 16px;
  border: 1px solid var(--login-line); border-radius: 14px;
  background: var(--login-field); color: var(--login-ink); font-size: 16px; box-shadow: none;
}
.bp-login-page .bp-login-remember { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: -4px 0 16px; color: var(--login-muted); font-size: 12px; line-height: 1.5; cursor: pointer; }
.bp-login-page .bp-login-remember input { width: 19px; height: 19px; min-height: 19px; margin: 0; flex: none; accent-color: #638f00; }
.bp-login-page .bp-login-submit { width: 100%; min-height: 54px; border: 1px solid #a8fd00; border-radius: 16px; background: #a8fd00; color: #172000; font-size: 15px; font-weight: 700; touch-action: manipulation; }
.bp-login-page .bp-login-submit:hover { background: #b6ff30; border-color: #b6ff30; }
.bp-login-page .bp-login-submit:active { background: #97e300; }
.bp-login-page .bp-login-reset { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 8px; color: var(--login-ink); font-size: 13px; text-decoration: none; }
.bp-login-page :is(input, button, a, summary):focus-visible { outline: 2px solid #638f00; outline-offset: 3px; }
.bp-login-page .bp-login-error { padding: 14px 16px; margin-bottom: 20px; border-radius: 14px; background: var(--login-error-bg); color: var(--login-error-ink); font-size: 14px; line-height: 1.5; }
.bp-login-page .bp-login-demo { border-top: 1px solid var(--login-line); margin-top: 16px; padding-top: 14px; color: var(--login-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.bp-login-page .bp-login-demo summary { min-height: 28px; cursor: pointer; }
.bp-login-page .bp-login-footer { margin-top: auto; padding: 0; text-align: center; color: var(--login-muted); font-size: 11px; line-height: 1.5; }
@media (max-height: 650px) {
  .bp-login-page .bp-login-content { padding: 30px 0 24px; }
}

/* Login-only language control; other pages keep their existing translation tools. */
.bp-login-page .language-tools-compact {
  justify-content: flex-start; direction: ltr;
  padding: max(4px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 4px max(24px, env(safe-area-inset-left));
  background: transparent; border: 0; color: var(--login-ink);
}
.bp-login-page .language-picker > summary {
  display: grid; place-items: center; width: 44px; height: 44px;
  min-height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--login-ink); touch-action: manipulation;
}
.bp-login-page .language-picker[open] > summary { background: transparent; }
.bp-login-page .language-picker > summary:active { opacity: .65; }
.bp-login-page .language-picker > summary svg { flex: none; width: 24px; height: 24px; }
.bp-login-page .language-panel {
  inset-inline: auto; left: max(24px, env(safe-area-inset-left)); right: auto; top: 100%;
  width: 196px; max-width: calc(100vw - 48px); padding: 5px; gap: 0;
  color: var(--login-ink); background: var(--login-bg);
  border: 1px solid var(--login-line); border-radius: 16px;
  box-shadow: 0 6px 22px #00000012;
  animation: login-language-in 130ms ease-out;
}
.bp-login-page .language-panel form { display: flex; flex-direction: column; gap: 0; }
.bp-login-page .language-panel button {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 44px; padding: 10px 12px; margin: 0;
  border: 0; border-radius: 10px; background: transparent; box-shadow: none;
  color: var(--login-ink); font: 500 14px/1.4 var(--bp-ui-font,system-ui,sans-serif);
  direction: ltr; text-align: left; cursor: pointer; touch-action: manipulation;
}
.bp-login-page .language-panel button:is(:hover, :focus-visible, :active) { background: var(--login-field); }
.bp-login-page .language-check { flex: none; visibility: hidden; }
.bp-login-page .language-panel button[aria-checked=true] .language-check { visibility: visible; }
@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .bp-login-page .language-panel { background: #ffffffd9; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  @media (prefers-color-scheme: dark) { .bp-login-page .language-panel { background: #24272de6; } }
}
@keyframes login-language-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .bp-login-page .language-panel { animation: none; } }

/* Password reset and invitation pages reuse the sign-in layout. */
.bp-login-page .bp-login-action { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.bp-login-page .bp-login-fields > .bp-login-error { margin: -8px 0 16px; }

/* BossPilot signature: same palette, a lime "pilot light" and this week's strip. */
html.bp-login-page { --login-glow: rgba(168, 253, 0, .16); }
@media (prefers-color-scheme: dark) { html.bp-login-page { --login-glow: rgba(168, 253, 0, .08); } }
html.bp-login-page body { background-image: radial-gradient(circle at 100% 0, var(--login-glow), rgba(168, 253, 0, 0) min(70vmax, 720px)); background-attachment: fixed; }
/* The wordmark always reads left to right, also in Arabic. */
.bp-login-page .bp-login-wordmark { direction: ltr; unicode-bidi: isolate; }
.bp-login-page .bp-login-dot {
  display: inline-block; width: .24em; height: .24em; margin-inline-start: .14em; vertical-align: .1em;
  border-radius: 50%; background: #a8fd00; box-shadow: 0 0 0 1px #7fbf00, 0 0 0 .08em rgba(168, 253, 0, .35);
  animation: bp-pilot-light 2.8s ease-in-out infinite;
}
@keyframes bp-pilot-light { 50% { box-shadow: 0 0 0 1px #7fbf00, 0 0 0 .3em rgba(168, 253, 0, 0); } }

.bp-login-page .bp-week { margin: 0 0 24px; }
.bp-login-page .bp-week-label { margin: 0 0 8px; color: var(--login-muted); font-size: 11px; font-weight: 650; letter-spacing: .4px; }
.bp-login-page .bp-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.bp-login-page .bp-week-days li {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 8px;
  border: 1px solid var(--login-line); border-radius: 12px; background: var(--login-field); color: var(--login-ink);
}
.bp-login-page .bp-week-days span { color: var(--login-muted); font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.bp-login-page .bp-week-days b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bp-login-page .bp-week-days .is-past { opacity: .5; }
.bp-login-page .bp-week-days .is-today { border-color: #a8fd00; background: #a8fd00; color: #172000; box-shadow: 0 6px 18px rgba(168, 253, 0, .28); }
.bp-login-page .bp-week-days .is-today span { color: #2f4a00; }

/* Fields: lime focus ring, marked errors, show/hide password. */
.bp-login-page .bp-login-fields input:not([type=checkbox]) { transition: border-color .15s, box-shadow .15s, background-color .15s; }
.bp-login-page .bp-login-fields input:not([type=checkbox]):focus-visible { outline: none; border-color: #638f00; box-shadow: 0 0 0 4px rgba(168, 253, 0, .32); }
.bp-login-page .bp-login-fields input[aria-invalid=true] { border-color: var(--login-error-ink); background: var(--login-error-bg); }
.bp-login-page .bp-password { position: relative; margin: 0 0 20px; }
.bp-login-page .bp-password > input { margin: 0; padding-inline-end: 58px; }
.bp-login-page .bp-password-toggle {
  position: absolute; top: 50%; inset-inline-end: 5px; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 11px; background: transparent; color: var(--login-muted); box-shadow: none;
}
.bp-login-page .bp-password-toggle:hover { border: 0; background: var(--login-line); color: var(--login-ink); }
.bp-login-page .bp-password-toggle svg { width: 22px; height: 22px; }
.bp-login-page .bp-password-toggle .bp-eye-off,
.bp-login-page .bp-password-toggle[aria-pressed=true] .bp-eye { display: none; }
.bp-login-page .bp-password-toggle[aria-pressed=true] .bp-eye-off { display: block; }

/* Actions: press feedback, busy state, readable secondary links. */
.bp-login-page .bp-login-submit { position: relative; transition: transform .12s ease, background-color .15s; }
.bp-login-page .bp-login-submit:active { transform: scale(.98); }
.bp-login-page .bp-login-submit[aria-busy=true] { color: transparent; pointer-events: none; }
.bp-login-page .bp-login-submit[aria-busy=true]::after {
  content: ""; position: absolute; inset: 0; width: 20px; height: 20px; margin: auto;
  border: 2.5px solid #172000; border-inline-end-color: transparent; border-radius: 50%;
  animation: bp-login-spin .7s linear infinite;
}
@keyframes bp-login-spin { to { transform: rotate(360deg); } }
.bp-login-page .bp-login-remember { font-size: 14px; }
.bp-login-page .bp-login-reset { font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--login-line); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bp-login-page .bp-login-reset:hover { text-decoration-color: #a8fd00; }
.bp-login-page .bp-login-footer { display: flex; align-items: center; justify-content: center; gap: 6px; }
.bp-login-page .bp-login-lock { width: 12px; height: 12px; flex: none; }
@media (prefers-reduced-motion: reduce) {
  .bp-login-page .bp-login-dot { animation: none; }
  .bp-login-page .bp-login-submit, .bp-login-page .bp-login-fields input { transition: none; }
  .bp-login-page .bp-login-submit:active { transform: none; }
}

/* Registration of a new business */
.bp-login-page .bp-signup-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.bp-login-page .bp-login-signup { margin-top: 0; }
.bp-login-page .bp-choices { margin: 4px 0 10px; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bp-login-page .bp-choices legend { grid-column: 1 / -1; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--login-ink); }
.bp-login-page .bp-choices label { position: relative; display: flex; }
.bp-login-page .bp-choices input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.bp-login-page .bp-choices span { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 10px; border: 1px solid var(--login-line); border-radius: 14px; background: var(--login-field, #f4f6f9); font-size: 14px; font-weight: 600; text-align: center; color: var(--login-ink); }
.bp-login-page .bp-choices input:checked + span { border-color: #a8fd00; background: rgba(168, 253, 0, .22); box-shadow: 0 0 0 1px #a8fd00 inset; }
.bp-login-page .bp-choices input:focus-visible + span { outline: 3px solid #2457c5; outline-offset: 2px; }
.bp-login-page .bp-steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.bp-login-page .bp-steps li { counter-increment: step; position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 14px 56px; border: 1px solid var(--login-line); border-radius: 18px; }
.bp-login-page .bp-steps li::before { content: counter(step); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #a8fd00; color: #172000; font-weight: 800; }
.bp-login-page .bp-steps b { font-size: 15px; }
.bp-login-page .bp-steps span { font-size: 13px; line-height: 1.45; opacity: .75; }
.bp-login-page .bp-choices label { margin: 0; }

/* Two-step sign-in */
.bp-login-page .bp-login-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--login-muted); }
.bp-login-page .bp-login-note code { font-size: 12px; word-break: break-all; color: var(--login-ink); }
.bp-login-page .bp-qr { display: grid; place-items: center; margin: 4px 0 6px; padding: 14px; border-radius: 18px; background: #fff; border: 1px solid var(--login-line); }
.bp-login-page .bp-qr svg { width: 220px; height: 220px; }
.bp-login-page .bp-codes { margin: 0 0 16px; padding: 14px 16px; border-radius: 18px; background: rgba(168, 253, 0, .18); border: 1px solid rgba(168, 253, 0, .5); }
.bp-login-page .bp-codes h2 { margin: 0 0 6px; font-size: 16px; }
.bp-login-page .bp-codes p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; }
.bp-login-page .bp-codes ol { margin: 0; padding-left: 22px; columns: 2; font: 600 15px/1.8 ui-monospace, Menlo, monospace; }
.bp-login-page .bp-danger { margin-top: 18px; }
.bp-login-page .bp-danger summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: #b0234a; }
.bp-login-page .bp-danger-button { background: #fff !important; color: #b0234a !important; border-color: #b0234a !important; }

