/* =====================================================
   Infoage Africa — site-shared.css
   Covers: nav, mobile menu, modal, chatbot, footer,
           toast, scroll-reveal, back-to-top, buttons
   ===================================================== */

:root {
  --navy:       #0c1f3f;
  --navy-dark:  #07172f;
  --orange:     #e6862c;
  --orange-dark:#d67a22;
  --muted:      #5f6b7a;
  --soft:       #f4f6f9;
  --border:     #e8edf3;
}

*, *::before, *::after { box-sizing: border-box; }
html  { scroll-behavior: smooth; }
body  { margin: 0; font-family: Arial, sans-serif; color: #17263c; background: #fff; overflow-x: hidden; }
a     { text-decoration: none; }
img   { max-width: 100%; }

/* ===================== NAV ===================== */
#topnav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  padding: 10px 0;
  z-index: 1000;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 14px rgba(0,0,0,.08);
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: background .3s ease, box-shadow .3s ease;
}

#topnav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--orange);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 100%;
}

.logo { display: inline-flex; align-items: center; margin-left: 0; }
.logo img { height: 60px; width: auto; object-fit: contain; }

/* Desktop menu */
#topnav .navigation-menu {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}

#topnav .navigation-menu li { margin: 0; padding: 0; }

#topnav .navigation-menu > li > a {
  color: #0f1f36 !important;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .07em;
  text-transform: uppercase;
  display: inline-block;
  padding: 8px 0;
  position: relative;
  transition: color .25s;
}

#topnav .navigation-menu > li > a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--orange);
  transition: width .25s;
}

#topnav .navigation-menu > li > a:hover,
#topnav .navigation-menu > li > a.active {
  color: var(--orange) !important;
}

#topnav .navigation-menu > li > a:hover::after,
#topnav .navigation-menu > li > a.active::after {
  width: 100%;
}

/* Scrolled state */
#topnav.scrolled {
  background: var(--navy) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.18) !important;
}

#topnav.scrolled .navigation-menu > li > a { color: #fff !important; }
#topnav.scrolled .navigation-menu > li > a:hover,
#topnav.scrolled .navigation-menu > li > a.active { color: var(--orange) !important; }

/* Nav CTA */
.nav-cta-desktop {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  margin-left: 18px;
}

/* Mobile toggle button */
.mobile-menu-toggle {
  display: none;
  width: 46px; height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(230,134,44,.28);
  transition: background .2s, transform .2s;
  flex-shrink: 0;
}

.mobile-menu-toggle:hover { background: var(--orange-dark); transform: translateY(-1px); }

/* Mobile backdrop */
.mobile-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7,23,47,.52);
  z-index: 998;
  opacity: 0;
  transition: opacity .25s;
}

.mobile-menu-backdrop.show { display: block; opacity: 1; }

/* Responsive nav */
@media (max-width: 991px) {
  .mobile-menu-toggle  { display: flex; }
  .nav-cta-desktop     { display: none !important; }

  #topnav .navigation-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 3px solid var(--orange);
    box-shadow: 0 12px 28px rgba(0,0,0,.12);
    padding: 8px 0 16px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity .25s, transform .25s;
    z-index: 999;
    margin: 0;
  }

  #topnav .navigation-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  #topnav .navigation-menu li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  #topnav .navigation-menu li:last-child { border-bottom: 0; }

  #topnav .navigation-menu > li > a {
    display: block;
    padding: 14px 24px;
    width: 100%;
    color: var(--navy) !important;
  }

  #topnav .navigation-menu > li > a::after { display: none; }

  #topnav.scrolled .navigation-menu {
    background: var(--navy);
    border-color: rgba(255,255,255,.12);
  }

  #topnav.scrolled .navigation-menu li { border-color: rgba(255,255,255,.12); }
  #topnav.scrolled .navigation-menu > li > a { color: #fff !important; }
  #topnav.scrolled .navigation-menu > li > a.active { color: var(--orange) !important; }
}

