/* ===== CSS VARIABLES ===== */
:root {
  --primary: #1AAFA0;
  --primary-dark: #148F83;
  --primary-light: #2ECDB9;
  --primary-ghost: rgba(26,175,160,0.08);
  --accent: #F07B2E;
  --accent-dark: #D4631E;
  --accent-light: #FF9A56;
  --accent-ghost: rgba(240,123,46,0.1);
  --dark: #0F1923;
  --dark-700: #1A2A38;
  --dark-500: #2C3E50;
  --dark-300: #546E7A;
  --dark-100: #8FA3B0;
  --light: #FFFFFF;
  --light-100: #F7F9FB;
  --light-200: #EDF2F6;
  --light-300: #DDE5ED;
  --light-400: #C5D0DB;
  --success: #27AE60;
  --warning: #F2994A;
  --danger: #EB5757;
  --info: #2D9CDB;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow-sm: 0 1px 3px rgba(15,25,35,0.06), 0 1px 2px rgba(15,25,35,0.04);
  --shadow-md: 0 4px 12px rgba(15,25,35,0.08), 0 2px 4px rgba(15,25,35,0.04);
  --shadow-lg: 0 12px 40px rgba(15,25,35,0.12), 0 4px 12px rgba(15,25,35,0.06);
  --shadow-xl: 0 24px 64px rgba(15,25,35,0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --header-h: 72px;
  --container-max: 1320px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); color: var(--dark); background: var(--light-100); line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { border: none; cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ===== HEADER ===== */
#main-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--light-300);
  z-index: 1000;
  transition: box-shadow 0.3s var(--ease);
}
#main-header.scrolled { box-shadow: var(--shadow-md); }

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

.logo { display: flex; align-items: center; gap: 0; flex-shrink: 0; text-decoration: none; }
#site-logo-img { height: 40px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.footer-logo-img { height: 34px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.logo-text-fallback { display: flex; align-items: baseline; gap: 0; line-height: 1; }
.logo-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon svg, .logo-icon img { display: block; border-radius: 10px; object-fit: contain; }
.logo-text { display: flex; align-items: baseline; gap: 0; line-height: 1; }
.logo-brand {
  font-family: var(--font-display);
  font-weight: 800; font-size: 18px;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
}
.logo-sub {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.3px;
}

#main-nav { display: flex; align-items: center; gap: 2px; }
.mobile-auth-btns { display: none; }

/* Mobile header auth buttons (next to hamburger) */
.header-mobile-auth { display: none; }
.btn-mob-hdr {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-mob-hdr-green { background: var(--primary); color: white; }
.btn-mob-hdr-orange { background: var(--accent); color: white; }
.nav-link {
  padding: 8px 12px; font-size: 13.5px; font-weight: 500;
  color: var(--dark-500); border-radius: var(--radius-sm);
  transition: all 0.2s; white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background: var(--primary-ghost); }
.nav-link.active { color: var(--primary); font-weight: 600; }

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

.header-search {
  display: flex; align-items: center;
  background: var(--light-100);
  border: 1px solid var(--light-300);
  border-radius: var(--radius-full);
  padding: 6px 14px; gap: 6px;
  transition: all 0.2s;
}
.header-search:focus-within { border-color: var(--primary); background: white; }
.header-search input {
  border: none; outline: none; background: transparent;
  font-size: 13px; width: 160px; color: var(--dark);
}
.header-search input::placeholder { color: var(--dark-100); }
.header-search svg { color: var(--dark-100); flex-shrink: 0; }

.mobile-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; padding: 4px;
}
.mobile-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--dark); border-radius: 2px;
  transition: all 0.3s var(--ease);
}

/* ===== FOOTER ===== */
#main-footer { background: var(--dark); color: var(--light-300); padding: 40px 0 0; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 28px; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-desc { font-size: 13px; line-height: 1.6; opacity: 0.7; margin-bottom: 10px; }
.footer-email { font-size: 13px; opacity: 0.6; padding: 6px 0; }
.social-links { display: flex; gap: 12px; }
.social-links a { width: 38px; height: 38px; background: rgba(255,255,255,0.06); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--light-400); font-size: 12px; font-weight: 700; transition: all 0.2s; }
.social-links a:hover { background: var(--primary); color: white; }
.footer-links h4, .footer-contact h4 { color: white; font-family: var(--font-display); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.footer-links a { display: block; font-size: 13px; color: var(--light-400); padding: 3px 0; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary-light); }
.footer-contact p { font-size: 14px; padding: 3px 0; opacity: 0.8; }
.footer-trust { display: none; }
.footer-trust-item { display: none; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0; font-size: 12px; opacity: 0.6;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap; gap: 10px;
}
.footer-bottom p { margin: 0; }
.footer-trust-inline { display: flex; gap: 16px; font-size: 12px; }
.footer-trust-inline span { display: flex; align-items: center; gap: 4px; }

