@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;1,400&family=Source+Sans+3:wght@400;600&display=swap');

/* ── Full-screen overlay (Elementor inline mode) ── */
html.ccc-chat-overlay-open,
body.ccc-chat-overlay-open {
  overflow: hidden !important;
  height: 100%;
}

body.ccc-chat-overlay-open {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

.ccc-chat-overlay,
.ccc-chat-overlay *,
.ccc-chat-wrap,
.ccc-chat-wrap * {
  box-sizing: border-box;
}

.ccc-chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 999990;
  background: #F2ECDA;
  opacity: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  height: 100%;
  height: 100dvh;
  transition: opacity 0.35s ease;
}

.ccc-chat-overlay--visible {
  opacity: 1;
}

.ccc-chat-overlay__close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ccc-hairline, rgba(33, 30, 24, 0.14));
  background: rgba(255, 254, 248, 0.95);
  color: var(--ccc-ink, #211E18);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.ccc-chat-overlay__close:hover,
.ccc-chat-overlay__close:focus {
  background: #fff;
  border-color: #9C4A26;
  outline: none;
}

.ccc-chat-overlay__close span {
  display: block;
  margin-top: -2px;
}

.ccc-chat-overlay__stage {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px) clamp(32px, 5vh, 48px);
  min-height: 100%;
}

.ccc-chat-wrap--overlay {
  width: 100%;
}

.ccc-chat-wrap--overlay .ccc-chat-layout {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.ccc-chat-wrap--overlay .ccc-chat-header {
  display: block;
  text-align: center;
  padding: clamp(52px, 7vh, 64px) 0 12px;
}

.ccc-chat-wrap--overlay .ccc-chat-sub {
  margin-left: auto;
  margin-right: auto;
}

.ccc-chat-wrap--overlay .ccc-chat-panel {
  width: 100%;
  min-height: auto;
  border: none;
  background: transparent;
  display: block;
  overflow: visible;
}

.ccc-chat-wrap--overlay .ccc-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: none;
  max-height: none !important;
  overflow: visible !important;
  overflow-y: visible !important;
  padding: 16px 0 12px;
}

.ccc-chat-wrap--overlay .ccc-chat-options--thread {
  position: static;
  margin: 12px 0 20px 48px;
  padding: 0;
  max-width: 92%;
  background: transparent;
}

.ccc-chat-options--thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: ccc-msg-in 0.35s ease;
}

.ccc-chat-multi-hint {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--ccc-stone);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.ccc-chat-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  min-height: 48px;
  background: #FFFEF8;
  border: 1px solid #C9C2AF;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.ccc-chat-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ccc-chat-check__box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid #9C4A26;
  background: #fff;
  position: relative;
}

.ccc-chat-check--on .ccc-chat-check__box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #232C1E;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ccc-chat-check--on {
  border-color: #9C4A26;
  background: #fff;
}

.ccc-chat-check__text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--ccc-ink);
}

.ccc-chat-btn--continue {
  margin-top: 6px;
  width: 100%;
  text-align: center;
}

.ccc-chat-btn--shake {
  animation: ccc-shake 0.35s ease;
}

@keyframes ccc-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.ccc-chat-state-field select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid #C9C2AF;
  border-radius: 0;
  background: #FFFEF8;
  font-family: inherit;
  color: var(--ccc-ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6857' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.ccc-chat-other-field textarea {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.45;
  border: 1px solid #C9C2AF;
  border-radius: 0;
  background: #FFFEF8;
  font-family: inherit;
  color: var(--ccc-ink);
  resize: vertical;
  min-height: 88px;
  -webkit-appearance: none;
  appearance: none;
}

.ccc-chat-other-field[hidden] {
  display: none !important;
}

.ccc-chat-other-field--error textarea {
  border-color: #9C4A26;
  box-shadow: 0 0 0 1px rgba(156, 74, 38, 0.25);
}

.ccc-chat-wrap--overlay .ccc-msg--user {
  align-self: flex-end;
}

.ccc-chat-wrap--overlay .ccc-chat-messages {
  gap: 14px;
}

.ccc-chat-wrap--overlay .ccc-chat-final {
  position: static;
  margin-top: 12px;
  padding: 4px 0 max(32px, env(safe-area-inset-bottom, 32px));
  background: transparent;
}

.ccc-chat-wrap--overlay .ccc-chat-scroll-anchor {
  display: block;
  width: 100%;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  visibility: hidden;
  pointer-events: none;
}

.ccc-chat-wrap--overlay .ccc-msg {
  max-width: 88%;
}

