/* HipLink portal - Bootstrap 5 theme overrides
   Brand colors pulled from legacy app_main.css: blue #0d5cab, accent orange #f26522 */

:root {
	--hiplink-blue: #0d5cab;
	--hiplink-blue-dark: #0a497e;
	--hiplink-blue-deeper: #072f52;
	--hiplink-orange: #f26522;
	--hiplink-ink: #13213a;
	--hiplink-mist: #6b7a90;
	--bs-primary: #0d5cab;
	--bs-primary-rgb: 13, 92, 171;
	--bs-link-color: #0d5cab;
	--bs-link-hover-color: #f26522;
}

body {
	font-family: "Segoe UI", Arial, Helvetica, sans-serif;
	background-color: #f5f7fa;
	color: #333;
}

h1, h2, h3 {
	color: var(--hiplink-blue);
}

a {
	color: var(--hiplink-blue);
}
a:hover {
	color: var(--hiplink-orange);
}

/* Header / navbar */
.navbar-hiplink {
	background-color: var(--hiplink-blue);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.navbar-hiplink .navbar-brand img {
	max-height: 48px;
}
.navbar-logo-img {
	filter: brightness(0) invert(1);
}
.navbar-hiplink .nav-link {
	color: rgba(255, 255, 255, 0.9);
	font-weight: 500;
	border-radius: 0.375rem;
}
.navbar-hiplink .nav-link.active,
.navbar-hiplink .nav-link:hover,
.navbar-hiplink .nav-link:focus {
	color: #ffffff;
	text-decoration: none;
}
.navbar-hiplink .nav-link.active {
	background-color: rgba(255, 255, 255, 0.14);
}
@media (min-width: 992px) {
	.navbar-hiplink .nav-link:hover {
		background-color: rgba(255, 255, 255, 0.1);
	}
}
.navbar-hiplink .navbar-text {
	color: #ffffff;
}
.navbar-hiplink .dropdown-toggle::after {
	vertical-align: 0.2em;
}
.navbar-hiplink .dropdown-menu {
	border: none;
	border-radius: 0.6rem;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
	padding: 0.4rem;
	margin-top: 0.5rem;
}
.navbar-hiplink .dropdown-item {
	border-radius: 0.4rem;
	padding: 0.5rem 0.75rem;
	font-weight: 500;
}
.navbar-hiplink .dropdown-item:hover,
.navbar-hiplink .dropdown-item:focus {
	background-color: rgba(13, 92, 171, 0.1);
	color: var(--hiplink-blue);
}

.portal-banner img {
	display: block;
	width: 100%;
	height: auto;
}

/* Footer */
.site-footer {
	background-color: var(--hiplink-blue);
	color: #e8f1fb;
}
.site-footer a {
	color: #e8f1fb;
}
.site-footer a:hover {
	color: var(--hiplink-orange);
}

/* Shared components */
.card-portal {
	border: none;
	border-radius: 0.75rem;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.btn-primary {
	background-color: var(--hiplink-blue);
	border-color: var(--hiplink-blue);
}
.btn-primary:hover,
.btn-primary:focus {
	background-color: var(--hiplink-blue-dark);
	border-color: var(--hiplink-blue-dark);
}

.btn-accent {
	background-color: var(--hiplink-orange);
	border-color: var(--hiplink-orange);
	color: #fff;
}
.btn-accent:hover {
	background-color: #d8551a;
	border-color: #d8551a;
	color: #fff;
}

.table thead th {
	background-color: var(--hiplink-blue);
	color: #fff;
	border-color: var(--hiplink-blue);
}
/* Paginator sort links sit inside the blue header; without this they inherit the
   blue link color and vanish against the blue background. */
.table thead th a {
	color: #fff;
}
.table thead th a:hover {
	color: #fff;
	text-decoration: underline;
}

/* CakePHP's built-in Session flash (e.g. AuthComponent's authError/loginError)
   renders as a bare <div class="message"> with no styling of its own - give it
   the same look as a Bootstrap alert so it matches the rest of the site.
   Scoped to the class only (not the #flashMessage/#authMessage id CakePHP also
   adds) so setFlash() calls that pass 'success-message'/'error-message' as the
   class aren't overridden by this default - an id selector would otherwise
   always beat those classes regardless of which one is applied. */
.message {
	position: relative;
	margin-bottom: 1rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid #ffe3b3;
	border-radius: 0.5rem;
	background-color: #fff8ec;
	color: #8a5a00;
}
.message::before {
	content: "\f33a";
	font-family: "bootstrap-icons";
	margin-right: 0.5rem;
}
.error-message {
	position: relative;
	margin-bottom: 1rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid #f1aeb5;
	border-radius: 0.5rem;
	background-color: #fdeeee;
	color: #842029;
}
.success-message {
	position: relative;
	margin-bottom: 1rem;
	padding: 0.75rem 1.25rem;
	border: 1px solid #a3cfbb;
	border-radius: 0.5rem;
	background-color: #eafaf1;
	color: #0f5132;
}
.success-message::before {
	content: "\f26a";
	font-family: "bootstrap-icons";
	margin-right: 0.5rem;
}

/* Legacy CakePHP 1.3 PaginatorHelper markup doesn't emit li.page-item, style the bare li/span instead */
.pagination li {
	display: inline-block;
}
.pagination li.current {
	display: inline-block;
	padding: 0.375rem 0.75rem;
	background-color: var(--hiplink-blue);
	border: 1px solid var(--hiplink-blue);
	color: #fff;
	border-radius: 0.25rem;
}

/* Embedded apps (forum, knowledge base) - keep the iframe from reading like
   a box-within-a-page while it loads / resizes itself to its content. */
.embed-frame-wrap {
	position: relative;
}
.embed-frame-wrap .embed-frame {
	width: 100%;
	border: 0;
	display: block;
	opacity: 0;
	transition: opacity 0.2s ease-in;
}
.embed-frame-wrap .embed-frame.is-ready {
	opacity: 1;
}
.embed-frame-wrap .embed-frame-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 320px;
	color: #6c757d;
}
.embed-frame-wrap .embed-frame-loading.is-hidden {
	display: none;
}

/* Login screen - split panel: brand context on the left, the actual task
   (signing in) on the right. Deliberately not a pair of equal-weight cards -
   one side explains what this portal is for, the other side is the form.
   The left panel's content is drawn from what the portal actually contains
   (download center / knowledge base / forum, matching the nav in
   app_header.ctp) rather than invented marketing copy or decoration. */
.auth-shell {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	min-height: 100vh;
}
.auth-brand {
	flex: 1 1 42%;
	min-width: 18rem;
	position: relative;
	background: linear-gradient(195deg, var(--hiplink-blue-dark) 0%, var(--hiplink-blue-deeper) 72%, #04101d 100%);
	color: #fff;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 2.5rem;
	padding: 3rem 3.25rem;
	overflow: hidden;
}
/* Faint coverage-map dot grid - a quiet nod to a paging network rather than
   a generic gradient wash; kept subtle enough to read as texture, not art. */
.auth-brand::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
	background-size: 22px 22px;
	mask-image: radial-gradient(ellipse 80% 60% at 20% 15%, #000 0%, transparent 70%);
	pointer-events: none;
}
.auth-brand-inner {
	position: relative;
	max-width: 23rem;
}
.auth-logo {
	display: inline-flex;
	align-self: flex-start;
	margin-bottom: 2.75rem;
}
.auth-logo img {
	display: block;
}
.auth-logo-img {
	filter: brightness(0) invert(1);
}
.auth-brand-foot {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.auth-brand-trust {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: 0.85rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.85);
}
.auth-brand-trust i {
	color: var(--hiplink-orange);
	font-size: 1rem;
}
.auth-brand-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.5);
}
.auth-brand-legal a {
	color: rgba(255, 255, 255, 0.68);
	text-decoration: none;
}
.auth-brand-legal a:hover {
	color: #fff;
	text-decoration: underline;
}
.auth-brand h1 {
	font-size: 1.95rem;
	line-height: 1.22;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: #fff;
	margin-bottom: 0.9rem;
}
.auth-brand p {
	color: rgba(255, 255, 255, 0.72);
	font-size: 1rem;
	line-height: 1.6;
	margin-bottom: 2rem;
}
.auth-feature-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.auth-feature-list li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.85);
}
.auth-feature-list li:first-child {
	border-top: none;
}
.auth-feature-list i {
	font-size: 1.05rem;
	color: rgba(255, 255, 255, 0.6);
	width: 1.25rem;
	text-align: center;
	flex-shrink: 0;
}

