/* === Global Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #fafafa;
}

a {
  text-decoration: none;
  color: inherit;
}

/* === Navigation === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #1a1a2e;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.navbar nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.navbar nav ul li a {
  color: #ccc;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.navbar nav ul li a:hover,
.navbar nav ul li a.active {
  color: #fff;
}

/* Language Toggle */
#lang-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.3s, border-color 0.3s;
  white-space: nowrap;
}

#lang-toggle:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.7);
}

/* Hamburger menu for mobile */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: 0.3s;
}

/* === Hero Section === */
.hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  color: #ccc;
}

/* === Section Cards Grid (Homepage) === */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.section-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.section-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: #1a1a2e;
}

.section-card p {
  font-size: 0.95rem;
  color: #666;
}

.section-card .learn-more {
  display: inline-block;
  margin-top: 1rem;
  color: #4361ee;
  font-weight: 600;
  font-size: 0.9rem;
}

.section-card .learn-more:hover {
  text-decoration: underline;
}

/* === Page Content Area === */
.page-content {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.page-content h1 {
  font-size: 2.2rem;
  color: #1a1a2e;
  margin-bottom: 1rem;
}

.page-content h2 {
  font-size: 1.5rem;
  color: #1a1a2e;
  margin: 2rem 0 1rem;
}

.page-content p {
  margin-bottom: 1rem;
  color: #555;
}

/* === Service List === */
.service-list {
  list-style: none;
  padding: 0;
}

.service-list li {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.service-list li:last-child {
  border-bottom: none;
}

.service-list .service-icon {
  font-size: 1.5rem;
}

.service-list .service-text h4 {
  font-size: 1.05rem;
  color: #333;
  margin-bottom: 0.25rem;
}

.service-link {
  color: #1a3a5c !important;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.service-link:hover {
  color: #3b82f6 !important;
  border-bottom-color: #3b82f6;
}

.service-list .service-text p {
  font-size: 0.9rem;
  color: #777;
  margin: 0;
}

/* === Accordion (Service Detail Expand) === */
.service-list li.accordion-item {
  flex-direction: column;
  align-items: stretch;
}

.service-list li.accordion-item > .accordion-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  width: 100%;
  padding: 0.5rem 0;
  user-select: none;
}

.service-list li.accordion-item .accordion-arrow {
  margin-left: auto;
  font-size: 1rem;
  color: #4361ee;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.service-list li.accordion-item.open .accordion-arrow {
  transform: rotate(90deg);
}

.service-list li.accordion-item .accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 0 0 3.2rem;
}

.service-list li.accordion-item.open .accordion-body {
  max-height: 20000px;
  padding: 1rem 0 1rem 3.2rem;
}

.accordion-body h2 {
  font-size: 1.15rem;
  color: #1a3a5c;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.accordion-body h3 {
  font-size: 1rem;
  color: #333;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.accordion-body p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 0.75rem;
}

.accordion-body ul.who-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0.75rem;
}

.accordion-body ul.who-list li {
  position: relative;
  padding-left: 1.25rem;
  border-bottom: none;
  font-size: 0.92rem;
  color: #555;
  line-height: 1.6;
}

.accordion-body ul.who-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #4361ee;
  font-weight: bold;
}

.accordion-body table.insurance-types {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}

.accordion-body table.insurance-types th,
.accordion-body table.insurance-types td {
  border: 1px solid #ddd;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.accordion-body table.insurance-types th {
  background-color: #f0f4ff;
  color: #1a3a5c;
  font-weight: 600;
}

.accordion-body em {
  color: #999;
  font-size: 0.85rem;
}

/* === CTA Section === */
.cta {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  color: #fff;
  margin-top: 2rem;
}

.cta h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.cta p {
  margin-bottom: 2rem;
  color: #ddd;
}

.cta .btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: #fff;
  color: #4361ee;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 2rem;
  background: #1a1a2e;
  color: #888;
  font-size: 0.85rem;
}

/* === Agent Chat Button (Placeholder) === */
.agent-chat-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4361ee;
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(67, 97, 238, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 99;
}

.agent-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.5);
}

/* Agent Chat Panel */
.agent-chat-panel {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 380px;
  height: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.agent-chat-panel.open {
  display: flex;
}

.agent-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #1a1a2e;
  color: #fff;
}

.agent-chat-header h3 {
  font-size: 1rem;
}

.agent-chat-close {
  cursor: pointer;
  font-size: 1.25rem;
  background: none;
  border: none;
  color: #fff;
}

.agent-chat-messages {
  display: none; /* hidden, replaced by contact form */
}

/* Contact Form */
.contact-form {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

.contact-field input,
.contact-field textarea {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-color: #4361ee;
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
}

.contact-submit {
  padding: 0.7rem;
  background: #4361ee;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
}

.contact-submit:hover {
  background: #3a0ca3;
}

.contact-submit:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.contact-status {
  text-align: center;
  font-size: 0.85rem;
  min-height: 1.2rem;
}

.contact-status.success {
  color: #2e7d32;
}

.contact-status.error {
  color: #c62828;
}

/* === Life Insurance Page: Insurance Types Table === */
.insurance-types {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.insurance-types th,
.insurance-types td {
  padding: 0.8rem 1rem;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.insurance-types th {
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
}

.insurance-types tr:nth-child(even) {
  background: #f8f8fc;
}

.insurance-types td:first-child {
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
}

/* Who Should Consider list */
.who-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.who-list li {
  margin-bottom: 0.5rem;
  color: #555;
}

/* Resource links */
.resource-links {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f0f4ff;
  border-radius: 8px;
  border-left: 4px solid #4361ee;
}

.resource-links a {
  color: #4361ee;
  font-weight: 500;
}

.resource-links a:hover {
  text-decoration: underline;
}

/* === Life Insurance Hero Banner === */
.life-hero {
  position: relative;
  width: 100%;
  min-height: 220px;
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1b3d 0%, #1a1a2e 40%, #16213e 100%);
}

.life-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(67, 97, 238, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(58, 12, 163, 0.2) 0%, transparent 50%);
  z-index: 1;
}

.life-hero-text {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding: 2rem 1.5rem;
  color: #fff;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", "STSong", Georgia, serif;
  font-size: 1.1rem;
  line-height: 2.2;
  text-align: center;
  letter-spacing: 1px;
}

.life-hero-text .highlight {
  color: #8fa4f8;
  font-weight: 600;
}

/* === Responsive === */
@media (max-width: 768px) {
  .navbar nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    padding: 1rem 2rem;
    gap: 1rem;
  }

  .navbar nav ul.open {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .insurance-types {
    font-size: 0.85rem;
  }

  .insurance-types th,
  .insurance-types td {
    padding: 0.6rem 0.5rem;
  }

  .agent-chat-panel {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 1rem;
    height: 60vh;
  }
}
