/* ======================================================================
   AIDA PROTOTYPE: PAGE LAYOUT
   Only how the prototype page is laid out. The components live in
   aida-components.css. Tokens only, as everywhere else.
   Load order: aida-tokens.css, aida-components.css, aida-prototype.css
   ====================================================================== */

/* Anything with the hidden attribute stays hidden, whatever its display rule */
[hidden] {
  display: none !important;
}

.aida-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-white-100);
}

.aida-page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Skip link: hidden until focused */
.aida-skip-link {
  position: absolute;
  left: var(--spacing-4);
  top: -100px;
  z-index: 50;
  padding: var(--spacing-2) var(--spacing-4);
  background-color: var(--color-white-100);
  color: var(--link-primary);
  border-radius: var(--radius-sm);
}

.aida-skip-link:focus {
  top: var(--spacing-4);
  outline: var(--aida-focus-ring) solid var(--focus);
}

/* Landing and chat take turns */
.aida-page[data-state="empty"] #chat,
.aida-page[data-state="chat"] #landing {
  display: none;
}

.aida-input-slot {
  width: 100%;
  max-width: var(--aida-input-max);
}

/* Chat: the conversation column, then the input docked at the bottom */
.aida-chat {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 0 var(--layout-margin-base);
  min-height: 70dvh;
}

.aida-chat .gt-chatbot__messages {
  width: 100%;
  padding-bottom: var(--layout-spacing-3xl);
  flex: 1 1 auto;
}

.aida-chat__dock {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-4) 0 var(--layout-spacing-lg);
  background: linear-gradient(to bottom, transparent, var(--color-white-100) var(--spacing-4));
}

.aida-chat__dock .aida-input-slot {
  max-width: var(--aida-message-max);
}

/* Things that appear while AIDA answers */
.aida-reveal {
  animation: aida-reveal 0.25s ease-out both;
}

@keyframes aida-reveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .aida-reveal { animation: none; }
}

/* Waiting time under the typing line */
.aida-message__elapsed {
  margin-left: var(--spacing-2);
  font-size: var(--size-body-xs);
  color: var(--content-04);
}

/* Strip above the footer saying this is a prototype */
.aida-proto-note {
  margin: 0;
  padding: var(--spacing-2) var(--layout-margin-base);
  background-color: #0b1d84;
  color: var(--content-inverse);
  font-size: var(--size-body-xs);
  line-height: var(--line-height-body);
  text-align: center;
}

.aida-proto-note a {
  color: var(--link-inverse);
}

/* Line above the follow-up chips (Approach B). Small text, content-03 */
.aida-suggestions__intro {
    margin: var(--layout-spacing-md) 0 0 !important;
    font-family: var(--font-display);
    font-size: var(--size-title-h5);
    font-weight: var(--weight-bold);
    line-height: var(--line-height-heading);
    color: var(--content-01);
}

/* Closing suggestions start at the left, under the answer */
.aida-suggestions {
  justify-content: flex-start;
  margin: 0 0 var(--layout-spacing-sm);
}

@media (max-width: 767px) {
  .aida-chat { padding: 0 var(--layout-margin-base); }
}

/* Toasts sit above the docked chat input */
.aida-toast-region {
  bottom: calc(var(--aida-button-height-m) * 3);
}

/* ======================================================================
   PROTOTYPE LAYER
   Tools that only exist in the prototype: proposal markers, the proposal
   panel, the demo states menu. They use their own colour on purpose, a
   magenta that is not in the LUMEN palette, so nobody mistakes them for
   AIDA features.
   ====================================================================== */
:root {
  --proto-accent: #a3127f;      /* prototype-only, not a LUMEN token */
  --proto-accent-light: #fbe8f6;
  --proto-panel-width: 26rem;
}

/* Strip above the footer: note plus tools */
.aida-proto-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2) var(--spacing-4);
}

.aida-proto-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-2) var(--spacing-4);
}

.aida-proto-link {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: var(--link-inverse);
  text-decoration: underline;
  cursor: pointer;
}

.aida-proto-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-1);
  cursor: pointer;
}

.aida-proto-toggle input {
  accent-color: var(--proto-accent-light);
}

/* Demo states menu */
.aida-proto-menu {
  position: relative;
}

.aida-proto-menu>summary {
  list-style: none;
  cursor: pointer;
  text-decoration: underline;
  color: var(--link-inverse);
}

.aida-proto-menu>summary::-webkit-details-marker {
  display: none;
}

.aida-proto-menu>ul {
  position: absolute;
  bottom: calc(100% + var(--spacing-2));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  min-width: 14rem;
  margin: 0;
  padding: var(--spacing-2) 0;
  list-style: none;
  text-align: left;
  background-color: var(--color-white-100);
  border: var(--aida-border-width) solid var(--border-gray-01);
  border-radius: var(--radius-lg);
  box-shadow: var(--aida-shadow-lg);
}

.aida-proto-menu button {
  width: 100%;
  margin: 0;
  padding: var(--spacing-2) var(--spacing-4);
  background: none;
  border: 0;
  font: inherit;
  font-size: var(--size-body-sm);
  text-align: left;
  color: var(--content-01);
  cursor: pointer;
}