.auth-panel {
	flex: 1 1 54%;
	min-width: 18rem;
	background: #fbfcfe;
	display: flex;
	align-items: center;
	padding: 3rem;
}
.auth-panel-inner {
	width: 100%;
	max-width: 23rem;
}
.auth-panel h2 {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--hiplink-ink);
	margin-bottom: 0.4rem;
}
.auth-panel-lede {
	color: var(--hiplink-mist);
	font-size: 0.9rem;
	margin-bottom: 1.75rem;
}
.auth-panel label.form-label {
	font-weight: 600;
	font-size: 0.825rem;
	color: var(--hiplink-ink);
	margin-bottom: 0.4rem;
}
.auth-panel .form-control {
	padding: 0.6rem 0.85rem;
	border-color: #d7dee8;
}
.auth-panel .form-control:focus {
	border-color: var(--hiplink-blue);
	box-shadow: 0 0 0 0.2rem rgba(13, 92, 171, 0.14);
}
.auth-field-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}
.auth-field-row .form-label {
	margin-bottom: 0.4rem;
}
.auth-field-aside {
	font-size: 0.825rem;
	font-weight: 500;
	white-space: nowrap;
}
.auth-panel .btn-primary {
	padding: 0.65rem 1rem;
	font-weight: 600;
	letter-spacing: 0.01em;
}
.auth-footnote {
	margin-top: 1.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid #eef1f5;
	font-size: 0.875rem;
	color: var(--hiplink-mist);
	line-height: 1.6;
}

