:root {
  --assistant-success: #17704a;
  --assistant-error: #a33434;
}

.assistant-page {
  min-height: 100vh;
}

.assistant-page .nav-menu a.is-active {
  color: var(--blue);
}

.assistant-page .nav-menu a.is-active::after {
  transform: scaleX(1);
}

.assistant-main {
  position: relative;
  z-index: 2;
  padding: 120px 0 30px;
}

.assistant-intro-block,
.assistant-tool-block {
  position: relative;
}

.assistant-intro-block::before,
.assistant-tool-block::before {
  content: "";
  position: absolute;
  inset: 18px -28px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  box-shadow: 0 18px 52px rgba(33, 68, 99, 0.15);
  pointer-events: none;
}

.assistant-intro-block::before {
  background: linear-gradient(135deg, #f6f2e8 0%, #e7eef3 100%);
}

.assistant-tool-block::before {
  background: linear-gradient(135deg, #e9f2f6 0%, #c9deea 100%);
  box-shadow: 0 18px 52px rgba(33, 68, 99, 0.16);
}

.assistant-tool-block.section {
  padding-top: 48px;
  padding-bottom: 48px;
}

.assistant-intro-block.section {
  padding-top: 32px !important;
  padding-bottom: 48px !important;
}

.assistant-intro-block .tag {
  margin-bottom: 0;
}

.assistant-intro-block h1 {
  max-width: none;
  margin-top: 14px;
  color: var(--ink);
  font-size: clamp(1.65rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
}

.assistant-intro-block > p {
  max-width: none;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.generating-screen > span,
.result-screen__eyebrow,
.project-contact__heading > span {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.welcome-screen[hidden],
.assistant-progress[hidden],
.chat-screen[hidden],
.generating-screen[hidden],
.result-screen[hidden],
.project-contact[hidden],
.assistant-button[hidden],
.chat-plan-button[hidden] {
  display: none !important;
}

.assistant-workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.assistant-progress {
  margin: 0 clamp(4px, 1vw, 10px) 8px;
  padding: 10px 0 14px;
  border-bottom: 1px solid rgba(42, 93, 145, 0.12);
}

.assistant-progress__meta {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.assistant-progress__meta strong {
  color: var(--blue);
}

.assistant-progress__track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(42, 93, 145, 0.12);
}

.assistant-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--cyan), var(--blue));
  transition: width 0.35s ease;
}

.assistant-card {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 6%, rgba(72, 185, 223, 0.13), transparent 17rem),
    rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 38px rgba(42, 93, 145, 0.09);
}

.assistant-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--cyan), var(--blue));
  pointer-events: none;
}

.welcome-screen,
.chat-screen,
.generating-screen,
.result-screen {
  min-height: 350px;
  padding: clamp(24px, 3vw, 34px);
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.welcome-screen__heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.assistant-avatar {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), #3c82b7);
  box-shadow: 0 12px 26px rgba(42, 93, 145, 0.2);
}

.assistant-avatar svg {
  width: 25px;
  height: 25px;
}

.assistant-avatar--small {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  box-shadow: 0 9px 20px rgba(42, 93, 145, 0.18);
}

.assistant-avatar--small svg {
  width: 21px;
  height: 21px;
}

