/* Client portal skin: loaded only for a portal account, after engine.css. The engine's tokens
   (--navy, --navy-2, --gold, --gold-2) are recoloured to the client's brand by an inline :root
   block in _head.html; this file restyles the few places engine.css paints a fixed colour and
   puts the client's logo in the menu bar. */

body.tpe::before {
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(var(--accent-rgb), .16), transparent 60%),
    radial-gradient(900px 520px at 100% 18%, rgba(var(--primary-rgb), .55), transparent 62%),
    radial-gradient(800px 800px at 50% 120%, rgba(var(--primary-rgb), .65), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy) 100%);
}
.tpe ::selection { background: rgba(var(--accent-rgb), .35); }

/* ---------- Menu bar ----------
   Opaque: every panel under it is white paper, and a see-through bar over paper turned the links
   white-on-light. The bar expands at 1200px (navbar-expand-xl in _nav.html); below that it folds into
   the floating menu. Between 1200 and 1919px decoration is dropped by width here, and the measuring
   script in _nav.html drops more (engine.css .fit-N) whenever the row still does not fit. */
.tpe .navbar.portal-nav { background-color: var(--navy); background-image: linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3));
  backdrop-filter: none; border-bottom: 1px solid rgba(var(--accent-rgb), .22); }
.tpe .navbar.portal-nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--brand-highlight) 0 56px, transparent 56px 60px, var(--brand-accent) 60px 100%); opacity: .85; }
/* The brand rule is a fixed red tab, a gap, then gold: at 12% of the width it read as a loading bar stuck on a phone. */
.tpe .portal-brand { gap: 12px; min-width: 0; }
.tpe .portal-logo-chip { display: inline-flex; align-items: center; height: 40px; padding: 4px 10px; border-radius: 10px;
  background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); flex: 0 0 auto; }
