/*
 * Branded sign-in page (classes/portal_brand.inc.php → themes_F::drawLoginForm).
 *
 * Drawn as its own full-screen layer over the admin template, so none of the
 * template's Bootstrap rules have to be fought one by one: everything below is
 * scoped to .pb and sets its own fonts, colours and box model. The palette is
 * the website's (assets/css/style.css) so the two read as one product.
 *
 * Theme: data-theme="dark"/"light" when the website passed ?theme=, otherwise
 * the visitor's system setting decides.
 */
.pb {
  --g800: #0d5424; --g700: #126a30; --g600: #16813a; --g500: #1e8c3a; --g300: #5fd487; --g100: #d9efe0;
  --t900: #122019; --t700: #33473c; --t500: #5c6f64;
  --line: #dfe9e2; --bg: #f4f9f6; --card: #ffffff; --field: #f4f9f6;
  --err-bg: #fdf2ef; --err-line: #e7b9ae; --err-text: #8a2f1f;
  --logo-light: block; --logo-dark: none;

  position: fixed; inset: 0; z-index: 99999; overflow-y: auto;
  background: var(--bg); color: var(--t700);
  font-family: "Plus Jakarta Sans", "Anek Bangla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
.pb[lang="bn"] { font-family: "Anek Bangla", "Plus Jakarta Sans", system-ui, sans-serif; }
.pb[data-theme="dark"] {
  --t900: #eaf5ee; --t700: #bdd3c6; --t500: #8aa697;
  --line: #1d3b28; --bg: #0a1810; --card: #112619; --field: #0d2014; --g100: #1c4a2e;
  --err-bg: rgba(208, 91, 75, .12); --err-line: rgba(208, 91, 75, .45); --err-text: #f3b8ab;
  --logo-light: none; --logo-dark: block;
}
@media (prefers-color-scheme: dark) {
  .pb:not([data-theme="light"]) {
    --t900: #eaf5ee; --t700: #bdd3c6; --t500: #8aa697;
    --line: #1d3b28; --bg: #0a1810; --card: #112619; --field: #0d2014; --g100: #1c4a2e;
    --err-bg: rgba(208, 91, 75, .12); --err-line: rgba(208, 91, 75, .45); --err-text: #f3b8ab;
    --logo-light: none; --logo-dark: block;
  }
}
.pb *, .pb *::before, .pb *::after { box-sizing: border-box; }
.pb a { color: var(--g600); text-decoration: none; font-weight: 700; }
.pb[data-theme="dark"] a { color: var(--g300); }
@media (prefers-color-scheme: dark) { .pb:not([data-theme="light"]) a { color: var(--g300); } }
.pb a:hover { text-decoration: underline; }
.pb h1, .pb h2, .pb p { margin: 0; }

.pb-shell { min-height: 100%; display: grid; grid-template-columns: minmax(340px, 44%) 1fr; }

/* ---- brand side ---- */
.pb-side {
  position: relative; overflow: hidden; color: #eaf5ee;
  padding: 36px 48px; display: flex; flex-direction: column; gap: 22px;
  background:
    radial-gradient(circle at 18% 12%, rgba(95, 212, 135, .20), transparent 42%),
    radial-gradient(circle at 85% 90%, rgba(30, 140, 58, .35), transparent 45%),
    linear-gradient(160deg, #0d3d1d 0%, #07200f 60%, #041208 100%);
}
.pb-side::before {                       /* the website's dotted network, as texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(95, 212, 135, .55) 1.2px, transparent 1.3px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.pb-side > * { position: relative; }
.pb .pb-back { color: #bfe8cd; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; }
.pb .pb-back:hover { color: #fff; }
.pb-side-body { margin: auto 0; display: grid; gap: 18px; max-width: 440px; }
.pb-side-logo { height: 42px; width: auto; }
.pb-side h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.15; color: #fff; letter-spacing: -.02em; font-weight: 800; }
.pb-side h1 span { color: var(--g300); }
.pb-side p { color: #bdd3c6; font-size: 1rem; }
.pb-points { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 12px; }
.pb-points li { display: flex; gap: 12px; align-items: center; color: #dcefe3; font-weight: 600; }
.pb-points svg { flex: none; color: var(--g300); }
.pb-slogan { color: #8fbfa0 !important; font-size: .85rem !important; font-weight: 600; letter-spacing: .02em; }

/* ---- form side ---- */
.pb-main { display: flex; flex-direction: column; padding: 22px 32px 26px; }
.pb-top { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.pb-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.pb .pb-switch a { padding: 5px 12px; font-size: .8rem; color: var(--t500); font-weight: 700; }
.pb .pb-switch a.on { background: var(--g600); color: #fff; }
.pb .pb-switch a:hover { text-decoration: none; }
.pb .pb-theme {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; color: var(--t700);
}
.pb-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 0; }
.pb-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 36px 34px; box-shadow: 0 24px 60px -30px rgba(10, 40, 20, .35);
}
.pb-card-logo { display: none; height: 34px; width: auto; margin-bottom: 22px; }
.pb-card h2 { font-size: 1.6rem; font-weight: 800; color: var(--t900); letter-spacing: -.01em; }
.pb-card .pb-lead { color: var(--t500); margin: 6px 0 24px; }
.pb-error {
  border: 1px solid var(--err-line); background: var(--err-bg); color: var(--err-text);
  border-radius: 12px; padding: 11px 14px; font-size: .9rem; margin-bottom: 18px;
}
.pb-field { display: grid; gap: 7px; margin-bottom: 16px; }
.pb-field label { font-weight: 700; font-size: .9rem; color: var(--t900); }
.pb-field input {
  width: 100%; font: inherit; color: var(--t900); background: var(--field);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 50px;
}
.pb-field input:focus { outline: none; border-color: var(--g500); box-shadow: 0 0 0 3px rgba(30, 140, 58, .18); }
.pb-pass { position: relative; }
.pb-pass input { padding-right: 50px; }
.pb-pass button {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: none; color: var(--t500); cursor: pointer; border-radius: 10px;
}
.pb-pass button:hover { color: var(--g600); }
.pb-submit {
  width: 100%; margin-top: 8px; min-height: 50px; border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1rem; color: #fff;
  background: linear-gradient(135deg, var(--g500), var(--g700));
  box-shadow: 0 12px 26px -14px rgba(22, 129, 58, .9);
}
.pb-submit:hover { filter: brightness(1.06); }
.pb-submit:focus-visible { outline: 3px solid var(--g300); outline-offset: 2px; }
.pb-alt { text-align: center; margin-top: 22px !important; color: var(--t500); font-size: .92rem; }
.pb-help { text-align: center; margin-top: 8px !important; color: var(--t500); font-size: .85rem; }
.pb-foot { text-align: center; color: var(--t500); font-size: .8rem; }
.pb-foot a { font-weight: 600; }

.pb .pb-logo-light { display: var(--logo-light); }
.pb .pb-logo-dark  { display: var(--logo-dark); }
.pb .pb-card-logo  { display: none; }            /* the brand panel carries the logo on wide screens */

@media (max-width: 900px) {
  .pb-shell { grid-template-columns: 1fr; }
  .pb-side { display: none; }
  .pb .pb-card-logo.pb-logo-light { display: var(--logo-light); }
  .pb .pb-card-logo.pb-logo-dark  { display: var(--logo-dark); }
  .pb-main { padding: 16px 16px 22px; }
  .pb-top { justify-content: space-between; }
  .pb-card { padding: 28px 22px; border-radius: 18px; }
}
.pb-top .pb-mback { display: none; font-size: .85rem; font-weight: 600; }
@media (max-width: 900px) { .pb-top .pb-mback { display: inline-flex; } }
