/* =====================================================
   AK Service Solutions — Shared V2 Design System
   Nav, Footer, Topbar, Buttons, Modals, Floating UI
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@700;800&display=swap');

:root {
  --navy: #1B2C5E;
  --navy-dark: #0f1a3a;
  --navy-mid: #243a7a;
  --gold: #F5C842;
  --gold-dark: #d4a820;
  --gold-light: #fde97a;
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-1: #f1f3f9;
  --gray-2: #e2e7f0;
  --gray-3: #c5cedf;
  --text-1: #0f1a36;
  --text-2: #3d4d6b;
  --text-3: #7a8aaa;
  --radius: 16px;
  --shadow-sm: 0 2px 12px rgba(27,44,94,0.08);
  --shadow-md: 0 8px 32px rgba(27,44,94,0.12);
  --shadow-lg: 0 20px 60px rgba(27,44,94,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-1);
  background: var(--white);
  overflow-x: hidden;
}

/* ─── SCROLL ANIMATIONS ─── */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* ─── TOP BAR ─── */
.topbar {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.03em; padding: 9px 0;
  text-align: center;
}
.topbar a { color: var(--gold); text-decoration: none; font-weight: 600; }
.topbar span { margin: 0 10px; opacity: 0.3; }

/* ─── NAV ─── */
nav#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  transition: all 0.4s ease;
  padding: 20px 0;
}
nav#main-nav.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 0;
  box-shadow: 0 2px 30px rgba(27,44,94,0.1);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-hex {
  width: 46px; height: 46px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1rem;
  color: var(--navy); flex-shrink: 0; transition: transform 0.3s ease;
}
.logo:hover .logo-hex { transform: rotate(15deg); }
.logo-name {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.05rem;
  color: var(--white); letter-spacing: 0.01em; line-height: 1.1; transition: color 0.3s;
}
.logo-tag {
  font-size: 0.68rem; font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.07em; text-transform: uppercase; transition: color 0.3s;
}
nav#main-nav.scrolled .logo-name { color: var(--navy); }
nav#main-nav.scrolled .logo-tag { color: var(--text-3); }
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none; font-size: 0.88rem;
  font-weight: 600; letter-spacing: 0.02em;
  transition: color 0.25s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { transform: scaleX(1); }
nav#main-nav.scrolled .nav-links a { color: var(--text-2); }
nav#main-nav.scrolled .nav-links a:hover { color: var(--navy); }
.nav-call {
  background: var(--gold); color: var(--navy) !important;
  padding: 11px 24px !important; border-radius: 100px !important;
  font-weight: 700 !important; transition: all 0.25s !important; white-space: nowrap;
}
.nav-call::after { display: none !important; }
.nav-call:hover {
  background: var(--gold-dark) !important; transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,200,66,0.4) !important;
}

/* Mobile nav toggle */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--white); border-radius: 2px; transition: all 0.3s;
}
nav#main-nav.scrolled .nav-hamburger span { background: var(--navy); }

/* Mobile nav drawer */
.nav-drawer {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.5);
}
.nav-drawer.open { display: block; }
.nav-drawer-inner {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 280px; background: var(--white);
  padding: 24px 20px; overflow-y: auto;
}
.nav-drawer-close {
  display: flex; justify-content: flex-end;
  background: none; border: none; font-size: 24px;
  cursor: pointer; color: var(--navy); margin-bottom: 24px; width: 100%;
}
.nav-drawer-links { list-style: none; }
.nav-drawer-links li { border-bottom: 1px solid var(--gray-2); }
.nav-drawer-links a {
  display: block; padding: 14px 0; font-weight: 600;
  color: var(--text-1); text-decoration: none; font-size: 1rem;
}
.nav-drawer-links a:hover { color: var(--navy); }
.nav-drawer-links .nav-call {
  display: block; text-align: center; margin-top: 20px;
  padding: 14px !important; border-radius: 12px !important;
}

/* ─── PAGE WRAPPER — offset for fixed nav ─── */
body { padding-top: 70px; }