.welcome-screen h2,
.generating-screen h2,
.result-screen h2 {
  margin-top: 7px;
  color: #10283e;
  font-size: clamp(1.65rem, 2.6vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.welcome-screen__heading h2 {
  margin-top: 0;
}

.welcome-screen > p {
  max-width: none;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.62;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.welcome-screen__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 17px 0 20px;
}

.welcome-screen__trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(42, 93, 145, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.76rem;
  font-weight: 750;
}

.welcome-screen__trust svg {
  width: 16px;
  height: 16px;
  color: var(--blue);
}

.assistant-button {
  min-height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  border: 0;
  border-radius: 13px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.assistant-button:hover {
  transform: translateY(-2px);
}

.assistant-button:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.assistant-button svg {
  width: 18px;
  height: 18px;
}

.assistant-button--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #347db5);
  box-shadow: 0 13px 26px rgba(42, 93, 145, 0.21);
}

.assistant-button--ghost {
  color: var(--blue);
  background: #edf4f7;
}

.chat-screen {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.chat-screen__header {
  min-height: 77px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(42, 93, 145, 0.1);
  background: rgba(255, 255, 255, 0.66);
}

.chat-screen__profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-screen__identity {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-screen__identity strong {
  overflow: hidden;
  color: #173149;
  font-size: 0.93rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-screen__identity span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--assistant-success);
  font-size: 0.69rem;
  font-weight: 800;
}

.chat-screen__identity span svg {
  width: 8px;
  height: 8px;
  fill: currentColor;
}

.chat-screen__back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.chat-screen__back:hover {
  background: rgba(42, 93, 145, 0.07);
}

.chat-screen__back svg {
  width: 16px;
  height: 16px;
}

.chat-messages {
  min-height: 235px;
  max-height: 320px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 22px clamp(17px, 3vw, 28px) 18px;
  scrollbar-color: rgba(42, 93, 145, 0.25) transparent;
  scrollbar-width: thin;
}

.chat-message {
  width: min(100%, 760px);
  display: flex;
  align-items: flex-end;
  gap: 9px;
  animation: assistant-message-in 0.28s ease both;
}

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

.chat-message__avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--blue);
  background: rgba(219, 238, 247, 0.94);
}

.chat-message__avatar svg {
  width: 16px;
  height: 16px;
}

.chat-message__body {
  min-width: 0;
}

.chat-message__name {
  display: block;
  margin: 0 0 5px 3px;
  color: #6c8294;
  font-size: 0.65rem;
  font-weight: 800;
}

.chat-message__bubble {
  padding: 12px 15px;
  border: 1px solid rgba(42, 93, 145, 0.1);
  border-radius: 7px 17px 17px 17px;
  color: #304d65;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 18px rgba(35, 73, 102, 0.06);
  font-size: 0.82rem;
  line-height: 1.58;
  white-space: pre-wrap;
}

.chat-message--user .chat-message__body {
  max-width: min(82%, 650px);
}

.chat-message--user .chat-message__bubble {
  border-color: transparent;
  border-radius: 17px 7px 17px 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #347db5);
  box-shadow: 0 10px 24px rgba(42, 93, 145, 0.17);
}

.chat-message--error .chat-message__bubble {
  color: var(--assistant-error);
  background: #fff7f5;
  border-color: rgba(163, 52, 52, 0.16);
}

.chat-message__typing {
  display: flex;
  gap: 5px;
  padding: 4px 1px;
}

.chat-message__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ca2bb;
  animation: assistant-typing 1.2s ease-in-out infinite;
}

.chat-message__typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.chat-message__typing span:nth-child(3) {
  animation-delay: 0.28s;
}

.chat-interaction {
  margin-top: auto;
  padding: 14px clamp(17px, 3vw, 28px) 17px;
  border-top: 1px solid rgba(42, 93, 145, 0.1);
  background: rgba(247, 251, 253, 0.7);
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 11px;
}

.chat-suggestions:empty {
  display: none;
}

.chat-suggestion {
  min-height: 35px;
  padding: 7px 12px;
  border: 1px solid rgba(42, 93, 145, 0.18);
  border-radius: 999px;
  color: #244e73;
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.chat-suggestion:hover {
  transform: translateY(-1px);
  border-color: rgba(42, 93, 145, 0.42);
  background: #fff;
}

.chat-suggestion.is-selected {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.chat-suggestion:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
}

.chat-suggestion--confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #347db5);
}

.chat-suggestion--confirm svg {
  width: 15px;
  height: 15px;
}

.chat-composer {
  min-height: 51px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 6px 6px 6px 15px;
  border: 1px solid rgba(42, 93, 145, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(31, 70, 100, 0.07);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-composer:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(72, 185, 223, 0.11);
}

.chat-composer textarea {
  width: 100%;
  max-height: 112px;
  padding: 8px 0;
  overflow-y: auto;
  border: 0;
  outline: 0;
  resize: none;
  color: #18324a;
  background: transparent;
  font: inherit;
  font-size: 0.81rem;
  line-height: 1.45;
}

.chat-composer textarea::placeholder {
  color: #8799a8;
}

.chat-composer button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #347db5);
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.chat-composer button:hover {
  transform: translateY(-1px);
}

.chat-composer button:disabled,
.chat-composer textarea:disabled {
  cursor: wait;
  opacity: 0.58;
}

.chat-composer button svg {
  width: 17px;
  height: 17px;
}

.chat-screen__actions {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
}

.chat-screen__actions > span {
  color: #73899a;
  font-size: 0.67rem;
}

.chat-plan-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.75rem;
}

@keyframes assistant-message-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

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

@keyframes assistant-typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.generating-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.generating-screen__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue), var(--cyan));
  box-shadow: 0 17px 40px rgba(42, 93, 145, 0.26);
}

.generating-screen__orb svg {
  width: 31px;
  height: 31px;
}

.generating-screen__orb span {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(72, 185, 223, 0.34);
  border-top-color: var(--gold);
  border-radius: 26px;
  animation: assistant-spin 1.4s linear infinite;
}

.generating-screen > span {
  margin-top: 27px;
}

.generating-screen p {
  max-width: 540px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.9rem;
}

