/**
 * GCM Broker Portal — shared base styles (extracted chrome)
 * Shared CSS variables + top nav + secondary tab bar.
 * Page-specific styles are enqueued per template.
 */

:root {
  --navy: #1B2B4B;
  --navy-dark: #111C31;
  --green: #006837;
  --green-light: #2A7E45;
  --green-pale: #E3EDDC;
  --green-bright: #7EC870;
  --off-white: #F7F6F2;
  --white: #FFFFFF;
  --text: #111C31;
  --text-secondary: #4A5567;
  --muted: #5F6B7A;
  --subtitle: #B8C5D8;
  --border: #E2E6ED;
  --border-strong: #C3C9D4;
  --amber: #C8992A;
}

/* Portal pages own the full viewport chrome; suppress theme header markup. */
body.portal-template #header,
body.portal-template #menu,
body.portal-template #footer,
body.portal-template #sidebar,
body.portal-template .skip-link,
body.portal-template #site-description { display: none; }
body.portal-template #wrapper,
body.portal-template #container,
body.portal-template #content { margin: 0; padding: 0; max-width: none; width: 100%; }
/* "Full width page": match the default page container width. */
body.portal-template #content.portal-full-width { max-width: 1640px; margin: 0 auto; }

body.portal-template {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--off-white);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
body.portal-template a { color: inherit; text-decoration: none; }
body.portal-template h1,
body.portal-template h2,
body.portal-template h3,
body.portal-template h4 { font-family: 'Playfair Display', Georgia, serif; color: var(--navy-dark); }

/*
 * Neutralize the allied_mortgage theme's WOW.js / Animate.css entrance animations
 * on portal pages. The parent theme's customizer.js adds `.wow fadeInDown` (etc.)
 * to headings and the `the_content` filter injects the same classes server-side;
 * WOW.js then sets `visibility: hidden` until the element scrolls into view, which
 * causes a visible blink on load. Force the elements visible and skip the animation
 * so portal content renders immediately. No body-class scoping needed: this
 * stylesheet is only enqueued on portal templates (see portal-functions.php).
 */
.wow {
  visibility: visible !important;
  animation: none !important;
  -webkit-animation: none !important;
  opacity: 1 !important;
}

/* Inline SVG icon sizing */
.portal-scope .icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* === TOP NAV (navy) === */
.topnav {
  background: #099b55;
  color: #ffffff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav-brand { display: flex; align-items: center; gap: 12px; }
.topnav-logo { height: 30px; width: auto; display: block; }
.topnav-brand-sub-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.topnav-brand-sub {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: #ffffff;
  letter-spacing: 0.3px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.22);
}
.topnav-actions { display: flex; align-items: center; gap: 14px; }
.topnav-welcome { font-size: 13px; color: #ffffff; }
.topnav-icon { width: 18px; height: 18px; color: #ffffff; cursor: pointer; }
/* Temporarily hide notifications; keep space in the topnav */
.topnav-icon--notifications { visibility: hidden; pointer-events: none; }
.topnav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  color: var(--white);
  cursor: pointer;
  border: none;
  padding: 0;
}
.topnav-user-menu { position: relative; }
.topnav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 180px;
  padding: 6px 0;
  display: none;
  z-index: 200;
}
.topnav-dropdown.active { display: block; }
.topnav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  transition: background 0.15s;
}
/* Beat body.portal-template a { color: inherit } (inherits .topnav white) */
.topnav .topnav-dropdown-item { color: var(--text); }
.topnav-dropdown-item:hover { background: var(--off-white); }
.topnav .topnav-dropdown-icon { width: 16px; height: 16px; color: var(--muted); }
.topnav-hamburger {
  display: none;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  transition: background 0.15s;
}
.topnav-hamburger:hover { background: rgba(255,255,255,0.1); }
.topnav-hamburger .icon { width: 22px; height: 22px; color: var(--white); }
.topnav-logout { display: flex; align-items: center; }
.topnav-logout .topnav-icon { color: var(--subtitle); transition: color 0.15s; }
.topnav-logout:hover .topnav-icon { color: var(--white); }

/* === SECONDARY NAV (tabs) === */
.tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
}
/* .tabs .tab beats body.portal-template a { color: inherit } */
.tabs .tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #006837;
  white-space: nowrap;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.tabs .tab:hover { background: var(--green-pale); }