@media (max-width: 768px) { .logo img { height: 46px; } }
@media (max-width: 576px) { .logo img { height: 42px; } }

/* ===================== BUTTONS ===================== */
.btn-orange {
  background: var(--orange);
  color: #fff !important;
  padding: 13px 28px;
  border-radius: 6px;
  font-weight: 700;
  border: none;
  box-shadow: 0 10px 24px rgba(230,134,44,.24);
  display: inline-block;
  transition: transform .2s, box-shadow .2s, background .2s;
  cursor: pointer;
}

.btn-orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(230,134,44,.32);
  background: var(--orange-dark);
  color: #fff !important;
}

.btn-outline-navy {
  border: 2px solid var(--navy);
  color: var(--navy) !important;
  background: #fff;
  padding: 11px 26px;
  border-radius: 6px;
  font-weight: 700;
  display: inline-block;
  transition: background .25s, color .25s, transform .25s;
}

.btn-outline-navy:hover {
  background: var(--navy);
  color: #fff !important;
  transform: translateY(-2px);
}

/* ===================== MODAL ===================== */
#consultModal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  background: rgba(12,31,63,.72);
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content {
  background: #fff;
  padding: 36px;
  width: 440px;
  max-width: 100%;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  animation: popIn .25s ease;
}

@keyframes popIn {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.modal-content h3 { color: var(--navy); font-weight: 800; margin-bottom: 6px; }
.modal-content p  { color: var(--muted); margin-bottom: 14px; font-size: 14px; }

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 12px 14px;
  margin: 8px 0;
  border: 1px solid #d7dce3;
  border-radius: 8px;
  outline: none;
  font-size: 15px;
  transition: border .2s, box-shadow .2s;
}

.modal-content input:focus,
.modal-content textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(230,134,44,.14);
}

.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ===================== TOAST ===================== */
#toastMsg {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #17263c;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 4000;
  font-size: 14px;
  white-space: nowrap;
}

