/* ===========================
   함께ON - 메인 스타일시트
   =========================== */

:root {
  --primary: #1a4fa0;
  --primary-light: #2563c4;
  --primary-pale: #e8f0fd;
  --accent: #f5a623;
  --accent-dark: #e08c0a;
  --dark: #0d1b3e;
  --dark2: #162248;
  --mid: #3a5080;
  --light: #f0f4fc;
  --white: #ffffff;
  --text: #1a2540;
  --text-mid: #3a5080;
  --text-light: #6a80aa;
  --border: #c8d8f0;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(26,79,160,0.12);
  --shadow-lg: 0 12px 48px rgba(26,79,160,0.18);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul { list-style: none; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   NAVBAR
   =========================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--white);
  transition: var(--transition);
}

.navbar.scrolled .logo { color: var(--dark); }

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  transition: var(--transition);
}

.navbar.scrolled .nav-links a { color: var(--text-mid); }

.nav-links a:hover { color: var(--accent); }

.btn-nav {
  background: var(--accent);
  color: var(--dark) !important;
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 700 !important;
  transition: var(--transition) !important;
}

.btn-nav:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(245,166,35,0.4);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--white);
  transition: var(--transition);
  border-radius: 2px;
}

.navbar.scrolled .menu-toggle span { background: var(--dark); }

/* ===========================
   HERO
   =========================== */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d2a6e 0%, #1a4fa0 50%, #0a2560 100%);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 120px 80px 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
}

.blob1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6aa3f5, transparent);
  top: -100px; right: -100px;
  animation: blobFloat 8s ease-in-out infinite;
}

.blob2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #f5a623, transparent);
  bottom: 100px; left: -50px;
  animation: blobFloat 10s ease-in-out infinite reverse;
}

.blob3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #93c5fd, transparent);
  top: 50%; left: 40%;
  animation: blobFloat 12s ease-in-out infinite;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-10px, 15px) scale(0.95); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
  flex: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
  animation: fadeInDown 0.6s ease;
}

.badge-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.hero-title {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 24px;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero-title em::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  opacity: 0.3;
  border-radius: 2px;
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 36px;
  line-height: 1.8;
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  animation: fadeInUp 0.7s ease 0.3s both;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--dark);
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(245,166,35,0.4);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(245,166,35,0.5);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: rgba(255,255,255,0.9);
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 1rem;
  border: 1.5px solid rgba(255,255,255,0.3);
  transition: var(--transition);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  animation: fadeInUp 0.7s ease 0.4s both;
}

.stat strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.stat span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.2);
}

/* Hero Visual */
.hero-visual {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.phone-mockup {
  width: 320px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 40px;
  padding: 16px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  animation: phoneFloat 6s ease-in-out infinite;
}

@keyframes phoneFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-16px) rotate(1deg); }
}

.phone-screen {
  background: #fff;
  border-radius: 28px;
  overflow: hidden;
  min-height: 480px;
}

.chat-ui {
  display: flex;
  flex-direction: column;
  height: 480px;
}