.tabs .tab.active { color: var(--white); background: #006837; }
.tabs .tab.active:hover { background: #006837; }
.tabs .tab.disabled { color: var(--muted); font-weight: 500; cursor: default; }
.tabs .tab.disabled:hover { background: transparent; }
.tabs .tab-soon { font-size: 10px; margin-left: 4px; color: var(--muted); }

@media (max-width: 900px) {
  .topnav-hamburger { display: block; }
  .topnav-welcome { display: none; }
  /* The tab strip becomes the hamburger menu — same markup, stacked */
  .tabs { display: none; }
  .tabs.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 14px 14px;
  }
  .tabs.open .tab { padding: 12px 14px; font-size: 14px; }
}

/* === WIDE HEADER === */
.gcm-wide-header * { margin: 0; padding: 0; box-sizing: border-box; }
.gcm-wide-header { font-family: 'DM Sans', system-ui, -apple-system, sans-serif; background: var(--off-white); color: var(--text); font-size: 14px; line-height: 1.5; }
.gcm-wide-header a { color: inherit; text-decoration: none; }
.gcm-wide-header h1, .gcm-wide-header h2, .gcm-wide-header h3, .gcm-wide-header h4 { font-family: 'Playfair Display', Georgia, serif; color: var(--navy-dark); }

/* === PORTAL FOOTER NOTE === */
.portal-footer-note {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  font-size: 12px;
  line-height: 1.5;
  color: #5f5f5f;
  text-align: right;
}
@media (min-width: 1024px) {
  .portal-footer-note { text-align: right; }
}

/* === PORTAL FOOTER BOTTOM === */
.portal-footer-bottom {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  flex-direction: column;
  text-align: left;
  gap: 0.5rem;
  font-size: 13px;
  color: #5f5f5f;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1rem 2rem;
  width: 100%;
  box-sizing: border-box;
}
@media (min-width: 1024px) {
  .portal-footer-bottom {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 1rem 0.75rem;
  }
  .portal-footer-bottom .footer-bottom__copyright {
    flex: none;
    white-space: nowrap;
  }
  .portal-footer-bottom .footer-bottom__navigation {
    margin-left: auto;
    margin-right: 2rem;
  }
}
@media (min-width: 1024px) and (max-width: 1399px) {
  .portal-footer-bottom {
    font-size: 11.5px;
  }
  .portal-footer-bottom .footer-bottom__navigation ul li:not(:last-child) {
    margin-right: 0.35rem;
    padding-right: 0.35rem;
  }
}
.portal-footer-bottom .footer-bottom__copyright {
  line-height: 1;
}
.portal-footer-bottom .footer-bottom__navigation ul {
  display: flex;
  flex-wrap: wrap;
  text-align: left;
  justify-content: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.portal-footer-bottom .footer-bottom__navigation ul li {
  display: flex;
  align-items: center;
}
.portal-footer-bottom .footer-bottom__navigation ul li:not(:last-child) {
  margin-right: 0.5rem;
  padding-right: 0.5rem;
  border-right: 1px solid #5f5f5f;
}
.portal-footer-bottom .footer-bottom__navigation ul li a {
  color: #5f5f5f;
  line-height: 1;
  text-decoration: none;
}
.portal-footer-bottom .footer-bottom__navigation ul li a:hover {
  color: #04673d;
  text-decoration: underline;
}
.portal-footer-bottom .footer-bottom__ehl {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
@media (min-width: 1024px) {
  .portal-footer-bottom .footer-bottom__ehl {
    justify-content: flex-start;
  }
}
.portal-footer-bottom .footer-bottom__ehl .ehl {
  width: 16px;
  height: auto;
  flex: none;
}

/* Hide bare SVG sprite and popup containers injected by wp_footer() after the portal footer. */
.portal-footer-bottom ~ svg,
.portal-footer-bottom ~ .sgpb-main-popup-data-container,
.portal-footer-bottom ~ div:empty {
  display: none !important;
}

.gcm-wide-header .hero { background: linear-gradient(135deg, #0B4A26 0%, #053B1B 100%); color: var(--white); padding: 32px 24px 30px; position: relative; overflow: hidden; border-radius: 0; }
.gcm-wide-header .hero::before { content: ""; position: absolute; inset: 0; opacity: 0.5; background-image: radial-gradient(ellipse 80% 60% at 80% 110%, rgba(126,200,112,0.10), transparent 60%), repeating-linear-gradient(115deg, transparent 0 38px, rgba(255,255,255,0.018) 38px 39px); pointer-events: none; }
.gcm-wide-header .hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(126,200,112,0.16), transparent 70%); }
.gcm-wide-header .hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; padding-left: 120px; }
.gcm-wide-header .hero-eyebrow { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--green-bright); font-weight: 600; margin-bottom: 8px; }
.gcm-wide-header .hero h1 { color: var(--white); font-size: 32px; font-weight: 900; line-height: 1.1; }
.gcm-wide-header .hero p { color: var(--subtitle); margin-top: 8px; font-size: 14px; max-width: 560px; }

@media (max-width: 768px) {
  .gcm-wide-header .hero h1 { font-size: 24px; }
  .gcm-wide-header .hero p { font-size: 13px; }
  .gcm-wide-header .hero-inner { padding-left: 24px; }
}
