/* =========================================================
   Keystone Technology Partners - Global styles
   Header + Footer + shared components
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --ktp-primary: #0047BB;
  --ktp-primary-dark: #1E4B9E;
  --ktp-secondary: #4D89C7;
  --ktp-hero-tint: #EAF3FA;
  --ktp-heading: #22252A;
  --ktp-text: #444444;
  --ktp-muted: #7A7A7A;
  --ktp-bg-light: #F6F6F6;
  --ktp-footer-bg: #E9E8E6;
  --ktp-white: #FFFFFF;

  --ktp-font: 'Poppins', sans-serif;
  --ktp-radius-card: 10px;
  --ktp-radius-pill: 50px;
  --ktp-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  --ktp-shadow-lg: 0 14px 34px rgba(0, 71, 187, .22);
  --ktp-ease: cubic-bezier(.22, .61, .36, 1);
  --ktp-max: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--ktp-font); color: var(--ktp-text); line-height: 1.6; background: var(--ktp-white); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ktp-heading); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
.ktp-container { width: 100%; max-width: var(--ktp-max); margin: 0 auto; padding: 0 20px; }
.ktp-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.ktp-lock { overflow: hidden; }

/* ---------- Button ---------- */
.ktp-btn {
  display: inline-block; background: var(--ktp-primary); color: #fff; border: 0; cursor: pointer;
  border-radius: var(--ktp-radius-pill); padding: 13px 30px; font: 600 13px/1 var(--ktp-font);
  text-transform: uppercase; letter-spacing: .5px;
  transition: background .25s, transform .25s var(--ktp-ease), box-shadow .25s;
}
.ktp-btn:hover, .ktp-btn:focus-visible { background: var(--ktp-primary-dark); transform: translateY(-2px); box-shadow: var(--ktp-shadow-lg); }

/* ---------- Top bar ---------- */
.ktp-topbar { background: var(--ktp-white); font-size: 15px; font-weight: 600; }
.ktp-topbar__inner { display: flex; justify-content: space-between; align-items: center; min-height: 64px; }
.ktp-topbar__phone { display: inline-flex; align-items: center; gap: 8px; color: var(--ktp-heading); transition: color .2s; }
.ktp-topbar__phone:hover { color: var(--ktp-primary); }
.ktp-topbar__phone svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }

.ktp-social { display: flex; gap: 10px; padding-right: 22px; border-right: 1px solid #e3e3e3; }
.ktp-social a {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  color: var(--ktp-heading); transition: background .25s, color .25s, transform .25s;
}
.ktp-social svg { width: 16px; fill: currentColor; }
.ktp-social a:hover { background: var(--ktp-primary); color: #fff; transform: translateY(-2px); }

/* ---------- Header ---------- */
.ktp-header { position: sticky; top: 0; z-index: 900; background: rgba(255,255,255,.97); transition: box-shadow .3s, padding .3s; }
.ktp-header.is-scrolled { box-shadow: 0 6px 20px rgba(0,0,0,.08); backdrop-filter: blur(6px); }
.ktp-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 96px; transition: min-height .3s; }
.ktp-header.is-scrolled .ktp-header__inner { min-height: 68px; }
.ktp-logo img { width: 222px; transition: width .3s; }
.ktp-header.is-scrolled .ktp-logo img { width: 190px; }

.ktp-nav { display: flex; align-items: center; }
.ktp-menu, .ktp-sub { list-style: none; margin: 0; padding: 0; }
.ktp-menu { display: flex; gap: 30px; }
.ktp-menu > li { position: relative; }
.ktp-menu > li > a {
  display: block; padding: 10px 0; font-size: 17px; font-weight: 500; color: var(--ktp-heading); position: relative; transition: color .2s;
}
.ktp-menu > li > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; background: var(--ktp-primary);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ktp-ease);
}
.ktp-menu > li:hover > a, .ktp-menu a.is-active { color: var(--ktp-primary); }
.ktp-menu > li:hover > a::after, .ktp-menu > li > a.is-active::after { transform: scaleX(1); }

/* dropdown arrow */
.ktp-sub .has-sub > a { padding-right: 34px !important; }
.ktp-sub .has-sub > a::before {
  content: ""; position: absolute; right: 18px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .25s;
}
.ktp-sub-toggle { display: none; }