.chat-header {
  background: var(--primary);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 38px; height: 38px;
  background: var(--accent);
  color: var(--dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.chat-name {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.chat-status {
  color: #4ade80;
  font-size: 0.75rem;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  background: #f5f5f5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { max-width: 85%; }

.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; }

.msg p {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.msg-ai p {
  background: white;
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.msg-user p {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-pale);
  padding: 8px 12px;
  border-radius: 10px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
}

.result-icon {
  width: 20px; height: 20px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.chat-input {
  padding: 12px 16px;
  background: white;
  display: flex;
  gap: 8px;
  border-top: 1px solid #eee;
}

.chat-input input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}

.chat-input button {
  width: 36px; height: 36px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: scrollPulse 2s infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===========================
   SECTIONS COMMON
   =========================== */
.section-label {
  display: inline-block;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 50px;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 48px;
}

.section-title em {
  font-style: normal;
  color: var(--primary);
}

/* ===========================
   PROBLEM
   =========================== */
.problem {
  padding: 100px 0;
  background: var(--white);
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.problem-card {
  background: var(--light);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: var(--transition);
  border: 1.5px solid transparent;
}

.problem-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.problem-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}

.problem-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--dark);
}

.problem-card p {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.7;
}

.highlight-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.highlight-card h3 { color: white; }
.highlight-card p { color: rgba(255,255,255,0.85); }

/* ===========================
   HOW IT WORKS
   =========================== */
.how-it-works {
  padding: 100px 0;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

.how-it-works::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(26,79,160,0.4), transparent);
  border-radius: 50%;
}

.how-it-works .section-label {
  background: rgba(26,79,160,0.3);
  color: #4ade80;
}

.how-it-works .section-title { color: var(--white); }
.how-it-works .section-title em { color: var(--accent); }

.steps {
  display: flex;
  align-items: center;
  gap: 16px;
}

.step {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 40px 32px;
  position: relative;
  transition: var(--transition);
}

.step:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(26,79,160,0.5);
  transform: translateY(-4px);
}

.step-num {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 900;
  font-size: 4rem;
  color: rgba(255,255,255,0.06);
  position: absolute;
  top: 16px; right: 20px;
  line-height: 1;
}

.step-icon-wrap {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: white;
}

.step-icon-wrap svg {
  width: 28px; height: 28px;
}

.step-content h3 {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-content p {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  line-height: 1.7;
}

.step-arrow {
  color: rgba(255,255,255,0.2);
  font-size: 1.8rem;
  flex-shrink: 0;
}

/* ===========================
   SERVICES
   =========================== */
.services {
  padding: 100px 0;
  background: var(--light);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  border: 1.5px solid var(--border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.service-tag {
  display: inline-block;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
  margin-bottom: 16px;
  width: fit-content;
}

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--dark);
}

.service-card p {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 20px;
}

.service-list {
  margin-bottom: 24px;
  flex: 1;
}

.service-list li {
  font-size: 0.85rem;
  color: var(--text-mid);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-list li::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
}

.service-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
}

.service-link:hover {
  color: var(--primary-light);
  gap: 4px;
}

.featured-service {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-color: transparent;
  color: white;
}

.featured-service .service-tag {
  background: rgba(255,255,255,0.2);
  color: white;
}

.featured-service h3 { color: white; }
.featured-service p { color: rgba(255,255,255,0.8); }

.featured-service .service-list li {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.15);
}

.featured-service .service-list li::before { color: var(--accent); }

.featured-service .service-link {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}

/* ===========================
   COMMUNITY
   =========================== */
.community {
  padding: 100px 0;
  background: white;
}

.community-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.community .section-title { margin-bottom: 20px; }

.community-text > p {
  color: var(--text-mid);
  margin-bottom: 36px;
  line-height: 1.8;
}

.community-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}

.comm-feat {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.comm-icon {
  font-size: 1.5rem;
  width: 44px; height: 44px;
  background: var(--primary-pale);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comm-feat strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--dark);
}

.comm-feat p {
  font-size: 0.88rem;
  color: var(--text-mid);
}

/* Kakao Mockup */
.kakao-mockup {
  background: #fee500;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  transition: var(--transition);
}

.kakao-mockup:hover { transform: rotate(0deg) scale(1.02); }

.kakao-header {
  background: #fada0a;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.kakao-logo {
  font-size: 1.5rem;
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kakao-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #3c1e1e;
}

.kakao-members {
  font-size: 0.8rem;
  color: rgba(60,30,30,0.6);
}

.kakao-msgs {
  background: #b2c7d9;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
}

.kmsg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.kmsg-avatar {
  width: 34px; height: 34px;
  background: #8ab0c9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.kmsg-avatar.expert {
  background: var(--primary);
}

.kmsg-bubble {
  background: white;
  padding: 10px 14px;
  border-radius: 4px 14px 14px 14px;
  font-size: 0.82rem;
  color: #3c3c3c;
  line-height: 1.5;
  max-width: 240px;
}

.expert-bubble {
  background: #e8f0fd;
  border: 1px solid var(--border);
}

/* ===========================
   AI CHAT SECTION
   =========================== */
.contact {
  padding: 100px 0;
  background: var(--light);
}

.chat-section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.chat-section-header .section-title { margin-bottom: 16px; }

.chat-section-desc {
  color: var(--text-mid);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 28px;
}

.trust-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  border: 1.5px solid var(--border);
}

/* Chat Layout */
.ai-chat-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

/* Hints Panel */
.chat-hints-panel {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1.5px solid var(--border);
  position: sticky;
  top: 100px;
  overflow: hidden;
  box-sizing: border-box;
}

.chat-hints-panel h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
}

.hint-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.hint-chip {
  background: var(--light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-mid);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  line-height: 1.4;
}

.hint-chip:hover {
  background: var(--primary-pale);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(4px);
}

.api-info-box {
  background: var(--primary-pale);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.api-info-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }

.api-info-box p {
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin: 0;
}

/* Chatbox */
.ai-chatbox {
  background: white;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 600px;
}