/* ─── FOOTER ─── */
footer {
  background: var(--navy-dark);
  padding: 70px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 52px; margin-bottom: 52px;
}
.footer-brand .logo-name { color: var(--white); font-size: 1.1rem; }
.footer-brand .logo-tag { color: rgba(255,255,255,0.4); }
.footer-tagline {
  font-size: 0.86rem; color: rgba(255,255,255,0.38);
  line-height: 1.7; max-width: 240px; margin-top: 14px;
}
.footer-ins {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(245,200,66,0.1); border: 1px solid rgba(245,200,66,0.2);
  color: var(--gold); font-size: 0.74rem; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; margin-top: 16px;
  letter-spacing: 0.05em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.footer-ins:hover { background: rgba(245,200,66,0.2); border-color: rgba(245,200,66,0.5); }
.footer-col h4 {
  font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); margin-bottom: 20px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 11px; }
.footer-col ul li a {
  color: rgba(255,255,255,0.45); text-decoration: none;
  font-size: 0.87rem; transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--gold); }
.f-contact-row {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 12px; font-size: 0.87rem;
  color: rgba(255,255,255,0.45);
}
.f-contact-row a { color: rgba(255,255,255,0.45); text-decoration: none; }
.f-contact-row a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 28px; display: flex;
  justify-content: space-between; align-items: center;
  font-size: 0.78rem; color: rgba(255,255,255,0.25);
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ─── Scroll-to-top (LEFT side) ─── */
#backToTop {
  position: fixed; bottom: 20px; left: 20px;
  width: 52px; height: 52px; border: none; border-radius: 50%;
  background: #1B2C5E; color: #F5C842;
  font-size: 24px; font-weight: bold; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
}
#backToTop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#backToTop:hover { background: #0f1a3c; transform: translateY(-2px); }

/* ─── AI Chat Widget ─── */
#ai-chat-btn {
  position: fixed; bottom: 20px; right: 20px; z-index: 9000;
  background: #1B2C5E; color: #fff;
  border-radius: 50px; padding: 14px 22px;
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; border: none; font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 24px rgba(27,44,94,0.35);
  transition: all 0.2s;
}
#ai-chat-btn:hover { background: #0f1a3c; transform: translateY(-2px); }
#ai-chat-btn .chat-dot {
  width: 8px; height: 8px; background: #4ade80; border-radius: 50%;
  box-shadow: 0 0 6px rgba(74,222,128,0.6);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