.aida-proto-menu button:hover,
.aida-proto-menu button:focus-visible {
  background-color: var(--background-gray-02);
  color: var(--proto-accent);
}

/* Proposal marker: a small dashed "i" next to the part it explains */
.aida-proto-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0 var(--spacing-1);
  padding: 0;
  vertical-align: middle;
  background-color: var(--proto-accent-light);
  border: 1.5px dashed var(--proto-accent);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: var(--size-body-xs);
  font-weight: var(--weight-bold);
  font-style: normal;
  line-height: 1;
  color: var(--proto-accent);
  cursor: pointer;
}

.aida-proto-marker:hover {
  border-style: solid;
}

.aida-proto-marker:focus-visible,
.aida-proto-link:focus-visible,
.aida-proto-menu>summary:focus-visible,
.aida-proto-panel__close:focus-visible,
.aida-proto-panel__list button:focus-visible {
  outline: 2px solid var(--proto-accent);
  outline-offset: 2px;
}

.aida-hide-markers .aida-proto-marker {
  display: none;
}

/* A marker that sits on its own line, aligned to the right */
.aida-proto-marker-row {
  display: flex;
  justify-content: flex-end;
}

/* Proposal panel: off-canvas on the right */
.aida-proto-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: var(--overlay-black-25);
}

.aida-proto-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(var(--proto-panel-width), 100%);
  display: flex;
  flex-direction: column;
  background-color: var(--color-white-100);
  border-left: 3px solid var(--proto-accent);
  box-shadow: var(--aida-shadow-lg);
}

.aida-proto-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-3);
  padding: var(--spacing-5) var(--spacing-5) var(--spacing-3);
  padding-top: calc(var(--spacing-5) + env(safe-area-inset-top, 0px));
}

.aida-proto-panel__eyebrow {
  margin: 0 0 var(--spacing-1);
  font-size: var(--size-body-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--proto-accent);
}

.aida-proto-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--size-title-h3);
  font-weight: var(--weight-bold);
  line-height: var(--line-height-heading);
  text-wrap: balance;
  color: var(--content-01);
}

.aida-proto-panel__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--aida-button-height-m);
  height: var(--aida-button-height-m);
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-full);
  color: var(--content-03);
  cursor: pointer;
}

.aida-proto-panel__close svg {
  width: var(--aida-icon-size-m);
  height: var(--aida-icon-size-m);
}

.aida-proto-panel__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 var(--spacing-5) var(--spacing-6);
  padding-bottom: calc(var(--spacing-6) + env(safe-area-inset-bottom, 0px));
  font-size: var(--size-body-sm);
  line-height: var(--line-height-body);
  color: var(--content-01);
}

.aida-proto-panel__body h3 {
  margin: var(--spacing-5) 0 var(--spacing-1);
  font-family: var(--font-text);
  font-size: var(--size-body-sm);
  font-weight: var(--weight-semibold);
  color: var(--content-03);
}

.aida-proto-panel__body p {
  margin: 0;
}

.aida-proto-panel__note {
  margin-top: var(--spacing-5) !important;
  padding: var(--spacing-2) var(--spacing-3);
  background-color: var(--proto-accent-light);
  border-radius: var(--radius-md);
  color: var(--content-01);
}

.aida-proto-panel__back {
  margin: 0 0 var(--spacing-2);
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: var(--size-body-sm);
  color: var(--proto-accent);
  text-decoration: underline;
  cursor: pointer;
}

.aida-proto-panel__list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-1);
  margin: var(--spacing-3) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.aida-proto-panel__list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  margin: 0;
  padding: var(--spacing-2) var(--spacing-3);
  background-color: var(--background-gray-01);
  border: var(--aida-border-width) solid var(--border-gray-01);
  border-radius: var(--radius-md);
  font: inherit;
  text-align: left;
  color: var(--content-01);
  cursor: pointer;
}

.aida-proto-panel__list button:hover {
  border-color: var(--proto-accent);
}

.aida-proto-panel__list .aida-proto-marker {
  margin: 0;
  pointer-events: none;
}

/* ======================================================================
   DEMO FRAME (prototype-new, shared with partners)
   The prototype strip sits fixed above the header, and a dark border runs
   around the viewport from it, so the page always reads as a demo.
   --proto-note-h is set by the script from the strip's real height.
   ====================================================================== */
:root {
  --proto-frame: 4px;
  --proto-note-h: 0px;
}

body:has(.aida-proto-frame) {
  padding: var(--proto-note-h) var(--proto-frame) var(--proto-frame);
}

.aida-proto-note--top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
}

.aida-proto-frame {
  position: fixed;
  inset: var(--proto-note-h) 0 0 0;
  z-index: 1100;
  border: var(--proto-frame) solid #0b1d84;
  border-top: 0;
  pointer-events: none;
}

/* The demo menu opens downwards from the top strip */
.aida-proto-note--top .aida-proto-menu>ul {
  top: calc(100% + var(--spacing-2));
  bottom: auto;
}

/* The proposals panel and the chat input stay inside the frame */
body:has(.aida-proto-frame) .aida-proto-panel {
  top: var(--proto-note-h);
  right: var(--proto-frame);
  bottom: var(--proto-frame);
}

body:has(.aida-proto-frame) .aida-chat__dock {
  bottom: var(--proto-frame);
}