#toastMsg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ===================== FLOATING ACTIONS ===================== */
.floating-actions {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.back-to-top,
.chatbot-toggle {
  width: 54px; height: 54px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
  transition: transform .2s, opacity .2s;
}

.back-to-top {
  background: #fff;
  color: var(--navy);
  opacity: 0;
  pointer-events: none;
}

.back-to-top.show { opacity: 1; pointer-events: auto; }
.back-to-top:hover, .chatbot-toggle:hover { transform: translateY(-3px); }

.chatbot-toggle { background: var(--orange); color: #fff; position: relative; }

.chatbot-toggle .pulse {
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(230,134,44,.38);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { transform: scale(.9); opacity: .8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ===================== CHATBOT PANEL ===================== */
.chatbot-panel {
  width: 340px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  overflow: hidden;
  display: none;
}

.chatbot-panel.open { display: block; animation: popIn .22s ease; }

.chatbot-header {
  background: linear-gradient(135deg, #18345d, var(--navy));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-header h5 { margin: 0; font-size: 16px; color: #fff; }
.chatbot-header small { opacity: .85; display: block; margin-top: 2px; font-size: 12px; }

.chatbot-body {
  padding: 14px;
  height: 320px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-row { display: flex; }
.chat-row.user { justify-content: flex-end; }

.chat-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-row.bot  .chat-bubble { background: #fff; border: 1px solid #e4e8ee; color: #21344f; }
.chat-row.user .chat-bubble { background: var(--orange); color: #fff; }

/* Typing indicator */
.typing-bubble { display: flex; align-items: center; gap: 5px; padding: 12px 16px; }
.typing-bubble span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #aab1bb;
  animation: typeBounce 1.2s infinite;
}
.typing-bubble span:nth-child(2) { animation-delay: .2s; }
.typing-bubble span:nth-child(3) { animation-delay: .4s; }

@keyframes typeBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

.chatbot-quick {
  padding: 0 12px 10px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  background: #f8fafc;
}

.chatbot-quick button {
  border: 1px solid #d6dde7;
  background: #fff;
  color: #21344f;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.chatbot-quick button:hover { background: var(--soft); border-color: var(--orange); }

.chatbot-footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #edf1f5;
  background: #fff;
}

.chatbot-footer input {
  flex: 1;
  border: 1px solid #d6dde7;
  border-radius: 999px;
  padding: 10px 14px;
  outline: none;
  font-size: 14px;
  transition: border .2s;
}

.chatbot-footer input:focus { border-color: var(--orange); }

.chatbot-footer button {
  border: none;
  background: var(--orange);
  color: #fff;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: background .2s;
  flex-shrink: 0;
}

.chatbot-footer button:hover { background: var(--orange-dark); }

/* ===================== WHATSAPP FLOAT ===================== */
.whatsapp-float {
  position: fixed;
  left: 22px; bottom: 22px;
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff !important;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  transition: transform .25s, box-shadow .25s;
  font-size: 14px;
}

.whatsapp-float:hover { transform: translateY(-3px); color: #fff !important; }

/* ===================== FOOTER ===================== */
.site-footer { margin-top: 0; }

.footer-contact-strip {
  background:
    linear-gradient(rgba(12,31,63,.88), rgba(12,31,63,.88)),
    url("images/footer-bg.jpg") center/cover no-repeat;
  padding: 34px 0;
  color: #fff;
  border-top: 5px solid var(--orange);
}

.footer-contact-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 600;
}

.footer-icon { font-size: 22px; color: var(--orange); }

.footer-logo-center img {
  max-height: 55px;
  background: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}

.footer-cta-box { justify-content: flex-end; }

.footer-cta-btn {
  display: inline-block;
  background: var(--orange);
  color: #fff !important;
  padding: 12px 22px;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  transition: background .25s, transform .25s;
  box-shadow: 0 10px 24px rgba(230,134,44,.25);
}

.footer-cta-btn:hover { background: var(--orange-dark); transform: translateY(-2px); color: #fff !important; }

.footer-bottom-bar { background: #07172f; padding: 18px 0; }

.footer-bottom-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.footer-bottom-grid p { margin: 0; color: #fff; font-size: 14px; }

.footer-bottom-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color .25s;
}

.footer-bottom-links a:hover { color: var(--orange); }
.footer-bottom-links span { color: rgba(255,255,255,.5); margin: 0 8px; }

/* ===================== SCROLL REVEAL ===================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s ease, transform .65s ease;
}

.reveal.show,
.reveal.visible { opacity: 1; transform: none; }

/* ===================== RESPONSIVE FOOTER ===================== */
@media (max-width: 768px) {
  .footer-contact-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-contact-item, .footer-cta-box { justify-content: center; }
  .footer-bottom-grid { flex-direction: column; text-align: center; }
  .footer-bottom-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .footer-bottom-links span { display: none; }
}

@media (max-width: 576px) {
  .floating-actions { right: 14px; bottom: 14px; }
  .chatbot-panel { width: calc(100vw - 28px); }
  .whatsapp-float { left: 14px; bottom: 14px; padding: 10px 14px; font-size: 13px; }
  #toastMsg { white-space: normal; max-width: 88vw; text-align: center; }
}

/* ===================== FORM HELPERS ===================== */
.form-control.error { border-color: #dc3545 !important; }
.field-error { display: none; font-size: 12px; color: #dc3545; margin-top: 5px; }
.form-control.error + .field-error,
select.error + .field-error,
textarea.error + .field-error { display: block; }
.form-status { display: none; padding: 11px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.form-status.show   { display: block; }
.form-status.error  { background: #fff1f1; color: #b42318; border: 1px solid #ffd1d1; }
.form-status.success{ background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
