/* ==========================================================================
   TimeterestPay — Fancy Header + Mega Menu
   Brand: navy #192F7A · red #F0445E
   ========================================================================== */
:root {
  --tp-navy: #192F7A;
  --tp-red: #F0445E;
  --tp-ink: #141a2e;
  --tp-mut: #64708c;
  --tp-line: rgba(25, 47, 122, .08);
}

/* ---------- Header shell ---------- */
.tp-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.tp-header-bar {
  position: relative;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--tp-line);
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.tp-header.tp-scrolled .tp-header-bar {
  background: rgba(255, 255, 255, .97);
  border-bottom-color: rgba(25, 47, 122, .1);
  box-shadow: 0 12px 40px rgba(25, 47, 122, .10);
}

.tp-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3.5vw, 64px);
}

.tp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 78px;
}

.tp-logo img {
  height: 42px;
  width: auto;
  display: block;
}

/* ---------- Desktop nav ---------- */
.tp-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.tp-nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tp-nav-item { position: static; }

.tp-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tp-navy);
  text-decoration: none;
  border-radius: 10px;
  transition: color .2s ease, background .2s ease;
  white-space: nowrap;
}

.tp-nav-link:hover {
  color: var(--tp-red);
  background: rgba(240, 68, 94, .07);
}

.tp-caret {
  font-size: 10px;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.tp-nav-item:hover .tp-caret,
.tp-nav-item.tp-open .tp-caret { transform: rotate(180deg); }

/* ---------- Mega menu panel ---------- */
.tp-mega {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  width: min(880px, calc(100vw - 48px));
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, transform .3s cubic-bezier(.16, 1, .3, 1), visibility .3s;
  z-index: 60;
}

/* invisible bridge: keeps the menu open while the cursor travels from the
   nav item down into the panel (covers the gap below the nav links) */
.tp-mega::before {
  content: "";
  position: absolute;
  top: -36px;
  left: 0;
  right: 0;
  height: 36px;
}

.tp-mega-inner {
  background: #fff;
  border: 1px solid rgba(25, 47, 122, .07);
  border-radius: 22px;
  box-shadow: 0 34px 90px rgba(25, 47, 122, .20);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 264px;
  gap: 26px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.tp-mega--lg { width: min(1060px, calc(100vw - 48px)); }
.tp-mega--small { width: min(660px, calc(100vw - 48px)); }
.tp-mega--small .tp-mega-inner { grid-template-columns: 1fr 220px; }

.tp-nav-item:hover .tp-mega,
.tp-nav-item.tp-open .tp-mega {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.tp-mega-main { min-width: 0; }

.tp-mega-eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tp-red);
  margin-bottom: 14px;
}

.tp-mega-grid {
  display: grid;
  gap: 4px;
}

.tp-mega-grid--4 { grid-template-columns: repeat(4, 1fr); }
.tp-mega-grid--3 { grid-template-columns: repeat(3, 1fr); }
.tp-mega-grid--2 { grid-template-columns: repeat(2, 1fr); }

.tp-mega-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  text-decoration: none;
  animation: tpMegaIn .45s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--d, 0ms);
  transition: background .2s ease, transform .2s ease;
}

@keyframes tpMegaIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tp-mega-item:hover {
  background: #f5f6fd;
  transform: translateY(-2px);
}

.tp-mega-ic {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--tp-red);
  background: linear-gradient(135deg, rgba(240, 68, 94, .13), rgba(25, 47, 122, .09));
  transition: transform .2s ease, color .2s ease, background .2s ease;
}

.tp-mega-item:hover .tp-mega-ic {
  transform: scale(1.06);
  color: #fff;
  background: linear-gradient(135deg, var(--tp-red), #ff7a8c);
}

.tp-mega-tx strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--tp-ink);
  line-height: 1.3;
}

.tp-mega-tx small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--tp-mut);
}

