/* Greensighter: chat-style demo booking (uses tokens from main.css) */

.chat-page { --ct-w: 680px; --ct-p: #6B56F0; --ct-soft: #F3F3F4; --ct-muted: #8A8A8A;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #FAFAFA; }

/* Top bar */
.ct-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 18px var(--gutter, 24px); background: rgba(250, 250, 250, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ct-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ct-muted); letter-spacing: .02em; }
.ct-status i { width: 7px; height: 7px; border-radius: 50%; background: #22B573; box-shadow: 0 0 0 3px rgba(34, 181, 115, .15); }
.ct-mail { margin-left: auto; font-size: 14px; color: var(--black); }
.ct-mail:hover { color: #555; }

/* Column */
.ct { flex: 1; width: min(var(--ct-w), 100% - 2 * var(--gutter, 24px)); margin: 0 auto; display: flex; flex-direction: column; }

/* Start state: intro + composer centred */
.ct-intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: clamp(64px, 18vh, 180px); animation: ct-in .7s cubic-bezier(.2, .7, .2, 1) both; }
.ct-orb { width: 56px; height: 56px; border-radius: 16px; background: var(--black); display: grid; place-items: center; margin-bottom: 10px; box-shadow: 0 10px 30px rgba(107, 86, 240, .25); }
.ct-orb img { width: 30px; }
.ct-intro__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; letter-spacing: -0.03em; color: var(--black); }
.ct-intro__sub { margin: 0; max-width: 440px; font-size: 17px; line-height: 1.5; color: #6B6B6B; }
.chat-page:not(.is-chatting) .ct-composer { margin-top: 32px; width: min(460px, 100%); align-self: center; animation: ct-in .7s .08s cubic-bezier(.2, .7, .2, 1) both; }
.chat-page:not(.is-chatting) .ct-legal { align-self: center; }
.chat-page.is-chatting .ct-intro, .chat-page.is-chatting .ct-legal { display: none; }

/* Chat state: composer pinned to the bottom */
.chat-page.is-chatting .ct-composer { position: sticky; bottom: 0; margin-top: auto; z-index: 4; box-shadow: 0 -18px 24px 4px #FAFAFA; }
.chat-page.is-chatting .ct { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

/* Progress (answers pinned to the top) */
.ct-progress { position: sticky; top: 71px; z-index: 3; margin: 16px 0 4px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .04); animation: ct-in .5s ease both; }
.ct-progress::before { content: ""; position: absolute; left: -16px; right: -16px; top: -18px; height: 18px; background: #FAFAFA; }
.ct-progress__head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ct-muted); }
.ct-progress__bar { display: grid; grid-auto-flow: column; gap: 4px; margin: 10px 0 12px; }
.ct-progress__bar i { height: 3px; border-radius: 2px; background: #E6E6E6; transition: background .3s; }
.ct-progress__bar i.on { background: var(--black); }
.ct-progress__bar.done i { background: var(--ct-p); }
.ct-pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.ct-pills::-webkit-scrollbar { display: none; }
.ct-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 6px 10px; border-radius: 999px; background: var(--ct-soft); border: 1px solid transparent; font: inherit; font-size: 13px; color: var(--black); cursor: pointer; transition: border-color .2s, background .2s; animation: ct-pop .35s cubic-bezier(.2, .7, .2, 1) both; }
.ct-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-pill svg { flex: none; opacity: .45; }
.ct-pill:hover { border-color: #CFCFCF; background: var(--white); }
.ct-pill:disabled { cursor: default; }

/* Messages */
.ct-log { display: flex; flex-direction: column; gap: 18px; padding: 20px 0 28px; }
.ct-log:empty { display: none; }
.ct-msg { display: flex; flex-direction: column; gap: 10px; animation: ct-in .45s cubic-bezier(.2, .7, .2, 1) both; }
.ct-msg--agent { align-items: flex-start; padding-left: 38px; position: relative; }
.ct-msg--agent::before { content: ""; position: absolute; left: 0; top: 18px; width: 26px; height: 26px; border-radius: 8px; background: var(--black) url("../img/logo-mark.svg") center / 15px no-repeat; }
.ct-msg--agent.is-cont::before { display: none; }
.ct-who { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #ABABAB; }
.ct-msg--agent.is-cont .ct-who { display: none; }
.ct-text { max-width: 560px; font-size: 16px; line-height: 1.55; color: var(--black); }
.ct-text .muted { color: var(--ct-muted); }
.ct-msg--user { align-items: flex-end; }
.ct-bubble { max-width: 80%; padding: 11px 16px; border-radius: 18px 18px 6px 18px; background: var(--black); color: #fff; font-size: 15px; line-height: 1.45; word-break: break-word; }
.ct-meta { font-size: 11px; color: #B0B0B0; }
.ct-err .ct-text { color: #C2410C; }

/* Typing indicator */
.ct-typing { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--ct-soft); }
.ct-typing i { width: 6px; height: 6px; border-radius: 50%; background: #A3A3A3; animation: ct-dot 1s infinite ease-in-out; }
.ct-typing i:nth-child(2) { animation-delay: .15s; }
.ct-typing i:nth-child(3) { animation-delay: .3s; }

/* Choice chips */
.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; max-width: 600px; }
.ct-chip { padding: 9px 15px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font: inherit; font-size: 14px; font-weight: 500; color: var(--black); cursor: pointer; transition: background .15s, border-color .15s, color .15s, opacity .2s, transform .15s; }
.ct-chip:hover { border-color: #BDBDBD; }
.ct-chip:active { transform: scale(.97); }
.ct-chip:focus-visible { outline: 2px solid var(--ct-p); outline-offset: 2px; }
.ct-chips.is-done .ct-chip { cursor: default; opacity: .4; border-color: transparent; background: transparent; padding-left: 8px; padding-right: 8px; }
.ct-chips.is-done .ct-chip.is-picked { opacity: 1; background: var(--black); color: #fff; border-color: var(--black); padding: 9px 15px; }
.ct-chip--primary { background: var(--black); color: #fff; border-color: var(--black); }
.ct-chip--primary:hover { background: #222; border-color: #222; }

/* Review card */
.ct-card { width: min(100%, 520px); border: 1px solid var(--line); border-radius: 16px; background: var(--white); overflow: hidden; }
.ct-row { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 12px; padding: 11px 14px; font-size: 14px; }
.ct-row + .ct-row { border-top: 1px solid #F0F0F0; }
.ct-row dt { color: var(--ct-muted); }
.ct-row dd { margin: 0; font-weight: 500; color: var(--black); overflow-wrap: anywhere; }
.ct-edit { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: #9A9A9A; display: grid; place-items: center; cursor: pointer; }
.ct-edit:hover { background: var(--ct-soft); color: var(--black); }
.ct-card.is-locked .ct-edit { visibility: hidden; }

/* Build checklist + result */
.ct-build { width: min(100%, 520px); padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.ct-build__head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ct-muted); }
.ct-build__bar { height: 3px; margin: 10px 0 12px; border-radius: 2px; background: #EEE; overflow: hidden; }
.ct-build__bar i { display: block; height: 100%; width: 0; background: var(--ct-p); transition: width .5s ease; }
.ct-build ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ct-build li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #A3A3A3; transition: color .3s; }
.ct-build li b { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #D4D4D4; display: grid; place-items: center; transition: background .3s, border-color .3s; }
.ct-build li.is-run { color: var(--black); }
.ct-build li.is-run b { border-color: var(--ct-p); border-right-color: transparent; animation: ct-spin .8s linear infinite; }
.ct-build li.is-ok { color: var(--black); }
.ct-build li.is-ok b { background: var(--black); border-color: var(--black); }
.ct-build li.is-ok b::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border: solid #fff; border-width: 0 0 1.6px 1.6px; transform: rotate(-45deg); }

.ct-result { width: min(100%, 520px); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--white); animation: ct-in .6s cubic-bezier(.2, .7, .2, 1) both; }
.ct-result__top { padding: 22px 22px 20px; background: linear-gradient(135deg, #EFEBFF, #F7F5FF 60%, #FFFFFF); }
.ct-result__tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ct-p); }
.ct-result__title { margin: 8px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; color: var(--black); }
.ct-flow { display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.ct-flow span { padding: 7px 12px; border-radius: 10px; background: var(--white); border: 1px solid #E4E0FF; font-size: 13px; font-weight: 500; }
.ct-flow em { font-style: normal; color: #B8B0F5; }
.ct-steps { list-style: none; margin: 0; padding: 18px 22px 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.ct-steps li { font-size: 13px; line-height: 1.4; color: #6B6B6B; }
.ct-steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 8px; border-radius: 50%; background: var(--black); color: #fff; font-size: 12px; font-weight: 600; }
.ct-steps li strong { display: block; color: var(--black); font-weight: 600; }
.ct-result__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px 20px; font-size: 13px; color: var(--ct-muted); }
.ct-result__foot a { flex: none; padding: 10px 16px; border-radius: 999px; background: var(--black); color: #fff; font-size: 14px; font-weight: 500; }

/* Composer */
.ct-composer { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s, box-shadow .2s; }
.ct-composer:focus-within { border-color: #BDBDBD; box-shadow: 0 0 0 4px rgba(107, 86, 240, .08); }
.ct-composer input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--black); }
.ct-composer input::placeholder { color: #A8A8A8; }
.ct-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 11px; background: var(--black); color: #fff; display: grid; place-items: center; cursor: pointer; transition: opacity .2s, transform .15s; }
.ct-send:active { transform: scale(.94); }
.ct-composer.is-busy .ct-send { opacity: .35; }
.ct-composer[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.ct-legal { margin: 14px 0 0; font-size: 12px; color: #A3A3A3; }
.ct-legal a { color: inherit; text-decoration: underline; }

@keyframes ct-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ct-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes ct-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes ct-spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .ct-top { gap: 12px; padding: 12px 16px; }
  .ct-top .logo > img { display: none; }
  .ct-status { font-size: 12px; }
  .ct-mail { display: none; }
  .ct { width: calc(100% - 32px); }
  .ct-progress { top: 59px; margin-top: 10px; padding: 12px; border-radius: 14px; }
  .ct-intro { padding-top: 12vh; }
  .ct-msg--agent { padding-left: 0; }
  .ct-msg--agent::before { display: none; }
  .ct-text { font-size: 15.5px; }
  .ct-bubble { max-width: 88%; }
  .ct-row { grid-template-columns: 92px 1fr auto; padding: 10px 12px; }
  .ct-steps { grid-template-columns: 1fr; gap: 10px; }
  .ct-steps li { display: flex; gap: 10px; align-items: flex-start; }
  .ct-steps li::before { flex: none; margin: 0; }
  .ct-result__foot { flex-direction: column; align-items: stretch; text-align: center; }
  .ct-result__foot a { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-page *, .chat-page *::before { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Saving state (replaces the step checklist) */
.ct-saving { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--ct-soft); font-size: 15px; color: var(--black); }
.ct-saving b { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ct-p); border-right-color: transparent; animation: ct-spin .8s linear infinite; }
