/* =========================================
   CHAT WIDGET — Pilot Signup Section
   Matches MCT landing page design system
   ========================================= */

.interview-section {
  padding: 64px 24px;
  background: var(--white);
}

.pilot-inner {
  max-width: 640px;
  margin: 0 auto;
}

/* ---- Pilot Chooser (two-path) ---- */

.pilot-heading {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: 8px;
}

.pilot-subhead {
  font-size: 0.95rem;
  color: var(--slate);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 8px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.pilot-subhead--cta {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 32px;
}

.pilot-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pilot-path {
  background: var(--light);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  border: 1.5px solid rgba(0,0,0,0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pilot-path:hover {
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.pilot-path-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  color: var(--warm);
}

.pilot-path-icon svg {
  width: 100%;
  height: 100%;
}

.pilot-path h4 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.pilot-path p {
  font-size: 0.82rem;
  color: var(--slate);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Quick email form inside path card */

.pilot-email-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pilot-email-form select,
.pilot-email-form .cw-role-other {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 10px 12px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.pilot-email-form select:focus,
.pilot-email-form .cw-role-other:focus {
  border-color: var(--warm);
}

.pilot-email-form input[type="email"] {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 10px 12px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.pilot-email-form input[type="email"]:focus {
  border-color: var(--warm);
}

.pilot-email-form button {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 14px;
  background: var(--warm);
  color: var(--white);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.pilot-email-form button:hover {
  background: var(--warm-hover);
}

/* Chat start button */

.pilot-chat-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.pilot-chat-btn:hover {
  background: var(--ink-light);
  transform: translateY(-1px);
}

/* ---- Quick Email Success ---- */

.pilot-quick-success {
  display: none;
  text-align: center;
  padding: 48px 24px;
}

.pilot-quick-success.active {
  display: block;
  animation: chatFadeIn 0.3s ease forwards;
}

.pilot-success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--green);
}

.pilot-success-icon svg {
  width: 100%;
  height: 100%;
}

.pilot-quick-success p {
  font-size: 1.05rem;
  color: var(--green);
  font-weight: 600;
}

/* ---- Under 18 Message ---- */

.under-18-message {
  display: none;
  text-align: center;
  padding: 32px 0;
}

.under-18-message.active {
  display: block;
}

.under-18-message p {
  font-size: 1rem;
  color: var(--ink-light);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* ---- Chat Container ---- */

.chat-container {
  display: none;
}

.chat-container.active {
  display: block;
}

.chat-back-btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--slate);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 0 12px;
  transition: color 0.2s;
}

.chat-back-btn:hover {
  color: var(--ink);
}

.chat-header {
  text-align: center;
  margin-bottom: 16px;
}

.chat-header h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.chat-header p {
  font-size: 0.88rem;
  color: var(--slate);
  line-height: 1.5;
}

/* ---- Mark Indicator ---- */

.chat-mark-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 16px;
  font-size: 0.82rem;
  color: var(--slate);
}

.chat-mark-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--warm);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Messages ---- */

.chat-messages {
  min-height: 120px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0;
  margin-bottom: 16px;
  scroll-behavior: smooth;
}

.chat-message {
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(8px);
  animation: chatFadeIn 0.3s ease forwards;
}

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

.chat-message--assistant .chat-bubble {
  background: var(--cream);
  color: var(--ink);
  border-radius: 14px 14px 14px 4px;
  padding: 14px 18px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-message--user {
  display: flex;
  justify-content: flex-end;
}

.chat-message--user .chat-bubble {
  background: var(--ink);
  color: var(--white);
  border-radius: 14px 14px 4px 14px;
  padding: 14px 18px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-typing {
  display: none;
  margin-bottom: 16px;
}

.chat-typing.active {
  display: block;
}

.chat-typing .chat-bubble {
  background: var(--cream);
  border-radius: 14px 14px 14px 4px;
  padding: 14px 18px;
  display: inline-block;
}

.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--slate);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---- Input ---- */

.chat-input-area {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 14px 16px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color 0.2s;
}

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

.chat-input::placeholder {
  color: var(--slate);
}

.chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-send-btn {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 20px;
  background: var(--warm);
  color: var(--white);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--warm-hover);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Email Capture (post-conversation) ---- */

.chat-email-capture {
  display: none;
  text-align: center;
  padding: 24px 0 0;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 24px;
}

.chat-email-capture.active {
  display: block;
  animation: chatFadeIn 0.4s ease forwards;
}

.chat-email-capture p {
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-bottom: 16px;
  line-height: 1.5;
}

.chat-email-form {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto 12px;
}

.chat-email-form input[type="email"] {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 14px 16px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}

.chat-email-form input[type="email"]:focus {
  border-color: var(--warm);
}

.chat-email-form button {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 20px;
  background: var(--warm);
  color: var(--white);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.chat-email-form button:hover {
  background: var(--warm-hover);
}

.chat-email-skip {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--slate);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.chat-email-skip:hover {
  color: var(--ink);
}

.chat-email-success {
  display: none;
  text-align: center;
  padding: 16px 0;
}

.chat-email-success.active {
  display: block;
  animation: chatFadeIn 0.3s ease forwards;
}

.chat-email-success p {
  font-size: 0.95rem;
  color: var(--green);
  font-weight: 600;
}

/* ---- Error State ---- */

.chat-error {
  display: none;
  text-align: center;
  padding: 16px;
  background: #fef2f2;
  border-radius: 10px;
  margin-top: 12px;
}

.chat-error.active {
  display: block;
}

.chat-error p {
  font-size: 0.88rem;
  color: #991b1b;
  line-height: 1.5;
}

/* ---- Responsive ---- */

@media (max-width: 500px) {
  .pilot-path {
    padding: 20px 16px;
  }

  .pilot-path-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
  }

  .pilot-path h4 {
    font-size: 0.9rem;
  }

  .pilot-path p {
    font-size: 0.78rem;
    margin-bottom: 12px;
  }

  .pilot-email-form input[type="email"] {
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .pilot-email-form button,
  .pilot-chat-btn {
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .chat-email-form {
    flex-direction: column;
  }
}