/* ---------- Featured CTA panel ---------- */
.tp-mega-feat {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 26px 22px;
  color: #fff;
  background: linear-gradient(140deg, #192F7A 0%, #43279b 55%, #F0445E 135%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.tp-mega-feat::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  top: -78px;
  right: -64px;
  pointer-events: none;
}

.tp-mega-feat--alt { background: linear-gradient(140deg, #F0445E 0%, #b0306a 60%, #192F7A 140%); }

.tp-feat-tag {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.tp-mega-feat h4 {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 8px;
}

.tp-mega-feat p {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  line-height: 1.6;
  opacity: .92;
  margin: 0 0 18px;
}

.tp-feat-btn {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  color: var(--tp-navy);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 11px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(10, 12, 40, .22);
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}

.tp-feat-btn:hover {
  transform: translateY(-2px);
  color: var(--tp-red);
  box-shadow: 0 14px 30px rgba(10, 12, 40, .28);
}

/* ---------- Right side: help / lang / actions ---------- */
.tp-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tp-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-navy);
  text-decoration: none;
  border-radius: 10px;
  transition: color .2s ease, background .2s ease;
}

.tp-help:hover { color: var(--tp-red); background: rgba(240, 68, 94, .07); }

/* language (nice-select plugin keeps .nice-select wrapper) */
.tp-lang .nice-select {
  height: 44px;
  line-height: 44px;
  border-radius: 12px;
  border: 1.5px solid rgba(25, 47, 122, .14);
  font-size: 13px;
  font-weight: 600;
  color: var(--tp-navy);
  background: #fff;
  padding: 0 38px 0 16px;
  float: none;
  transition: border-color .2s ease;
}

.tp-lang .nice-select:hover { border-color: rgba(240, 68, 94, .5); }

.tp-lang .nice-select .list {
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(25, 47, 122, .18);
  border: 1px solid var(--tp-line);
  min-width: 100%;
}

.tp-lang .nice-select .option { font-size: 13px; color: var(--tp-navy); }

.tp-header-actions { display: flex; align-items: center; gap: 10px; }

/* buttons */
.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, color .22s ease;
  line-height: 1;
}

.tp-btn-solid {
  background: linear-gradient(135deg, #F0445E 0%, #d62a54 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(240, 68, 94, .32);
}

.tp-btn-solid:hover {
  transform: translateY(-2px);
  color: #fff;
  box-shadow: 0 14px 30px rgba(240, 68, 94, .42);
}

.tp-btn-ghost {
  background: #fff;
  color: var(--tp-navy);
  border: 1.5px solid rgba(25, 47, 122, .18);
}

.tp-btn-ghost:hover {
  transform: translateY(-2px);
  color: var(--tp-red);
  border-color: var(--tp-red);
  box-shadow: 0 10px 24px rgba(25, 47, 122, .10);
}

/* ---------- Burger ---------- */
.tp-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: 1.5px solid rgba(25, 47, 122, .14);
  background: #fff;
  cursor: pointer;
  padding: 0 11px;
}

.tp-burger span {
  display: block;
  height: 2.4px;
  border-radius: 4px;
  background: var(--tp-navy);
  transition: transform .3s ease, opacity .3s ease;
}

.tp-drawer-open .tp-burger span:nth-child(1) { transform: translateY(7.4px) rotate(45deg); }
.tp-drawer-open .tp-burger span:nth-child(2) { opacity: 0; }
.tp-drawer-open .tp-burger span:nth-child(3) { transform: translateY(-7.4px) rotate(-45deg); }

/* ---------- Mobile drawer ---------- */
.tp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 94vw);
  background: #fff;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  visibility: hidden;
  transition: transform .38s cubic-bezier(.22, 1, .36, 1), visibility .38s;
  box-shadow: -30px 0 80px rgba(10, 12, 40, .25);
}

.tp-drawer.tp-drawer-open {
  transform: translateX(0);
  visibility: visible;
}

.tp-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 18, 43, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.tp-drawer-overlay.tp-drawer-open { opacity: 1; visibility: visible; }

body.tp-no-scroll { overflow: hidden; }

.tp-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #eef0f8;
}

.tp-drawer-head .tp-logo img { height: 36px; }

.tp-drawer-close {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: none;
  background: #f3f5fb;
  color: var(--tp-navy);
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.tp-drawer-close:hover { background: rgba(240, 68, 94, .1); color: var(--tp-red); transform: rotate(90deg); }

.tp-drawer-body { flex: 1; overflow-y: auto; padding: 8px 22px; }

.tp-drawer-nav { list-style: none; margin: 0; padding: 0; }

.tp-acc-item { border-bottom: 1px solid #eef0f8; }

.tp-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 2px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--tp-navy);
  cursor: pointer;
  text-align: left;
}

.tp-acc-head i { font-size: 12px; color: var(--tp-mut); transition: transform .28s ease, color .2s ease; }

.tp-acc-item.tp-acc-open .tp-acc-head i { transform: rotate(180deg); color: var(--tp-red); }

