/* ============================================================================
   App styles — layout only. Loaded last, after kantostock-theme.css.

   Brand colours live in kantostock-theme.css (spec: docs/BRAND_THEME.md).
   Anything here that needs a brand colour references a --ks-* or --bs-*
   token, never hex, so the theme file can be replaced without touching this
   one. The neutral greys on the signed-out screens below are layout, not brand.
   ========================================================================== */

/* ─── Sidebar brand ───────────────────────────────────────────────────────────
   The mark is AdminLTE's .brand-image and the wordmark its .brand-text, so
   AdminLTE's own collapse and hover-expand rules hide and show the wordmark.
   Both are drawn at the lockup's height, so the square does not jump. */
.sidebar-brand .brand-wordmark {
  width: auto;
  height: 33px;
}

/* ============================================================================
   Signed-out screens (login, forgot password, reset password)
   ========================================================================== */

.login-page {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

.login-box {
  width: 420px;
}

.login-box .card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .10);
}

.card-header-brand {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 12px 12px 0 0 !important;
  padding: 1.75rem 2.25rem 1.25rem;
  text-align: center;
}

.card-header-brand img {
  height: auto;
  width: 220px;
}

.login-card-body {
  padding: 2rem 2.25rem;
  border-radius: 0 0 12px 12px;
}

.login-card-body .form-control {
  border-right: 0;
  padding: .6rem .85rem;
}

.login-card-body .input-group-text {
  background: transparent;
  border-left: 0;
  color: #6c757d;
}

.btn-login {
  padding: .65rem 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: 8px;
}

.alert-flash {
  border-radius: 8px;
  font-size: .875rem;
  padding: .65rem .9rem;
}

/* Row 12b: legal documents — the editor's height, and long-form text in a card. */
.ks-legal-editor-wrap .ql-container { min-height: 24rem; font-size: 1rem; font-family: inherit; }
.ks-legal-text h2 { font-size: 1.25rem; margin-top: 1.5rem; }
.ks-legal-text h3 { font-size: 1.05rem; margin-top: 1.25rem; }
.ks-legal-text h2:first-child, .ks-legal-text h3:first-child { margin-top: 0; }
.ks-pre-line { white-space: pre-line; }

/* Row 12b: the public legal pages (layouts/public.php) — a brand bar, a reading column, a sticky table of contents
   on wide screens, and a print stylesheet. Light only, like the other signed-out pages. */
.ks-public { background: var(--bs-body-bg); }
.ks-public-bar { border-bottom: 1px solid var(--bs-border-color); padding: .75rem 0; }
.ks-public-logo { height: 32px; width: auto; }
.ks-public-footer { border-top: 1px solid var(--bs-border-color); padding: 1.25rem 0; margin-top: 2rem; }
.ks-legal-reading { max-width: 70ch; line-height: 1.7; }
.ks-legal-reading .ks-legal-text h2, .ks-legal-reading .ks-legal-text h3 { scroll-margin-top: 1rem; }
.ks-legal-toc-aside .ks-legal-toc { position: sticky; top: 1rem; }
.ks-legal-toc summary { cursor: pointer; }

@media print {
  .ks-public-bar, .ks-public-footer, .ks-legal-toc, .ks-legal-toc-aside, .ks-legal-versions { display: none !important; }
  .ks-legal-reading { max-width: none; }
  .ks-legal-text a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  .ks-legal-text h2, .ks-legal-text h3 { break-after: avoid; }
}

/* Row 12b: the focused onboarding layout (layouts/focus.php) — a brand bar with Sign Out, one centred card, the step
   bar. Colours come from tokens, so it follows the user's theme. */
.ks-focus { min-height: 100vh; display: flex; flex-direction: column; }
.ks-focus-bar { background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color); }
.ks-focus-bar-inner { max-width: 560px; margin: 0 auto; padding: .5rem 1.25rem; display: flex; align-items: center; }
.ks-focus-logo { height: 28px; width: auto; }
.ks-logo-on-dark { display: none; }
[data-bs-theme=dark] .ks-logo-on-light { display: none; }
[data-bs-theme=dark] .ks-logo-on-dark { display: inline; }
.ks-focus-main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.ks-focus-card .card-body { padding: 1.5rem; }
@media (max-width: 575.98px) { .ks-focus-card .card-body { padding: 1.25rem; } }
.ks-focus-footer { text-align: center; padding: 1rem; display: flex; gap: .5rem; justify-content: center; }
.ks-check-row { padding-top: .6rem; padding-bottom: .6rem; min-height: 44px; }
.ks-check-row .form-check-input { width: 1.25em; height: 1.25em; }
.ks-focus .form-control, .ks-focus .btn { font-size: 1rem; }
.ks-focus .btn { min-height: 44px; }
.ks-steps-bar .ks-steps-seg { flex: 1; }
.ks-steps-bar .ks-steps-seg::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--bs-secondary-bg); }
.ks-steps-bar .ks-steps-seg.is-done::before { background: var(--ks-teal, var(--bs-primary)); }
.ks-steps-label { margin-top: .35rem; color: var(--bs-secondary-color); }
@media (prefers-reduced-motion: no-preference) {
  .ks-focus-card { animation: ks-rise .2s ease-out; }
  .ks-steps-bar .ks-steps-seg::before { transition: background-color .3s; }
}
@keyframes ks-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Row 12b: the onboarding Logo step's dropzone and preview. The preview plate is white in every theme: the logo
   prints on white paper. */
.ks-dropzone { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.75rem 1rem; text-align: center;
  border: 2px dashed var(--bs-border-color); border-radius: .5rem; cursor: pointer; min-height: 44px; }
.ks-dropzone:focus-within { outline: 0; box-shadow: var(--ks-focus-ring, 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25)); }
.ks-dropzone.is-dragging { border-color: var(--bs-primary); }
.ks-dropzone.is-invalid { border-color: var(--bs-form-invalid-border-color); }
.ks-dropzone-touch { display: none; }
@media (hover: none), (pointer: coarse) { .ks-dropzone-fine { display: none; } .ks-dropzone-touch { display: inline; } }
.ks-logo-plate { background: var(--bs-white); border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: 1rem; margin-bottom: .5rem; text-align: center; }
.ks-logo-plate img { max-width: 100%; max-height: 120px; }
@media (prefers-reduced-motion: no-preference) {
  .ks-dropzone { transition: border-color .15s; }
  .ks-logo-preview { animation: ks-rise .15s ease-out; }
}

/* Row 12b: the sign-up form on the auth layout — the label look of the sign-in page from a class, not inline styles,
   so the markup says "Company Name" and only the eye sees capitals; the honeypot off-screen. */
.ks-auth-label { font-size: .82rem; font-weight: 600; color: var(--bs-secondary-color); text-transform: uppercase; }
.ks-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