/* Both sides capped, neither fixed: a wide logo shrinks whole instead of being squeezed into 170 x 30. */
.tpe .portal-logo-chip img { width: auto; height: auto; max-height: 30px; max-width: 176px; object-fit: contain; display: block; }
.tpe .portal-logo-chip.square { width: 40px; padding: 4px; justify-content: center; }
.tpe .portal-logo-chip.square img { max-height: 32px; }
.tpe .portal-product { display: flex; flex-direction: column; line-height: 1.05; font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem; letter-spacing: .02em; color: #fff; white-space: nowrap; }
.tpe .portal-product small { font-family: Inter, sans-serif; font-weight: 500; font-size: .66rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-2); opacity: .9; margin-top: 2px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.tpe .portal-nav .nav-link { font-size: .9rem; }
.tpe .navbar .nav-link.active { background: rgba(var(--accent-rgb), .16); border-color: rgba(var(--accent-rgb), .32); }
@media (min-width: 992px) { .tpe .navbar .navbar-nav .nav-link.active { border-color: rgba(var(--accent-rgb), .32); } }
.tpe .portal-powered { color: var(--mist-2) !important; opacity: .75; font-size: .72rem; }

@media (min-width: 1200px) {
  .tpe .portal-nav .portal-brand { flex-shrink: 0; margin-right: 1.1rem; }
  .tpe .portal-nav .navbar-nav .nav-link { padding-left: .6rem; padding-right: .6rem; }
  /* The menus open as paper under the bar, like every panel on the page. */
  .tpe .portal-nav .dropdown-menu { background: #fbfaf7; border: 0; border-top: 3px solid var(--brand-accent); border-radius: 0 0 12px 12px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, .35); padding: 6px 0; margin-top: 9px !important; min-width: 240px;
    --bs-dropdown-link-active-bg: #eef1f8; --bs-dropdown-link-active-color: var(--brand-primary); }
  .tpe .portal-nav .dropdown-item { color: #13213a; font-size: .9rem; padding: .5rem 1rem; }
  .tpe .portal-nav .dropdown-item i.bi { color: var(--brand-primary); }
  .tpe .portal-nav .dropdown-item:hover, .tpe .portal-nav .dropdown-item:focus { background: #f1efe9; color: #13213a; }
  .tpe .portal-nav .dropdown-item.active, .tpe .portal-nav .dropdown-item:active, .tpe .portal-nav .dropdown-item[aria-current] {
    background: #eef1f8; color: var(--brand-primary); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-accent); }
  .tpe .portal-nav .dropdown-header { color: #6b7280; }
  .tpe .portal-nav .dropdown-divider { border-color: #e3e1dc; opacity: 1; }
  .tpe .portal-nav .portal-powered { color: #8a94a6 !important; opacity: 1; }
}
@media (min-width: 1200px) and (max-width: 1699.98px) { .tpe .portal-nav .navbar-nav .nav-link > i.bi { display: none; } }
@media (min-width: 1200px) and (max-width: 1439.98px) { .tpe .portal-nav .portal-brand > .portal-product { display: none; } }
@media (max-width: 1919.98px) { .tpe .portal-product small { display: none; } }

/* Folded (below 1200px): the floating menu, in the client's navy. engine.css draws it below 992px; the portal
   folds sooner, so the same panel is drawn here for 992-1199px too. */
@media (max-width: 1199.98px) {
  .tpe .portal-nav .navbar-collapse { position: absolute; top: calc(100% + 8px); left: 12px; right: 12px; z-index: 1040;
    background-color: var(--navy); background-image: linear-gradient(rgba(0, 0, 0, .18), rgba(0, 0, 0, .18));
    border: 1px solid var(--glass-b); border-radius: 16px; padding: .6rem; box-shadow: 0 30px 60px rgba(0, 0, 0, .55);
    max-height: calc(100vh - 90px); overflow-y: auto; }
  .tpe .portal-nav .navbar-collapse.collapsing { height: auto !important; transition: none; opacity: 0; }
  .tpe .portal-nav .navbar-collapse .nav-link { display: flex; height: auto; padding: .65rem .85rem; }
  .tpe .portal-nav .navbar-collapse .navbar-nav + .navbar-nav { border-top: 1px solid var(--glass-b); margin-top: .35rem; padding-top: .35rem; }
  .tpe .portal-nav .navbar-collapse .dropdown-menu { position: static !important; transform: none !important; background: transparent;
    border: 0; box-shadow: none; padding-left: .5rem; }
  .tpe .portal-nav .navbar-collapse #userName { display: inline-block; }
  .tpe .portal-nav .navbar-collapse .nav-link > i.bi { display: inline-block; }
}
@media (min-width: 576px) and (max-width: 1199.98px) { .tpe .portal-nav .portal-brand > .portal-product { display: flex; } }
@media (max-width: 575.98px) { .tpe .portal-logo-chip img { max-width: 120px; max-height: 26px; } }

/* ---------- Brand accents on the engine's components ---------- */
.btn-tpe, .tpe .btn-primary, .btn-gold { box-shadow: 0 8px 24px rgba(var(--accent-rgb), .25); }
.tpe .badge-gold, .tpe .pill.gold { background: rgba(var(--accent-rgb), .18); border-color: rgba(var(--accent-rgb), .35); }

/* ---------- Sign-in page ---------- */
.portal-gate .glass { background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid var(--glass-b);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.1); backdrop-filter: blur(12px); }
.portal-gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.portal-gate .story { padding: clamp(28px, 6vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: linear-gradient(160deg, rgba(var(--primary-rgb), .92), var(--navy) 70%); border-right: 1px solid rgba(var(--accent-rgb), .25); }
.portal-gate .story .logo-plate { background: #fff; border-radius: 16px; padding: 14px 18px; display: inline-flex; align-self: flex-start;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.portal-gate .story .logo-plate img { height: 56px; width: auto; max-width: min(360px, 70vw); }
.portal-gate .story h1 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.1; margin: 0; color: #fff; }
.portal-gate .story .rule { width: 72px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--brand-highlight) 0 30%, var(--brand-accent) 30%); }
.portal-gate .story ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: var(--mist); }
.portal-gate .story li { display: flex; gap: 10px; align-items: flex-start; }
.portal-gate .story li i { color: var(--gold-2); margin-top: 2px; }
.portal-gate .form-side { display: grid; place-items: center; padding: clamp(24px, 5vw, 64px); }
.portal-gate .form-card { width: 100%; max-width: 420px; }
.portal-gate .fine { color: var(--mist-2); font-size: .78rem; }
@media (max-width: 991.98px) {
  .portal-gate { grid-template-columns: 1fr; }
  .portal-gate .story { border-right: 0; border-bottom: 1px solid rgba(var(--accent-rgb), .25); }
  .portal-gate .story ul { display: none; }
}
/* Sign-in links are thumb targets on a phone, not 15px lines of text. */
.portal-gate a[href="/auth/forgot"], .portal-gate .tiny a { display: inline-block; padding: 8px 0; }
