/*
 * BOS app sign-in layout (BUSINESS-373): the launcher's sign-in screen (shell/src/pages/SignInPage.tsx and the
 * .signin-* rules in shell/src/styles.css) for the app sign-in pages (BOS Billing, Rooman Books, BOS ERP / HR).
 * Served at https://brand.<BOS_DOMAIN>/signin/bos-signin.css; the apps bundle a copy next to the two dot images
 * (signin-dots-light.webp / signin-dots-dark.webp, a still of the launcher's GradientASCII field made by
 * signin-dots.py). Keep the copies byte-identical with this file.
 *
 *   <div class="bos-signin">
 *     <section class="bos-signin-hero" aria-hidden="true">
 *       <p class="bos-signin-hero-title">One sign-in for<br>every BOS app.</p>
 *     </section>
 *     <main class="bos-signin-panel">
 *       <div class="bos-signin-top"><span class="bos-signin-wordmark">BOS</span></div>
 *       <div class="bos-signin-card">
 *         <div class="bos-signin-head"><h1>Sign in to BOS Billing</h1><p>Use your BOS account to continue.</p></div>
 *         <a class="bos-signin-btn" href="...">Sign in with BOS</a>
 *       </div>
 *       <p class="bos-signin-footer">BOS · © Rooman Technologies</p>
 *     </main>
 *   </div>
 *
 * Colours are the launcher's tokens (brand/theme/bos-tokens.css). Dark: the system setting, or a .dark /
 * [data-theme="dark"] ancestor (the app's own theme switch). Below 860 px the dot panel is hidden.
 */
.bos-signin {
  --bsi-bg: #f5f6fa;
  --bsi-surface: #ffffff;
  --bsi-surface-2: #f0f3f9;
  --bsi-border: #e1e6f0;
  --bsi-border-strong: #c9d1e2;
  --bsi-text: #1b2340;
  --bsi-text-2: #4a5470;
  --bsi-text-3: #5f6884;
  --bsi-focus: #27449a;
  --bsi-danger: #b42318;
  --bsi-danger-soft: #fdecea;
  --bsi-shadow: 0 8px 28px rgba(20, 26, 46, 0.12);
  --bsi-dots: url("./signin-dots-light.webp");

  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  background: var(--bsi-bg);
  color: var(--bsi-text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
}
.bos-signin *,
.bos-signin *::before,
.bos-signin *::after {
  box-sizing: border-box;
}
:is(.dark, [data-theme="dark"]) .bos-signin,
.bos-signin.bos-signin-dark {
  --bsi-bg: #0e1222;
  --bsi-surface: #151b30;
  --bsi-surface-2: #1b2340;
  --bsi-border: #283152;
  --bsi-border-strong: #3a4670;
  --bsi-text: #e8ebf5;
  --bsi-text-2: #b3bbd4;
  --bsi-text-3: #8f99b8;
  --bsi-focus: #a5b8f2;
  --bsi-danger: #ff8a80;
  --bsi-danger-soft: #3a1d22;
  --bsi-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --bsi-dots: url("./signin-dots-dark.webp");
}
@media (prefers-color-scheme: dark) {
  .bos-signin:not(.bos-signin-light) {
    --bsi-bg: #0e1222;
    --bsi-surface: #151b30;
    --bsi-surface-2: #1b2340;
    --bsi-border: #283152;
    --bsi-border-strong: #3a4670;
    --bsi-text: #e8ebf5;
    --bsi-text-2: #b3bbd4;
    --bsi-text-3: #8f99b8;
    --bsi-focus: #a5b8f2;
    --bsi-danger: #ff8a80;
    --bsi-danger-soft: #3a1d22;
    --bsi-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    --bsi-dots: url("./signin-dots-dark.webp");
  }
}

/* left: the inset card with the dot field and the caption (decoration, aria-hidden) */
.bos-signin-hero {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border: 1px solid var(--bsi-border);
  border-radius: 24px;
  background: var(--bsi-dots) center 42% / cover no-repeat, var(--bsi-surface-2);
  color: var(--bsi-text);
}
.bos-signin-hero-title {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 32px;
  margin: 0;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--bsi-text);
}

/* right: wordmark, the sign-in card, footer */
.bos-signin-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 24px;
}
.bos-signin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}
.bos-signin-wordmark {
  font-size: 1.8rem;
  font-weight: 750;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--bsi-text);
  text-decoration: none;
}
.bos-signin-card {
  margin: auto;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px 0;
}
.bos-signin-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bos-signin-head h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--bsi-text);
}
.bos-signin-head p {
  margin: 0;
  color: var(--bsi-text-2);
}

/* the main button: dark navy in light mode, light in dark mode (the launcher's .btn-contrast) */
.bos-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bsi-text);
  color: var(--bsi-bg);
  box-shadow: var(--bsi-shadow);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease;
}
.bos-signin-btn:hover {
  background: color-mix(in srgb, var(--bsi-text) 85%, var(--bsi-bg));
  color: var(--bsi-bg);
  text-decoration: none;
}
.bos-signin-btn:disabled,
.bos-signin-btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}
/* secondary: outlined (the password form's submit) */
.bos-signin-btn-secondary {
  height: 44px;
  background: var(--bsi-surface);
  border-color: var(--bsi-border-strong);
  color: var(--bsi-text);
  box-shadow: none;
}
.bos-signin-btn-secondary:hover {
  background: var(--bsi-surface-2);
  color: var(--bsi-text);
}
.bos-signin :focus-visible {
  outline: 2px solid var(--bsi-focus);
  outline-offset: 2px;
}

/* secondary sign-in (platform admins' email and password): a quiet link, then a small form */
.bos-signin-alt {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--bsi-text-2);
}
.bos-signin-link {
  /* 44 px tall so it can be tapped at 360 px (BUSINESS-380 UX) */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 2px 4px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--bsi-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.bos-signin-link:hover {
  color: var(--bsi-text);
  text-decoration-thickness: 2px;
}
.bos-signin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--bsi-border);
}
.bos-signin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bos-signin-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bsi-text);
}
.bos-signin-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--bsi-border-strong);
  border-radius: 12px;
  background: var(--bsi-surface);
  color: var(--bsi-text);
  font: inherit;
  font-size: 1rem;
}
.bos-signin-field input::placeholder {
  color: var(--bsi-text-3);
}
.bos-signin-field input:focus-visible {
  outline: 2px solid var(--bsi-focus);
  outline-offset: 0;
  border-color: transparent;
}
.bos-signin-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bsi-danger-soft);
  color: var(--bsi-danger);
  font-size: 0.88rem;
}
.bos-signin-footer {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  color: var(--bsi-text-2);
}

@media (max-width: 860px) {
  .bos-signin {
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
  }
  .bos-signin-hero {
    display: none;
  }
  .bos-signin-panel {
    padding: 20px 16px;
  }
}
@media (max-width: 720px) {
  .bos-signin-wordmark {
    font-size: 1.4rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bos-signin-btn {
    transition: none;
  }
}