/* ── Dedicated shortcode page — wide centered column ── */
.ccc-chat-wrap--page .ccc-chat-layout {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
}

.ccc-chat-wrap--page .ccc-chat-panel {
  width: 100%;
}

.ccc-chat-wrap--page .ccc-chat-messages {
  max-height: min(62vh, 560px);
}

.ccc-chat-wrap--inline {
  width: 100%;
  max-width: 100%;
  animation: ccc-fade-in 0.35s ease;
}

.ccc-inline-mount {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.ccc-form-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.ccc-form-restoring {
  animation: ccc-form-restore 0.4s ease forwards;
}

@keyframes ccc-form-restore {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Inline: page headings already exist in Elementor — hide duplicate chat header */
.ccc-chat-wrap--inline .ccc-chat-header {
  display: none;
}

.ccc-chat-wrap--inline .ccc-chat-layout {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.ccc-chat-wrap--inline .ccc-chat-panel {
  min-height: 420px;
  width: 100%;
}

.ccc-chat-wrap--inline .ccc-chat-messages {
  max-height: 480px;
}

.ccc-chat-wrap--inline .ccc-chat-options {
  padding-left: 24px;
  padding-right: 24px;
}

.ccc-chat-wrap {
  --ccc-green: #232C1E;
  --ccc-green-deep: #1B2318;
  --ccc-green-night: #14180F;
  --ccc-sand: #F2ECDA;
  --ccc-sand-dark: #E9E1CB;
  --ccc-bone: #F3EFE2;
  --ccc-ink: #211E18;
  --ccc-brass: #A67C44;
  --ccc-brass-light: #D6BA83;
  --ccc-terra: #9C4A26;
  --ccc-stone: #6E6857;
  --ccc-soft: #57523F;
  --ccc-hairline: rgba(33, 30, 24, 0.14);
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ccc-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.ccc-chat-layout {
  max-width: 920px;
  margin: 0 auto;
}

.ccc-chat-header {
  margin-bottom: 28px;
}

.ccc-chat-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ccc-brass);
  margin-bottom: 14px;
}

.ccc-chat-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.18;
  margin: 0 0 12px;
  color: var(--ccc-ink);
}

.ccc-chat-sub {
  font-size: 17px;
  color: var(--ccc-soft);
  margin: 0 0 20px;
  max-width: 720px;
}

.ccc-chat-progress {
  height: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
}

.ccc-chat-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ccc-brass), var(--ccc-terra));
  transition: width 0.45s ease;
}

.ccc-chat-panel {
  background: #FBF7EB;
  border: 1px solid var(--ccc-hairline);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.ccc-chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 28px 12px;
  max-height: 520px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.ccc-msg {
  display: flex;
  gap: 12px;
  max-width: 92%;
  animation: ccc-msg-in 0.4s ease;
}

.ccc-msg--bot {
  align-self: flex-start;
}

.ccc-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ccc-msg--system {
  align-self: center;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  animation: ccc-msg-in 0.45s ease;
}

.ccc-msg__system {
  margin: 0 auto 8px;
  padding: 0 0 18px;
  font-size: clamp(9px, 2.15vw, 11px);
  font-weight: 600;
  letter-spacing: 1.5px;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ccc-stone);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ccc-hairline);
  border-radius: 0;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
}

.ccc-msg__avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ccc-green);
  color: var(--ccc-bone);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccc-msg--user .ccc-msg__avatar {
  background: var(--ccc-terra);
}

.ccc-msg__body {
  min-width: 0;
}

.ccc-msg__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ccc-stone);
  margin-bottom: 6px;
}

.ccc-msg__bubble {
  padding: 16px 18px;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.55;
  border-radius: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ccc-msg--bot .ccc-msg__bubble {
  background: var(--ccc-sand);
  border: 1px solid var(--ccc-hairline);
  color: var(--ccc-ink);
}

.ccc-msg--user .ccc-msg__bubble {
  background: var(--ccc-green);
  color: var(--ccc-bone);
  white-space: pre-wrap;
}

.ccc-msg--typing .ccc-msg__bubble {
  padding: 14px 20px;
  min-width: 64px;
}

.ccc-typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  height: 18px;
}

.ccc-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ccc-stone);
  animation: ccc-dot 1.4s infinite ease-in-out;
}