/* desktop dropdowns */
@media (min-width: 1025px) {
  .ktp-menu > .has-sub > .ktp-sub { left: -22px; }
  .ktp-sub {
    position: absolute; top: 100%; left: 0; min-width: 270px; background: #fff; border-radius: var(--ktp-radius-card);
    box-shadow: 0 16px 40px rgba(0,0,0,.12); padding: 10px 0; border-top: 3px solid var(--ktp-primary);
    opacity: 0; visibility: hidden; transform: translateY(12px); transition: all .3s var(--ktp-ease);
  }
  .has-sub:hover > .ktp-sub, .has-sub:focus-within > .ktp-sub { opacity: 1; visibility: visible; transform: translateY(0); }
  .ktp-sub .ktp-sub { top: -13px; left: 100%; }
  .ktp-sub li { position: relative; }
  .ktp-sub a { display: block; padding: 9px 22px; font-size: 14px; color: var(--ktp-text); transition: color .2s, padding .25s, background .2s; position: relative; }
  .ktp-sub a:hover, .ktp-sub a.is-active { color: var(--ktp-primary); background: var(--ktp-hero-tint); padding-left: 28px; }
  .ktp-sub .has-sub > a::before { transform: rotate(-45deg); margin-top: -3px; }
}

/* ---------- Mobile nav ---------- */
.ktp-burger { display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; position: relative; z-index: 1001; }
.ktp-burger span { display: block; width: 26px; height: 2.5px; margin: 5px auto; background: var(--ktp-heading); border-radius: 2px; transition: transform .3s, opacity .3s; }
.ktp-burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.ktp-burger.is-open span:nth-child(2) { opacity: 0; }
.ktp-burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.ktp-overlay { position: fixed; inset: 0; background: rgba(15,25,45,.45); opacity: 0; visibility: hidden; transition: .3s; z-index: 899; }
.ktp-overlay.is-open { opacity: 1; visibility: visible; }

@media (max-width: 1200px) and (min-width: 1025px) { .ktp-menu { gap: 20px; } .ktp-menu > li > a { font-size: 15.5px; } .ktp-logo img { width: 190px; } }

@media (max-width: 1024px) {
  .ktp-burger { display: block; }
  .ktp-nav {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(340px, 86vw); background: #fff; z-index: 1000;
    flex-direction: column; align-items: stretch; gap: 0; padding: 90px 22px 30px; overflow-y: auto;
    transform: translateX(100%); visibility: hidden; transition: transform .4s var(--ktp-ease), visibility .4s;
  }
  .ktp-nav.is-open { transform: translateX(0); visibility: visible; box-shadow: -10px 0 30px rgba(0,0,0,.12); }
  .ktp-menu { flex-direction: column; gap: 0; }
  .ktp-menu li { position: relative; border-bottom: 1px solid #eef0f3; }
  .ktp-menu > li > a { padding: 14px 4px; font-size: 15.5px; }
  .ktp-menu > li > a::after, .has-sub > a::before { display: none; }
  .ktp-sub-toggle {
    display: block; position: absolute; right: 0; top: 6px; width: 40px; height: 40px; border: 0; border-radius: 8px;
    background: var(--ktp-hero-tint); cursor: pointer;
  }
  .ktp-sub-toggle::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -6px 0 0 -4px;
    border-right: 2px solid var(--ktp-primary); border-bottom: 2px solid var(--ktp-primary); transform: rotate(45deg); transition: transform .3s;
  }
  .ktp-sub-toggle[aria-expanded="true"]::before { transform: rotate(-135deg); margin-top: -2px; }
  .ktp-sub { max-height: 0; overflow: hidden; transition: max-height .4s var(--ktp-ease); padding-left: 14px; }
  .ktp-sub.is-open { max-height: 800px; }
  .ktp-sub li { border-bottom: 0; }
  .ktp-sub a { display: block; padding: 10px 4px; font-size: 14.5px; color: var(--ktp-text); }
  .ktp-sub a:hover, .ktp-sub a.is-active { color: var(--ktp-primary); }
  .ktp-sub .ktp-sub-toggle { top: 2px; width: 36px; height: 36px; }
}

@media (max-width: 600px) {
  .ktp-topbar { font-size: 12px; }
  .ktp-topbar__inner { min-height: 46px; }
  .ktp-topbar { font-size: 13px; }
  .ktp-social { padding-right: 0; border-right: 0; gap: 4px; }
  .ktp-header__inner { min-height: 72px; }
  .ktp-logo img { width: 170px; }
}

/* ---------- Footer ---------- */
.ktp-footer { font-size: 16px; }
.ktp-footer__main { background: var(--ktp-footer-bg); }
.ktp-footer__grid { display: grid; grid-template-columns: 1.55fr 1fr 1.35fr; gap: 40px; padding: 72px 20px 70px; }
.ktp-footer__logo { display: inline-block; margin-bottom: 30px; }
.ktp-footer__logo img { width: 270px; }
.ktp-footer__title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; color: #000; margin: 6px 0 24px; }