#ai-chat-panel {
  position: fixed; bottom: 86px; right: 20px; z-index: 8999;
  width: 340px; background: #fff; border-radius: 18px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.18);
  display: none; flex-direction: column; overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  animation: chat-in 0.25s cubic-bezier(.22,1,.36,1);
}
#ai-chat-panel.open { display: flex; }
@keyframes chat-in { from{opacity:0;transform:translateY(16px) scale(0.97)} to{opacity:1;transform:translateY(0) scale(1)} }
.chat-header {
  background: #1B2C5E; color: #fff;
  padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.chat-header-icon {
  width: 38px; height: 38px; background: #F5C842; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.chat-header-text { flex: 1; }
.chat-header-name { font-weight: 700; font-size: 0.95rem; }
.chat-header-status { font-size: 0.75rem; color: rgba(255,255,255,0.6); margin-top: 2px; }
.chat-close { background: none; border: none; color: rgba(255,255,255,0.6); font-size: 22px; cursor: pointer; line-height: 1; padding: 0; }
.chat-close:hover { color: #fff; }
.chat-messages { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 160px; max-height: 220px; overflow-y: auto; background: #f8f9fc; }
.chat-msg { padding: 10px 14px; border-radius: 14px; font-size: 0.88rem; line-height: 1.5; max-width: 85%; }
.chat-msg.bot { background: #fff; color: #1a2e6b; border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); align-self: flex-start; }
.chat-msg.user { background: #1B2C5E; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-input-row { display: flex; gap: 8px; padding: 14px; border-top: 1px solid #eef0f5; background: #fff; }
.chat-input { flex: 1; border: 1.5px solid #e2e7f0; border-radius: 10px; padding: 10px 14px; font-size: 0.88rem; font-family: 'Plus Jakarta Sans', sans-serif; outline: none; transition: border 0.2s; }
.chat-input:focus { border-color: #1B2C5E; }
.chat-send { background: #F5C842; color: #1B2C5E; border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 18px; cursor: pointer; transition: background 0.2s; }
.chat-send:hover { background: #e0b530; }
.chat-footer-note { text-align: center; font-size: 0.7rem; color: #aaa; padding: 6px 14px 10px; background: #fff; }

/* ─── Mobile sticky CTA ─── */
.mobile-cta-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 2000; background: #fff; border-top: 2px solid #e2e7f0;
  padding: 10px 16px 12px; box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
}
.mobile-cta-bar-inner { display: flex; gap: 10px; }
.mobile-cta-bar .mcta-btn {
  flex: 1; padding: 14px 10px; font-size: 14px; font-weight: 700;
  border-radius: 10px; text-align: center; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; border: none; font-family: 'Plus Jakarta Sans', sans-serif;
}
.mcta-sms  { background: #1B2C5E; color: #fff; }
.mcta-call { background: #F5C842; color: #1B2C5E; border: 2px solid #F5C842; font-weight: 800; }

/* ─── Insurance Modal ─── */
#ins-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 19000;
  align-items: center; justify-content: center; padding: 20px;
}
#ins-modal-overlay.open { display: flex; }
#ins-modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 780px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  overflow: hidden; animation: modal-in 0.25s cubic-bezier(.22,1,.36,1);
}
@keyframes modal-in { from{opacity:0;transform:scale(0.96) translateY(12px)} to{opacity:1;transform:scale(1) translateY(0)} }
.ins-modal-header { background: #1B2C5E; color: #fff; padding: 16px 22px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.ins-modal-header h3 { flex: 1; font-size: 1rem; font-weight: 700; margin: 0; }
.ins-modal-close { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 26px; cursor: pointer; line-height: 1; padding: 0; }
.ins-modal-close:hover { color: #fff; }
.ins-modal-body { flex: 1; overflow: hidden; min-height: 0; }
.ins-modal-body iframe { width: 100%; height: 100%; min-height: 500px; border: none; display: block; }
.ins-modal-footer { padding: 12px 22px; border-top: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; font-size: 0.82rem; color: #888; }
.ins-modal-footer a { color: #1B2C5E; font-weight: 600; text-decoration: none; }
.ins-modal-footer a:hover { text-decoration: underline; }

/* ─── Form Modal ─── */
#form-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 19000;
  align-items: center; justify-content: center; padding: 20px;
}
#form-modal-overlay.open { display: flex; }
#form-modal {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 520px; max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  overflow-y: auto; animation: modal-in 0.25s cubic-bezier(.22,1,.36,1);
}
.form-modal-header {
  background: #1B2C5E; color: #fff;
  padding: 16px 22px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 1; flex-shrink: 0;
}
.form-modal-header h3 { flex: 1; font-size: 1rem; font-weight: 700; margin: 0; font-family: 'Sora', sans-serif; }
.form-modal-close { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 26px; cursor: pointer; line-height: 1; padding: 0; }
.form-modal-close:hover { color: #fff; }
.form-modal-body { padding: 24px; }
.form-modal-body .form-sub { color: #666; font-size: 0.88rem; margin-bottom: 18px; }

/* Form fields shared */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--gray-2); border-radius: 10px;
  padding: 11px 14px; font-size: 0.92rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-1); background: var(--off-white);
  outline: none; transition: border 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); background: #fff; }
.field textarea { resize: none; height: 76px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.form-btn {
  width: 100%; padding: 15px; background: var(--navy); color: #fff;
  border: none; border-radius: 12px; font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.2s, transform 0.2s; margin-top: 6px;
}
.form-btn:hover { background: var(--navy-dark); transform: translateY(-1px); }
.form-note { font-size: 0.75rem; color: var(--text-3); text-align: center; margin-top: 10px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  #ai-chat-btn { display: none; }
  #ai-chat-panel { display: none !important; }
  .mobile-cta-bar { display: block; }
  body { padding-bottom: 72px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  #form-modal { max-height: 96vh; border-radius: 14px; }
  .form-modal-body { padding: 16px; }
  #ins-modal { max-height: 95vh; }
  .ins-modal-body iframe { min-height: 340px; }
}
@media (max-width: 540px) {
  .field-row { grid-template-columns: 1fr; }
}