.ccc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ccc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ccc-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes ccc-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes ccc-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.ccc-chat-options {
  padding: 8px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ccc-chat-option {
  width: 100%;
  text-align: left;
  background: #FFFEF8 !important;
  border: 1px solid #C9C2AF !important;
  color: #211E18 !important;
  padding: 16px 20px;
  min-height: 48px;
  font-size: 16px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, background 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.ccc-chat-option:hover:not(:disabled),
.ccc-chat-option:focus:not(:disabled) {
  border-color: #9C4A26 !important;
  background: #ffffff !important;
  color: #211E18 !important;
  transform: none;
}

.ccc-chat-option:disabled {
  opacity: 0.5;
  cursor: default;
  color: #211E18 !important;
}

.ccc-chat-final {
  padding: 0 28px 28px;
}

.ccc-chat-final .ccc-final-form {
  border-top: 1px solid var(--ccc-hairline);
  padding-top: 20px;
}

.ccc-final-form--disqualified {
  border-top: 1px solid var(--ccc-hairline);
  padding-top: 20px;
}

.ccc-final-form--disqualified .ccc-final-reassure {
  color: var(--ccc-stone);
}

.ccc-final-field {
  margin-bottom: 18px;
}

.ccc-final-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ccc-final-field input,
.ccc-final-field select,
.ccc-final-field textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid #C9C2AF;
  border-radius: 0;
  background: #FFFEF8;
  font-family: inherit;
  color: var(--ccc-ink);
}

.ccc-final-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236E6857' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.ccc-chat-btn {
  display: inline-block;
  background: var(--ccc-green);
  color: var(--ccc-bone);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  padding: 17px 38px;
  border: none;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease;
}

.ccc-chat-btn:hover {
  background: var(--ccc-green-night);
  color: var(--ccc-bone);
}

.ccc-chat-btn--outline {
  background: transparent;
  color: var(--ccc-green);
  border: 1px solid var(--ccc-green);
}

.ccc-chat-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ccc-chat-missing {
  background: #FBF7EB;
  border: 1px solid var(--ccc-hairline);
  padding: 40px 28px;
  text-align: center;
}

.ccc-chat-missing p {
  font-size: 17px;
  color: var(--ccc-soft);
  margin-bottom: 20px;
}

.ccc-final-reassure {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: var(--ccc-stone);
  margin-top: 16px;
}

@media (max-width: 720px) {
  .ccc-chat-overlay__stage {
    padding: 0 16px;
    padding-left: max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
  }

  .ccc-chat-overlay__close {
    top: max(12px, env(safe-area-inset-top, 12px));
    right: max(12px, env(safe-area-inset-right, 12px));
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .ccc-chat-wrap--overlay .ccc-chat-header {
    padding-top: max(56px, calc(env(safe-area-inset-top, 12px) + 44px));
  }

  .ccc-chat-wrap--overlay .ccc-chat-title {
    font-size: clamp(22px, 6.5vw, 32px);
  }

  .ccc-chat-wrap--overlay .ccc-chat-sub {
    font-size: 15px;
    padding: 0 8px;
  }

  .ccc-chat-wrap--overlay .ccc-chat-options--thread,
  .ccc-chat-wrap--overlay .ccc-chat-messages,
  .ccc-chat-wrap--overlay .ccc-chat-options,
  .ccc-chat-wrap--overlay .ccc-chat-final {
    padding-left: 0;
    padding-right: 0;
  }

  .ccc-chat-wrap--overlay .ccc-chat-options--thread {
    margin: 8px 0 16px;
    max-width: 100%;
  }

  .ccc-chat-wrap--overlay .ccc-msg {
    max-width: 100%;
    gap: 8px;
  }

  .ccc-msg__system {
    white-space: normal;
    letter-spacing: 1px;
    font-size: 10px;
  }

  .ccc-msg__bubble {
    font-size: 15px;
    padding: 14px 16px;
  }

  .ccc-msg__avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }

  .ccc-chat-option,
  .ccc-chat-check {
    padding: 14px 16px;
    font-size: 15px;
    min-height: 48px;
  }

  .ccc-chat-check__text {
    font-size: 15px;
  }

  .ccc-chat-btn,
  .ccc-chat-btn--continue {
    width: 100%;
    text-align: center;
    padding: 16px 24px;
    min-height: 48px;
  }

  .ccc-chat-messages,
  .ccc-chat-options,
  .ccc-chat-final {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ccc-msg {
    max-width: 100%;
  }

  .ccc-final-reassure {
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  .ccc-chat-overlay__stage {
    padding-left: 12px;
    padding-right: 12px;
  }

  .ccc-chat-wrap--overlay .ccc-chat-title {
    font-size: 22px;
  }

  .ccc-chat-option,
  .ccc-chat-check {
    padding: 13px 14px;
  }
}
