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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #252525;
  --border: #333;
  --text: #e8e0d6;
  --text-dim: #8a8078;
  --accent: #c9a96e;
  --accent-hover: #d4b97e;
  --accent-glow: rgba(201, 169, 110, 0.15);
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ============ Step visibility ============ */
.step {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.step.active {
  display: flex;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

/* ============ Logo ============ */
.logo {
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 40px;
  font-weight: 700;
  padding: 8px 20px;
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid rgba(201, 169, 110, 0.15);
  border-radius: 100px;
}

/* ============ Step 1: Input ============ */
h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 40px;
  line-height: 1.8;
}

.input-group {
  display: flex;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto 16px;
}

.input-group input {
  flex: 1;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--accent);
}

.input-group button,
button {
  padding: 14px 28px;
  background: var(--accent);
  color: #0f0f0f;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
  white-space: nowrap;
}

.input-group button:hover,
button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.input-group button:active,
button:active {
  transform: translateY(0);
}

.hint {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  gap: 0;
  max-width: 340px;
  margin: 0 auto 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.mode-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab:hover {
  color: var(--text);
  background: transparent;
  transform: none;
}

.mode-tab.active {
  background: var(--accent);
  color: #0f0f0f;
  font-weight: 600;
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

/* Industry Select */
.industry-select-group {
  max-width: 500px;
  margin: 0 auto 12px;
}

.industry-select-group select {
  width: 100%;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238a8078' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L2 5h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.industry-select-group select:focus {
  border-color: var(--accent);
}

.custom-industry-wrap {
  max-width: 500px;
  margin: 0 auto 12px;
}

.custom-industry-wrap input {
  width: 100%;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.custom-industry-wrap input:focus {
  border-color: var(--accent);
}

.btn-full {
  width: 100%;
  max-width: 500px;
  padding: 14px 28px;
  margin-bottom: 12px;
}

/* ============ LINE Demo Section ============ */
.line-demo-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.line-demo-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.line-chat-mock {
  max-width: 380px;
  margin: 0 auto;
  background: #f7f8fa;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.line-chat-header {
  background: #06c755;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.line-chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.line-chat-name {
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-chat-badge {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.line-chat-time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-left: 8px;
}

.line-demo-subtitle {
  text-align: center;
  padding: 6px 14px;
  font-size: 0.75rem;
  color: #c9a96e;
  letter-spacing: 0.5px;
  background: rgba(201, 169, 110, 0.08);
}

.line-chat-body {
  padding: 16px 14px;
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.line-msg {
  display: flex;
  opacity: 0;
  transform: translateY(8px);
  animation: lineSlideIn 0.3s ease forwards;
}

.line-msg.customer {
  justify-content: flex-end;
}

.line-msg.ai {
  justify-content: flex-start;
}

.line-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #1a1a1a;
  word-break: break-word;
}

.line-msg.customer .line-bubble {
  background: #06c755;
  color: white;
  border-bottom-right-radius: 4px;
}

.line-msg.ai .line-bubble {
  background: white;
  border: 1px solid #e5e5e5;
  border-bottom-left-radius: 4px;
}

.line-msg.ai .line-bubble.status-bubble {
  background: #e8f5e9;
  border-color: #c8e6c9;
  font-weight: 600;
  font-size: 0.82rem;
  color: #2e7d32;
}

.line-typing {
  display: flex;
  justify-content: flex-start;
}

.line-typing-bubble {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 10px 16px;
  display: inline-flex;
  gap: 4px;
}

.line-typing-bubble span {
  width: 6px;
  height: 6px;
  background: #aaa;
  border-radius: 50%;
  animation: lineDotBounce 1.2s infinite;
}

.line-typing-bubble span:nth-child(2) {
  animation-delay: 0.2s;
}

.line-typing-bubble span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes lineDotBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
}

@keyframes lineSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.line-chat-body.fade-out {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.line-chat-body.fade-in {
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Carousel dots */
.line-demo-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  background: #f0f1f3;
  border-top: 1px solid #e5e5e5;
}

.line-demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ccc;
  transition: all 0.3s;
}

.line-demo-dot.active {
  background: #06c755;
  width: 20px;
  border-radius: 4px;
}

/* ============ Benefits Section ============ */
.benefits-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 540px;
  margin: 0 auto;
}

.benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: left;
  transition: border-color 0.2s;
}

.benefit-card:hover {
  border-color: var(--accent);
}

.benefit-icon {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background: var(--accent);
  color: #0f0f0f;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.benefit-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.benefit-card p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============ FOMO Section ============ */
.fomo-banner {
  margin-top: 40px;
  text-align: center;
}

.fomo-banner-img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: var(--radius);
}

/* ============ Step 2: Processing ============ */
.progress-section {
  padding: 40px 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-section h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.progress-detail {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
  min-height: 1.4em;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ============ Step 3: Ready ============ */
.result-header {
  margin-bottom: 32px;
}
.result-header h2 {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.result-header p {
  color: var(--text-dim);
}

/* Chat */
.chat-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.chat-messages {
  height: 320px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  display: flex;
}
.msg.user {
  justify-content: flex-end;
}
.msg.assistant {
  justify-content: flex-start;
}

.msg-bubble {
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg.user .msg-bubble {
  background: var(--accent);
  color: #0f0f0f;
  border-bottom-right-radius: 4px;
}

.msg.assistant .msg-bubble {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-input-group {
  display: flex;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.chat-input-group input {
  flex: 1;
  padding: 14px 18px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.chat-input-group button {
  border-radius: 0;
  padding: 14px 24px;
}

/* Chat Mode Toggle */
.chat-mode-toggle {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.mode-toggle-btn {
  padding: 8px 20px;
  font-size: 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-toggle-btn.product-btn {
  background: linear-gradient(135deg, var(--accent), #d4b97e);
  color: #0f0f0f;
}

.mode-toggle-btn.product-btn:hover {
  box-shadow: 0 2px 12px var(--accent-glow);
}

.mode-toggle-btn.business-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.mode-toggle-btn.business-btn:hover {
  border-color: var(--accent);
}

/* System Message */
.msg.system {
  justify-content: center;
}

.msg.system .msg-bubble {
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 4px 12px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  max-width: 90%;
}

/* Sales CTA */
.sales-cta {
  margin-bottom: 24px;
}

.sales-btn {
  width: 100%;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--accent), #d4b97e);
  color: #0f0f0f;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.sales-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(201, 169, 110, 0.3);
}

/* QR */
.qr-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
}

.qr-section h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.qr-section p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.qr-container {
  display: flex;
  justify-content: center;
}

.qr-container svg {
  width: 180px;
  height: 180px;
  background: white;
  padding: 12px;
  border-radius: 8px;
}

.qr-link {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 24px;
  background: #06c755;
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
}

.qr-link:hover {
  background: #05b04a;
}

.qr-guide {
  margin-top: 24px;
  text-align: center;
}

.qr-guide-title {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.qr-guide-img {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
}

/* Share */
.share-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin-top: 24px;
}

.share-section h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.share-section p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.share-btn {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.share-result {
  margin-top: 20px;
  text-align: center;
}

.share-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.share-qr svg {
  width: 160px;
  height: 160px;
  background: white;
  padding: 10px;
  border-radius: 8px;
}

.share-link {
  display: inline-block;
  margin-bottom: 12px;
  padding: 10px 24px;
  background: #06c755;
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
}

.copy-btn {
  display: block;
  margin: 8px auto;
  padding: 8px 20px;
  font-size: 0.85rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.share-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 12px;
}

/* ============ Step 4: Error ============ */
.error-section h2 {
  color: #e55;
  margin-bottom: 12px;
}
.error-section p {
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* ============ Typing indicator ============ */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

/* ============ Mobile ============ */
@media (max-width: 768px) {
  .container {
    padding: 32px 20px;
  }
  .input-group {
    flex-direction: column;
  }
  .input-group button {
    width: 100%;
  }
  .subtitle br {
    display: none;
  }
  .mode-tabs {
    max-width: 100%;
  }
  .line-demo-section {
    margin-top: 32px;
    padding-top: 28px;
  }
  .line-chat-mock {
    max-width: 340px;
  }
  .benefits-section {
    margin-top: 36px;
    padding-top: 32px;
  }
  .benefits-grid {
    gap: 12px;
  }
  .benefit-card {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 24px 16px;
  }
  .logo {
    font-size: 0.85rem;
    margin-bottom: 28px;
    padding: 6px 16px;
  }
  h1 {
    font-size: 1.35rem;
  }
  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 28px;
  }
  .result-header h2 {
    font-size: 1.15rem;
    word-break: break-word;
  }
  .result-header p {
    font-size: 0.85rem;
  }
  .line-demo-section {
    margin-top: 24px;
    padding-top: 20px;
  }
  .line-chat-mock {
    max-width: 100%;
  }
  .line-chat-body {
    height: 280px;
    padding: 14px 12px;
  }
  .line-bubble {
    font-size: 0.84rem;
    max-width: 80%;
  }
  .benefits-section {
    margin-top: 28px;
    padding-top: 24px;
  }
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 100%;
  }
  .benefit-card {
    padding: 18px 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }
  .benefit-icon {
    margin-bottom: 0;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 0.7rem;
    border-radius: 6px;
  }
  .benefit-card h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }
  .benefit-card p {
    font-size: 0.82rem;
  }
  .fomo-banner {
    margin-top: 24px;
  }
  .chat-messages {
    height: 260px;
    padding: 14px;
  }
  .msg-bubble {
    font-size: 0.9rem;
  }
  .chat-input-group input {
    padding: 12px 14px;
    font-size: 0.9rem;
    min-width: 0;
  }
  .chat-input-group button {
    padding: 12px 16px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }
  .sales-btn {
    font-size: 0.95rem;
    padding: 14px 20px;
  }
  .qr-section {
    padding: 24px 16px;
  }
  .qr-section p br {
    display: none;
  }
  .qr-container svg {
    width: 150px;
    height: 150px;
  }
  .share-section {
    padding: 24px 16px;
  }
  .demo-case-card {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }
  .demo-case-card video {
    max-height: 480px;
  }
  .demo-case-card-body {
    padding: 12px;
  }
  .demo-case-headline {
    font-size: 0.9rem;
  }
  .demo-case-tagline {
    font-size: 0.8rem;
  }
}

/* ============ Case Video Showcase ============ */
.demo-case-videos {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.demo-case-videos-title {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 24px;
}

.demo-case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  text-align: left;
}

.demo-case-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  background: #000;
  object-fit: contain;
}

.demo-case-card-body {
  padding: 16px;
}

.demo-case-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-glow);
  border: 1px solid rgba(201, 169, 110, 0.25);
  border-radius: 100px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.demo-case-headline {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.demo-case-headline em {
  font-style: normal;
  color: var(--accent);
}

.demo-case-tagline {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.demo-case-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 12px;
  background: rgba(201, 169, 110, 0.08);
  border-radius: 8px;
  font-size: 0.8rem;
}

.demo-case-metric strong {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 800;
}

.demo-case-metric span {
  color: var(--text-dim);
}

/* Demo case video grid on wider screens */
@media (min-width: 480px) {
  .demo-case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .demo-case-card {
    margin-bottom: 0;
  }
}