.ktp-contact, .ktp-links { list-style: none; margin: 0; padding: 0; }
.ktp-contact li { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; color: var(--ktp-heading); font-size: 17px; line-height: 1.5; }
.ktp-contact svg { flex: 0 0 24px; width: 24px; height: 24px; fill: none; stroke: var(--ktp-heading); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; transition: stroke .25s; }
.ktp-contact li:hover svg { stroke: var(--ktp-primary); }
.ktp-contact a { transition: color .2s; word-break: break-word; }
.ktp-contact a:hover { color: var(--ktp-primary); }

.ktp-links li { margin-bottom: 18px; }
.ktp-links a { font-size: 19px; color: #969696; display: inline-block; transition: color .25s, transform .25s var(--ktp-ease); }
.ktp-links a:hover, .ktp-links a.is-active { color: var(--ktp-primary); transform: translateX(6px); }

.ktp-newsletter { display: flex; flex-direction: column; gap: 12px; max-width: 380px; }
.ktp-newsletter input {
  width: 100%; padding: 13px 18px; border: 1px solid #d4d2ce; border-radius: 6px;
  font: 15px var(--ktp-font); background: #fff; outline: none; transition: border-color .25s, box-shadow .25s;
}
.ktp-newsletter input:focus { border-color: var(--ktp-primary); box-shadow: 0 0 0 4px rgba(0,71,187,.12); }
.ktp-newsletter input.is-error { border-color: #d93025; }
.ktp-newsletter .ktp-btn { align-self: flex-start; }
.ktp-newsletter__msg { margin: 0; font-size: 14px; min-height: 20px; }
.ktp-newsletter__msg.ok { color: #1a7f37; }
.ktp-newsletter__msg.err { color: #d93025; }

.ktp-footer__bottom { background: #fff; }
.ktp-footer__bottom .ktp-container { border-top: 1px solid #ececec; padding-top: 18px; padding-bottom: 18px; margin-top: 12px; }
.ktp-footer__bottom p { margin: 0; text-align: center; font-size: 15px; font-weight: 600; color: #4454BD; }

@media (max-width: 900px) {
  .ktp-footer__grid { grid-template-columns: 1fr 1fr; }
  .ktp-footer__col:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .ktp-footer__grid { grid-template-columns: 1fr; gap: 34px; padding: 50px 20px; }
  .ktp-footer__logo img { width: 220px; }
  .ktp-footer__title { font-size: 20px; margin-bottom: 16px; }
  .ktp-links a { font-size: 17px; }
  .ktp-contact li { font-size: 16px; }
  .ktp-footer__bottom p { font-size: 13.5px; }
  .ktp-footer__bottom .ktp-container { padding-bottom: 76px; }
  .ktp-totop { width: 48px; height: 46px; right: 12px; }
}

/* ---------- Back to top ---------- */
.ktp-totop {
  position: fixed; right: 14px; bottom: 10px; width: 58px; height: 56px; border: 0; cursor: pointer;
  background: #707070; z-index: 800;
  opacity: 0; visibility: hidden; transform: translateY(16px); transition: all .3s var(--ktp-ease);
}
.ktp-totop svg { width: 28px; fill: #fff; margin: auto; display: block; }
.ktp-totop.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.ktp-totop:hover { background: var(--ktp-primary); }

/* ---------- Scroll reveal (add class="ktp-reveal" to any element) ---------- */
.ktp-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ktp-ease), transform .7s var(--ktp-ease); }
.ktp-reveal.is-in { opacity: 1; transform: none; }

/* ---------- Inner page banner (for internal pages) ---------- */
.ktp-page-banner {
  background: linear-gradient(120deg, var(--ktp-hero-tint) 0%, #fff 60%);
  padding: 70px 0 60px; text-align: center; position: relative; overflow: hidden;
}
.ktp-page-banner h1 { font-size: clamp(30px, 4vw, 46px); }
.ktp-breadcrumb { font-size: 14px; color: var(--ktp-muted); }
.ktp-breadcrumb a { color: var(--ktp-primary); }
.ktp-section { padding: 70px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .ktp-reveal { opacity: 1; transform: none; }
}

/* Never let off-screen elements (like the closed mobile menu) widen the page */
html, body { overflow-x: clip; }

/* Spam trap field for forms (hidden from people) */
.ktp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Message shown after a form is sent without JavaScript */
.ktp-flash { padding: 14px 0; font-size: 15px; font-weight: 500; }
.ktp-flash--ok { background: #e6f6ec; color: #1a7f37; }
.ktp-flash--error { background: #fdecea; color: #c5221f; }
