/* Global Styles */
:root {
  --primary: #5C7C64;
  --primary-hover: #455C4A;
  --secondary: #8E9B90;
  --bg-color: #FBFAF6;
  --card-bg: #FFFFFF;
  --text-main: #23252E;
  --text-muted: #6A6E7C;
  --border-color: #E7E3D8;
  --gold: #D99405;
  --red: #C0492F;
  --radius-lg: 16px;
  --radius-md: 10px;
  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-serif: 'Sora', var(--font-sans);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Header Styles */
.header {
  text-align: center;
  margin-bottom: 24px;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 26px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Quiz Card Container */
.quiz-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: 0 10px 30px rgba(92, 124, 100, 0.05);
  position: relative;
  overflow: hidden;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 24px;
}

.progress-bar {
  background-color: var(--border-color);
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  background-color: var(--primary);
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 99px;
}

.progress-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: right;
}

/* Steps Transition */
.quiz-step {
  display: none;
}

.quiz-step.active {
  display: block;
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
.title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--text-main);
  text-align: center;
  margin-top: 16px;
  margin-bottom: 12px;
}

.description {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  padding: 0 8px;
}

.step-question {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 8px;
}

.step-instruction {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Card Selection Layouts */
.grid {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

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

@media (min-width: 480px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Option Card */
.option-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  background-color: var(--card-bg);
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.card-content .icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.card-content .label {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
}

.card-content .subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* States */
.option-card:hover {
  border-color: var(--primary);
  background-color: rgba(92, 124, 100, 0.02);
}

.option-card input:checked + .card-content {
  color: var(--primary);
}

.option-card:has(input:checked) {
  border-color: var(--primary);
  background-color: rgba(92, 124, 100, 0.05);
  box-shadow: 0 0 0 1px var(--primary);
}

/* List layouts */
.list-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.list-card {
  padding: 14px 16px;
}

.list-card .card-content {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.list-card .card-content .icon {
  margin-bottom: 0;
}

.label-group {
  display: flex;
  flex-direction: column;
}

/* Upload Style */
.upload-container {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background-color: #FAFAFA;
  transition: border-color 0.2s ease;
  margin-bottom: 24px;
}

.upload-container:hover {
  border-color: var(--primary);
}

.upload-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.upload-text {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.upload-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.preview-container img {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.remove-photo-btn {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

/* Button & Controls */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #f7f7f7;
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 16px;
}

/* Form Styling */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color 0.2s ease;
  color: var(--text-main);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.required {
  color: var(--red);
}

/* Intro specific styling */
.hero-image-placeholder {
  width: 80px;
  height: 80px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  opacity: 0.85;
}

/* Success step */
.loading-state, .success-state {
  text-align: center;
  padding: 30px 10px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.success-icon {
  width: 64px;
  height: 64px;
  background-color: rgba(92, 124, 100, 0.1);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  margin: 0 auto 20px;
}

.success-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.success-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.success-desc strong {
  color: var(--text-main);
}

/* ==========================================================================
   Chatbot Widget Styling
   ========================================================================== */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-sans);
}

/* Chat bubble button */
.chatbot-bubble {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 99px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(92, 124, 100, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-bubble:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 124, 100, 0.4);
}

.bubble-icon {
  font-size: 18px;
}

/* Chat panel window */
.chatbot-panel {
  width: 360px;
  height: 520px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  bottom: 0;
  right: 0;
  animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.chat-header {
  background-color: var(--primary);
  color: #ffffff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  font-size: 24px;
  background-color: rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-name {
  font-weight: 600;
  font-size: 15px;
}

.chat-status {
  font-size: 11px;
  opacity: 0.85;
}

.chat-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chat-close:hover {
  opacity: 1;
}

/* Messages Body */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #FAFAFA;
}

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg.bot {
  background-color: #ffffff;
  color: var(--text-main);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.chat-msg.user {
  background-color: var(--primary);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(92, 124, 100, 0.15);
}

/* Option Chips */
.chat-options {
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background-color: #FAFAFA;
  border-top: 1px solid rgba(231, 227, 216, 0.5);
}

.chat-chip {
  background-color: #ffffff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-chip:hover {
  background-color: var(--primary);
  color: #ffffff;
}

/* Input Area */
.chat-input-container {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  background-color: #ffffff;
}

.chat-input-container input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  font-family: var(--font-sans);
}

.chat-input-container input:focus {
  border-color: var(--primary);
}

.chat-input-container button {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chat-input-container button:hover {
  background-color: var(--primary-hover);
}

/* Mobile responsive chatbot */
@media (max-width: 480px) {
  .chatbot-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 0;
    right: 0;
  }
  .chatbot-widget {
    bottom: 16px;
    right: 16px;
  }
}