.generating-screen__steps {
  width: min(100%, 410px);
  margin-top: 27px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.generating-screen__steps span {
  padding-top: 9px;
  border-top: 3px solid var(--line);
  color: #8799a8;
  font-size: 0.69rem;
  font-weight: 800;
}

.generating-screen__steps span.is-active {
  border-color: var(--blue);
  color: var(--blue);
}

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

.result-screen {
  overflow-y: auto;
}

.result-screen__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.result-screen__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--assistant-success);
}

.result-screen__eyebrow svg {
  width: 17px;
  height: 17px;
}

.result-screen__header p {
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.icon-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--blue);
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  background: var(--surface-soft);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.project-map {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

.project-map__section {
  padding: 17px 18px;
  border: 1px solid rgba(42, 93, 145, 0.11);
  border-radius: 15px;
  background: rgba(244, 249, 251, 0.78);
}

.project-map__section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 0.82rem;
}

.project-map__section h3 svg {
  width: 17px;
  height: 17px;
}

.project-map__section p {
  margin-top: 7px;
  color: #3f596e;
  font-size: 0.84rem;
  line-height: 1.62;
}

.project-map__section ul,
.project-map__section ol {
  display: grid;
  gap: 6px;
  margin: 9px 0 0 19px;
  color: #3f596e;
  font-size: 0.82rem;
}

.project-map__section--featured {
  border-color: rgba(72, 185, 223, 0.28);
  background: linear-gradient(135deg, rgba(223, 242, 249, 0.8), rgba(255, 255, 255, 0.86));
}

.result-screen__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 22px;
}

.project-contact {
  margin-top: 23px;
  padding: clamp(19px, 3vw, 26px);
  border: 1px solid rgba(42, 93, 145, 0.13);
  border-radius: 18px;
  background: linear-gradient(145deg, #eef7fa, #f8f4eb);
}

.project-contact__heading h3 {
  margin-top: 4px;
  color: #18324a;
  font-size: 1.25rem;
}

.project-contact__heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.81rem;
}

.project-contact__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 17px;
}

.project-contact label {
  display: grid;
  gap: 6px;
}

.project-contact label > span {
  color: #18324a;
  font-size: 0.76rem;
  font-weight: 800;
}

.project-contact input {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid rgba(42, 93, 145, 0.17);
  border-radius: 11px;
  outline: none;
  color: #18324a;
  background: rgba(255, 255, 255, 0.92);
}

.project-contact input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(72, 185, 223, 0.12);
}

.project-contact__wide {
  grid-column: 1 / -1;
}

.project-contact__privacy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.71rem;
}

.project-contact__submit {
  width: 100%;
  margin-top: 14px;
}

.project-contact__status {
  min-height: 1.4em;
  margin-top: 9px;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.project-contact__status.is-success {
  color: var(--assistant-success);
}

.project-contact__status.is-error {
  color: var(--assistant-error);
}

.project-contact__honey {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.assistant-disclaimer {
  margin: 11px 0 0;
  color: rgba(49, 75, 97, 0.7);
  font-size: 0.7rem;
  text-align: center;
}

.assistant-footer {
  margin-top: 0;
}

@media (max-width: 960px) {
  .assistant-main {
    padding-top: 80px;
  }

  .assistant-intro-block::before,
  .assistant-tool-block::before {
    inset: 10px 0;
    border-radius: 22px;
  }

  .assistant-tool-block.section {
    padding-top: 38px !important;
    padding-bottom: 38px !important;
  }

  .welcome-screen > p {
    white-space: normal;
  }

  .assistant-intro-block > p {
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .assistant-intro-block h1 {
    font-size: clamp(1.45rem, 6vw, 1.7rem);
  }

  .assistant-card,
  .welcome-screen,
  .generating-screen,
  .result-screen {
    min-height: 350px;
  }

  .assistant-card {
    border-radius: 17px;
  }

  .welcome-screen,
  .generating-screen,
  .result-screen {
    padding: 24px 17px;
  }

  .chat-screen {
    min-height: 510px;
  }

  .chat-screen__header {
    min-height: 72px;
    padding: 13px 14px;
  }

  .chat-messages {
    min-height: 235px;
    padding-right: 15px;
    padding-left: 15px;
  }

  .chat-interaction {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 520px) {
  .assistant-intro-block > p {
    font-size: 1rem;
  }

  .welcome-screen__trust {
    display: grid;
  }

  .result-screen__actions {
    flex-direction: column-reverse;
  }

  .result-screen__actions .assistant-button {
    width: 100%;
  }

  .chat-screen__back {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .chat-message--assistant {
    width: 100%;
  }

  .chat-message--user .chat-message__body {
    max-width: 90%;
  }

  .chat-screen__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-plan-button {
    width: 100%;
  }

  .project-contact__grid {
    grid-template-columns: 1fr;
  }

  .project-contact__wide {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