.auth-panel-inner-wide {
	max-width: 34rem;
}

.auth-stage {
	min-height: 100vh;
}

@media (max-width: 767.98px) {
	.auth-shell {
		min-height: auto;
	}
	.auth-brand,
	.auth-panel {
		flex: 1 1 100%;
		min-height: auto;
		padding: 2.25rem 1.5rem;
	}
	.auth-brand h1 {
		font-size: 1.5rem;
	}
}

/* Download Center page body - this is raw HTML a HipLink admin authored years
   ago via the TinyMCE editor (stored in the DB, not this template). Its
   classes (.heading/.sub_heading/.xmap/.sitemap) never had matching CSS
   anywhere in the app, so it rendered as unstyled plain text/lists. Give the
   existing classes real styling instead of touching the stored content. */
.download-content {
	line-height: 1.6;
}
.download-content h2 {
	font-size: 1.3rem !important;
	color: var(--hiplink-blue) !important;
	text-decoration: none !important;
	border-bottom: 2px solid #eef1f5;
	padding-bottom: 0.5rem;
	margin: 0 0 1rem;
}
.download-content .sub_heading {
	display: block;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--hiplink-ink);
	margin: 2rem 0 0.75rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid #eef1f5;
}
.download-content .heading:empty,
.download-content .sitemap:empty {
	display: none;
}
.download-content .heading > ul,
.download-content .sitemap ul,
.download-content > ul {
	list-style: none;
	padding-left: 0;
	margin: 0 0 0.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.download-content .heading > ul > li,
.download-content .sitemap ul > li,
.download-content > ul > li {
	margin: 0;
}
.download-content .heading > ul > li > a,
.download-content .sitemap ul > li > a,
.download-content > ul > li > a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.9rem;
	border-radius: 0.4rem;
	background: #f5f9ff;
	color: var(--hiplink-blue);
	font-weight: 500;
	font-size: 0.9rem;
	text-decoration: none;
	border: 1px solid #e3edfa;
}
.download-content .heading > ul > li > a:hover,
.download-content .sitemap ul > li > a:hover,
.download-content > ul > li > a:hover {
	background: var(--hiplink-blue);
	color: #fff;
	border-color: var(--hiplink-blue);
}
.download-content .heading > ul > li > a::before,
.download-content .sitemap ul > li > a::before,
.download-content > ul > li > a::before {
	content: "\f30a";
	font-family: "bootstrap-icons";
	font-size: 0.85em;
}
.download-content img[alt="New"] {
	vertical-align: middle;
	margin-left: 0.4rem;
}
.download-content > .xmap {
	background: #f5f7fa;
	border: 1px solid #eef1f5;
	border-radius: 0.6rem;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
}
.download-content > .xmap ul {
	margin: 0 0 0.5rem;
	padding-left: 1.2rem;
}
.download-content > .xmap > ul.level_0 {
	padding-left: 0;
	list-style: none;
}
.download-content > .xmap .level_0 > li > a {
	font-weight: 600;
	color: var(--hiplink-ink);
	text-decoration: none;
}
.download-content > .xmap .level_1 {
	font-size: 0.9rem;
}