.chatbox-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.chatbox-avatar {
  position: relative;
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.online-dot {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 12px; height: 12px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

.chatbox-info { flex: 1; }

.chatbox-name {
  color: white;
  font-weight: 700;
  font-size: 1rem;
}

.chatbox-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  margin-top: 2px;
}

.chat-reset-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.chat-reset-btn:hover { background: rgba(255,255,255,0.25); }

/* Messages */
.chatbox-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 400px;
  max-height: 500px;
  background: #fafafa;
}

.chat-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.user-msg {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.ai-avatar {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.user-avatar {
  background: var(--accent);
  color: var(--dark);
}

.msg-body { max-width: 75%; }

.user-msg .msg-body { align-items: flex-end; display: flex; flex-direction: column; }

.msg-bubble {
  padding: 14px 18px;
  border-radius: 4px 18px 18px 18px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

.ai-msg .msg-bubble {
  background: white;
  border: 1.5px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.user-msg .msg-bubble {
  background: var(--primary);
  color: white;
  border-radius: 18px 4px 18px 18px;
}

.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble strong { font-weight: 700; }

.msg-time {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 6px;
  padding: 0 4px;
}

.user-msg .msg-time { text-align: right; }

/* Welcome tips */
.welcome-tips {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tip-item {
  background: var(--primary-pale);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--primary);
  font-weight: 500;
}

/* AI Response Formatted */
.ai-service-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 8px 0;
}

.ai-service-card .sc-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.92rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-service-card .sc-body {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.6;
}

.sc-tag {
  display: inline-block;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  margin-left: 6px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.typing-dots {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 4px 18px 18px 18px;
  padding: 14px 20px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 7px; height: 7px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* Input Area */
.chatbox-input-area {
  padding: 16px 20px;
  border-top: 1.5px solid var(--border);
  background: white;
}

.input-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.input-wrap textarea {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: var(--transition);
  line-height: 1.5;
  max-height: 120px;
  color: var(--text);
}

.input-wrap textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,79,160,0.1);
}

.send-btn {
  width: 48px; height: 48px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  color: white;
}

.send-btn svg { width: 20px; height: 20px; }

.send-btn:hover {
  background: var(--primary-light);
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(26,79,160,0.35);
}

.send-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Markdown-like rendering in AI bubble */
.msg-bubble ul {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}

.msg-bubble ul li {
  padding: 4px 0 4px 18px;
  position: relative;
  font-size: 0.88rem;
  line-height: 1.5;
}

.msg-bubble ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 0.8rem;
}

.msg-bubble h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.msg-bubble .strategy-box {
  background: linear-gradient(135deg, #e8f0fd, #f0f4fc);
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 0.86rem;
}

.msg-bubble .strategy-box strong {
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
}

.error-bubble {
  background: #fff5f5 !important;
  border-color: #feb2b2 !important;
  color: #c53030 !important;
}

/* Responsive for chat */
@media (max-width: 900px) {
  .ai-chat-wrap {
    grid-template-columns: 1fr;
  }

  .chat-hints-panel {
    position: static;
  }

  .hint-chips {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hint-chip {
    flex: 1;
    min-width: 140px;
  }
}

@media (max-width: 600px) {
  .chatbox-messages { max-height: 360px; }
  .msg-body { max-width: 88%; }
  .chatbox-header { padding: 16px 18px; }
  .chat-section-header { text-align: left; }
  .trust-badges { justify-content: flex-start; }
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: var(--dark);
  padding: 64px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 64px;
  margin-bottom: 48px;
}

.footer-brand .logo-footer { color: white; }

.footer-brand p {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  margin: 16px 0 24px;
  line-height: 1.7;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary);
  color: white;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-col h4 {
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-col li { margin-bottom: 10px; }

.footer-col a {
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  color: rgba(255,255,255,0.35);
  font-size: 0.82rem;
}

/* ===========================
   FLOATING BUTTON
   =========================== */
.floating-btn {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--accent);
  color: var(--dark);
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 4px 24px rgba(245,166,35,0.5);
  z-index: 999;
  transition: var(--transition);
  font-size: 1.4rem;
}

.floating-btn .floating-text {
  font-size: 0.6rem;
  font-weight: 700;
}

.floating-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 32px rgba(245,166,35,0.6);
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: 100px; right: 28px;
  background: var(--dark);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid #4ade80; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
  .problem-grid { grid-template-columns: repeat(2, 1fr); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { gap: 40px; }
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--dark);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 999;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    font-size: 1.4rem;
    color: white !important;
  }

  .btn-nav {
    background: var(--accent) !important;
    color: var(--dark) !important;
    padding: 14px 32px !important;
    font-size: 1.2rem !important;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 100px 24px 60px;
    min-height: auto;
  }

  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { display: none; }
  .scroll-hint { display: none; }

  .steps {
    flex-direction: column;
  }

  .step-arrow {
    transform: rotate(90deg);
    font-size: 1.4rem;
  }

  .problem-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }

  .community-inner,
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-form {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .section-title { font-size: 1.8rem; }
  .hero-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .hero-stats { gap: 16px; }
  .hero-stats strong { font-size: 1.4rem; }
  .footer-links { grid-template-columns: 1fr; }
  .trust-badges { flex-direction: column; }
}

/* ===========================
   프로젝트 팝업
   =========================== */
.project-toggle-btn {
  position: fixed;
  bottom: 104px;
  right: 28px;
  background: var(--dark);
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 50px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  z-index: 998;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.project-toggle-btn:hover {
  background: var(--primary);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,79,160,0.35);
}

.project-toggle-text { line-height: 1; }

.project-popup {
  position: fixed;
  bottom: 160px;
  right: 28px;
  z-index: 1001;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-popup.open {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.project-popup-inner {
  background: white;
  border-radius: 18px;
  padding: 20px 20px 20px 18px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 280px;
  max-width: 320px;
  position: relative;
}

/* 말풍선 꼬리 */
.project-popup-inner::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 28px;
  width: 16px;
  height: 16px;
  background: white;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.06);
  border-radius: 2px;
}

.project-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-text { flex: 1; }

.project-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.project-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 5px;
  line-height: 1.3;
}

.project-meta {
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.project-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  transition: var(--transition);
}

.project-close:hover { color: var(--dark); }

/* ===========================
   채팅 섹션 강조 (히어로 바로 아래)
   =========================== */
.contact {
  padding: 0 0 80px;
  background: linear-gradient(180deg, #0d2a6e 0%, #1a4fa0 30%, #2056b8 42%, var(--light) 55%);
}

.chat-section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

.chat-section-header .section-label {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.95);
}

.chat-section-header .section-title {
  color: white;
  margin-bottom: 16px;
}

.chat-section-header .section-title em { color: var(--accent); }

.chat-section-header .chat-section-desc {
  color: rgba(255,255,255,0.92);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 28px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.trust-badges .badge {
  background: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.6);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

@media (max-width: 600px) {
  .project-popup {
    right: 16px;
    bottom: 148px;
  }
  .project-toggle-btn {
    right: 16px;
    bottom: 96px;
  }
  .project-popup-inner {
    min-width: 250px;
  }
}

/* ===========================
   지원사업 패널
   =========================== */
.programs-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.programs-panel h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 2px;
}

/* 카테고리 탭 */
.prog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prog-tab {
  background: #f0f4f0;
  border: 1.5px solid transparent;
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.prog-tab:hover { border-color: var(--primary); color: var(--primary); }
.prog-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 검색창 */
.prog-search-wrap {
  display: flex;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.prog-search-input {
  flex: 1;
  min-width: 0; /* flex 자식이 넘치지 않도록 */
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.prog-search-input:focus { border-color: var(--primary); }

.prog-search-btn {
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: white;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.prog-search-btn:hover { background: var(--primary-dark, #153d8a); }

/* 목록 */
.prog-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 340px;
}

/* 로딩 */
.prog-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0;
  color: var(--text-light);
  font-size: 0.85rem;
}

.prog-dots {
  display: flex;
  gap: 6px;
}

.prog-dots span {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: progBounce 1.2s infinite;
  opacity: 0.5;
}
.prog-dots span:nth-child(2) { animation-delay: 0.2s; }
.prog-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes progBounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-7px); }
}

/* 빈 상태 */
.prog-empty {
  text-align: center;
  color: var(--text-light);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  padding: 32px 0;
  line-height: 1.8;
}

/* 프로그램 카드 */
.prog-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.prog-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(26,79,160,0.1);
}

.prog-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.prog-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  flex: 1;
}

.prog-card-ministry {
  font-size: 0.72rem;
  background: #edf2fd;
  color: var(--primary);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
}

.prog-card-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prog-card-row {
  font-size: 0.78rem;
  color: var(--text-mid);
  line-height: 1.5;
  display: flex;
  gap: 4px;
}

.prog-card-row strong {
  color: var(--dark);
  font-weight: 600;
  flex-shrink: 0;
}

.prog-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: nowrap;
}

.prog-btn-chat {
  flex: 1;
  min-width: 0;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prog-btn-chat:hover { background: #153d8a; }

.prog-btn-link {
  background: #edf2fd;
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.prog-btn-link:hover { background: #dce8f8; }

@media (max-width: 900px) {
  .prog-list { max-height: 220px; }
}

/* 공모전 배지 */
.contest-badge {
  background: linear-gradient(135deg, #f5a623, #e8941a) !important;
  color: white !important;
}