.tp-acc-head--link { text-decoration: none; }

.tp-acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .38s cubic-bezier(.4, 0, .2, 1);
}

.tp-acc-body a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 4px 11px 8px;
  color: #4b5568;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
  transition: background .18s ease, color .18s ease, padding-left .18s ease;
}

.tp-acc-body a:hover { background: #f5f6fd; color: var(--tp-navy); padding-left: 13px; }

.tp-acc-body a i { width: 20px; text-align: center; color: var(--tp-red); font-size: 13px; }

.tp-acc-link--hot { color: var(--tp-red) !important; font-weight: 700 !important; }

.tp-drawer-foot {
  padding: 18px 22px 26px;
  border-top: 1px solid #eef0f8;
  display: grid;
  gap: 14px;
}

.tp-drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tp-drawer-actions .tp-btn { width: 100%; }

.tp-drawer-lang .nice-select { width: 100%; float: none; }

/* ---------- Responsive ---------- */
/* Desktop nav hides below 1100px (fits typical laptop windows incl. 1150px) */
@media (max-width: 1099.98px) {
  html.js .tp-nav { display: none; }
  html.js .tp-help,
  html.js .tp-header-actions { display: none; }
  .tp-burger { display: flex; }
  .tp-header-inner { height: 70px; }
}

/* Compact mode: 1100px - 1340px — tighten spacing so full nav + CTAs fit */
@media (min-width: 1100px) and (max-width: 1339.98px) {
  .tp-container { padding: 0 16px; }
  .tp-header-inner { gap: 10px; height: 72px; }
  .tp-logo img { height: 36px; }
  .tp-nav-link { padding: 9px 10px; font-size: 14px; }
  .tp-header-right { gap: 8px; }
  .tp-help { padding: 8px 8px; font-size: 13px; }
  .tp-help span { display: none; }
  .tp-help i { font-size: 15px; }
  .tp-lang .nice-select { height: 40px; line-height: 40px; padding: 0 32px 0 12px; font-size: 12.5px; }
  .tp-btn { padding: 10px 16px; font-size: 13px; }
  .tp-header-actions { gap: 6px; }
  .tp-mega { padding: 0; }
  .tp-mega-inner { padding: 20px; gap: 20px; }
  /* keep 4 columns for Personal even in compact mode (else it gets too tall) */
  .tp-mega-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 575.98px) {
  .tp-container { padding: 0 16px; }
  .tp-logo img { height: 34px; }
  .tp-lang .nice-select { display: none; } /* keep header clean on small phones; lang lives in drawer */
  .tp-header-inner { gap: 12px; }
}

/* ---------- No-JS fallback (Opera Mini / proxy renderers) ----------
   When JS never runs, html:not(.js): show the nav as a stacked list so
   every link stays reachable. Drawer + burger are hidden. */
html:not(.js) .tp-nav { display: block !important; }
html:not(.js) .tp-nav-list { flex-direction: column; align-items: stretch; padding: 10px 0 16px; }
html:not(.js) .tp-nav-link { width: 100%; justify-content: space-between; }
/* Without JS the mega panels cannot open — hide them so the page stays
   clean instead of dumping every menu item into the layout. */
html:not(.js) .tp-mega { display: none !important; }
html:not(.js) .tp-burger,
html:not(.js) .tp-drawer,
html:not(.js) .tp-drawer-overlay { display: none !important; }
html:not(.js) .tp-help,
html:not(.js) .tp-header-actions { display: inline-flex; }
@media (max-width: 1099.98px) {
  html:not(.js) .tp-header-actions { display: inline-flex; }
}

/* Role login links (agent/merchant) — header + drawer */
.tp-header-rolelinks{display:inline-flex;align-items:center;gap:10px;margin-left:8px;font-size:13px;font-weight:600;white-space:nowrap}
.tp-header-rolelinks a{color:#192F7A;text-decoration:none;transition:color .2s}
.tp-header-rolelinks a:hover{color:#4A6CF7}
.tp-header-rolelinks-sep{color:#C9CDE0}
.tp-drawer-rolelinks{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:12px;font-size:13px;font-weight:600}
.tp-drawer-rolelinks a{color:#192F7A;text-decoration:none;transition:color .2s}
.tp-drawer-rolelinks a:hover{color:#4A6CF7}
.tp-drawer-rolelinks-sep{color:#C9CDE0}