/* ===== TOAST ===== */
#toast-container { position: fixed; top: 90px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: white; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; transform: translateX(120%); transition: transform 0.3s var(--ease); min-width: 280px; }
.toast.show { transform: translateX(0); }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-icon { font-size: 18px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,25,35,0.5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.show { opacity: 1; }
.modal-box { background: white; border-radius: var(--radius-lg); max-width: 540px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-xl); transform: scale(0.95); transition: transform 0.3s; }
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--light-200); }
.modal-header h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; background: var(--light-200); border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--dark-300); border: none; cursor: pointer; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--light-200); display: flex; gap: 12px; justify-content: flex-end; }

/* ===== CHAT MODAL ===== */
.chat-modal {
  background: white;
  border-radius: 16px;
  width: 460px;
  max-width: 95vw;
  height: 75vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  transform: scale(0.95);
  transition: transform 0.3s;
  overflow: hidden;
}
.modal-overlay.show .chat-modal { transform: scale(1); }

.chat-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--primary);
  color: white;
  flex-shrink: 0;
}
.chat-modal-user { display: flex; align-items: center; gap: 12px; }
.chat-modal-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: white;
}
.chat-modal-name { font-weight: 700; font-size: 15px; }
.chat-modal-status { font-size: 11px; opacity: 0.8; }
.chat-modal-close {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border: none; border-radius: 50%;
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.chat-modal-close:hover { background: rgba(255,255,255,0.3); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f0f2f5;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--dark-300);
  text-align: center;
  padding: 40px 20px;
}
.chat-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.chat-empty p { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.chat-empty span { font-size: 13px; opacity: 0.7; }

.chat-date-sep {
  text-align: center;
  margin: 16px 0 12px;
}
.chat-date-sep span {
  background: rgba(0,0,0,0.06);
  color: var(--dark-300);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.chat-bubble-row {
  display: flex;
  margin-bottom: 6px;
}
.chat-bubble-row.mine { justify-content: flex-end; }
.chat-bubble-row.theirs { justify-content: flex-start; }

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.chat-bubble.mine {
  background: var(--primary);
  color: white;
  border-radius: 16px 16px 4px 16px;
}
.chat-bubble.theirs {
  background: white;
  color: var(--dark);
  border-radius: 16px 16px 16px 4px;
}
.chat-bubble.sending { opacity: 0.7; }
.chat-bubble.error { background: #ffebee; color: #c62828; }

.chat-bubble-text { white-space: pre-wrap; }
.chat-bubble-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--light-200);
  flex-shrink: 0;
  align-items: center;
}
.chat-text-input {
  flex: 1;
  border: 1.5px solid var(--light-300);
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: var(--light-100);
  min-width: 0;
}
.chat-text-input:focus { border-color: var(--primary); background: white; }
.chat-text-input::placeholder { color: var(--dark-100); }

.chat-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
.chat-send-btn:hover { background: var(--primary-dark, #D4631E); transform: scale(1.05); }
.chat-send-btn:active { transform: scale(0.95); }

/* Chat loading animation */
.chat-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 40px;
}
.chat-loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--dark-100);
  animation: chatDot 1.4s infinite ease-in-out both;
}
.chat-loading-dot:nth-child(1) { animation-delay: 0s; }
.chat-loading-dot:nth-child(2) { animation-delay: 0.16s; }
.chat-loading-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes chatDot {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== CHAT MOBILE ===== */
@media (max-width: 768px) {
  .chat-modal {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .chat-modal-header { padding: 12px 16px; }
  .chat-modal-avatar { width: 36px; height: 36px; font-size: 14px; }
  .chat-modal-name { font-size: 14px; }
  .chat-messages { padding: 12px; }
  .chat-bubble { max-width: 85%; font-size: 14px; padding: 9px 12px; }
  .chat-input-bar { 
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .chat-text-input { padding: 10px 16px; font-size: 16px; /* iOS zoom fix */ }
  .chat-send-btn { width: 40px; height: 40px; }
}

@media (max-width: 420px) {
  .chat-bubble { max-width: 88%; font-size: 13px; }
  .chat-bubble-time { font-size: 9px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(5deg); } }

/* Hero floating white SVG icons */
.hero-floating-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.hfi {
  position: absolute;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: float 5s ease-in-out infinite;
}
.hfi:nth-child(odd) { animation-name: floatSlow; animation-duration: 6s; }
.hfi:nth-child(3n) { width: 26px; height: 26px; stroke: rgba(255,255,255,0.08); }
.hfi:nth-child(5n) { width: 38px; height: 38px; stroke: rgba(255,255,255,0.15); }
.hero-left { position: relative; z-index: 1; }
.hero-right { position: relative; z-index: 1; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.animate-up { animation: fadeInUp 0.6s var(--ease) both; }
.skeleton { background: linear-gradient(90deg, var(--light-200) 25%, var(--light-100) 50%, var(--light-200) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
