/* «Βοηθός ENERGYS» (ARCHITECTURE.md, section 15) on the site and in the app: a round button floating at the bottom
   right, over the page without moving anything, and a side panel (the whole screen on a phone). The palette of
   docs/DESIGN.md; the font is the page's own. */
.assistant {
  --a-navy: #183961; --a-ink: #0F1B2D; --a-muted: #5B6576; --a-border: #E6E9EF; --a-bg: #F7F8FA; --a-green: #3D7A22;
  --a-bottom: 20px;
  color: var(--a-ink);
}
.assistant[hidden], .assistant-panel[hidden] { display: none; }
.assistant-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.assistant-launcher {
  position: fixed; z-index: 450; right: calc(16px + env(safe-area-inset-right)); bottom: calc(var(--a-bottom) + env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 56px; height: 56px; padding: 0;
  border: 1px solid var(--a-border); border-radius: 50%; background: #fff; cursor: pointer;
  box-shadow: 0 6px 18px rgba(24, 57, 97, .16);
}
/* Smaller on a phone held sideways and on small phones. On the site, site.js lifts it (--a-lift) to the nearest free
   place above whatever button, field or tile is under it, or tucks it away while there is none: it glides there
   (only transform and opacity, so it never jerks), and stays still for whoever turned movement off on the device. */
.assistant-launcher {
  transform: translateY(calc(-1 * var(--a-lift, 0px)));
  transition: transform .32s cubic-bezier(.22, .8, .24, 1), opacity .2s ease, visibility 0s linear 0s;
  will-change: transform;
}
.assistant.is-tucked .assistant-launcher { opacity: 0; visibility: hidden; pointer-events: none; transition: transform .32s cubic-bezier(.22, .8, .24, 1), opacity .2s ease, visibility 0s linear .2s; }
@media (prefers-reduced-motion: reduce) {
  .assistant-launcher, .assistant.is-tucked .assistant-launcher { transition: none; }
}
@media (max-height: 520px) and (orientation: landscape), (max-width: 390px) {
  .assistant { --a-bottom: 12px; }
  .assistant-launcher { width: 44px; height: 44px; right: calc(10px + env(safe-area-inset-right)); }
  .assistant-launcher img { width: 32px; height: 32px; }
}
.assistant-launcher:focus-visible, .assistant button:focus-visible, .assistant a:focus-visible { outline: 3px solid #0B8ACE; outline-offset: 2px; }
/* Never over the cookie banner: the button waits until the visitor has chosen. */
.cookie-banner:not([hidden]) ~ .assistant .assistant-launcher { display: none; }
.assistant.is-open .assistant-launcher { display: none; }

.assistant-panel {
  position: fixed; z-index: 600; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: #fff; border-left: 1px solid var(--a-border);
  box-shadow: -8px 0 24px rgba(15, 27, 45, .08);
  font-size: 15px; line-height: 1.5; text-align: left;
}
.assistant-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--a-border); }
.assistant-head__who { flex: 1; min-width: 0; }
.assistant-head h2 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: 0; color: var(--a-navy); }
.assistant-head p { margin: 0; font-size: 13px; color: var(--a-muted); }
.assistant-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--a-navy); cursor: pointer; }
.assistant-close:hover { background: var(--a-bg); }

.assistant-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--a-bg); }
.assistant-msg { align-self: flex-start; max-width: 92%; margin: 0; padding: 10px 14px; border: 1px solid var(--a-border); border-radius: 4px 14px 14px 14px; background: #fff; white-space: pre-line; overflow-wrap: anywhere; }
.assistant-msg--user { align-self: flex-end; border-color: var(--a-navy); border-radius: 14px 4px 14px 14px; background: var(--a-navy); color: #fff; }
.assistant-msg--wait { color: var(--a-muted); }

.assistant-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.assistant-choice, .assistant-link {
  display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 8px 14px;
  border: 1px solid var(--a-navy); border-radius: 22px; background: #fff; color: var(--a-navy);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.25; text-align: left; text-decoration: none; cursor: pointer;
}
.assistant-choice:hover, .assistant-link:hover { background: #EAF1FB; }
.assistant-choice:disabled { opacity: .5; cursor: default; }

.assistant-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--a-border); border-radius: 12px; background: #fff; }
.assistant-card__provider { font-size: 13px; color: var(--a-muted); }
.assistant-card__logo { align-self: flex-start; width: auto; height: auto; max-width: 96px; max-height: 30px; margin-bottom: 4px; object-fit: contain; }
/* The eye (the plan's page) and the round cart, side by side at the bottom of the card. */
.assistant-card__icons { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; padding-top: 8px; }
.assistant-card__name { font-weight: 700; color: var(--a-navy); overflow-wrap: anywhere; }
.assistant-card__price { font-size: 18px; font-weight: 700; color: var(--a-ink); font-variant-numeric: tabular-nums; }
.assistant-card__meta { font-size: 13px; color: var(--a-muted); font-variant-numeric: tabular-nums; }
.assistant-card__lines { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--a-muted); }
.assistant-card__lines li + li { margin-top: 2px; }
/* «Ένα μπλε + ένα άλλο» side by side where the panel is wide enough, one under the other on a narrow phone. */
.assistant-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.assistant-card--recommended { border-color: var(--a-navy); }
.assistant-card__tag { align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: var(--a-navy); color: #fff; font-size: 12px; font-weight: 600; }
.assistant-card__kind { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--a-muted); }
.assistant-card__pro, .assistant-card__con { font-size: 13px; line-height: 1.4; padding-left: 18px; position: relative; }
.assistant-card__pro::before { content: '+'; position: absolute; left: 4px; font-weight: 700; color: #25663a; }
.assistant-card__con::before { content: '−'; position: absolute; left: 4px; font-weight: 700; color: #8a4a12; }
.assistant-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--a-navy); border-radius: 12px; background: #fff; color: var(--a-navy);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.assistant-button--primary { background: var(--a-navy); color: #fff; }
.assistant-draft { white-space: pre-line; }

/* «Στείλε μου τα αποτελέσματα» (ARCHITECTURE.md, section 17), at the end of the plans on the site. */
.assistant-results { gap: 10px; }
.assistant-results__field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--a-navy); }
.assistant-results__field input, .assistant-results__field select {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--a-border); border-radius: 12px; background: var(--a-bg); color: var(--a-ink);
  font: inherit; font-size: 16px; font-weight: 400;
}
.assistant-results__consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--a-muted); }
.assistant-results__consent input { margin-top: 3px; }
.assistant-results__consent a { color: var(--a-navy); }

.assistant-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 4px; border-top: 1px solid var(--a-border); background: #fff; }
/* The field to write in: a long question goes on to a new line and the field grows upward, up to 5 lines (then it
   scrolls inside), so all of it is seen (assistant.js sets the height). */
.assistant-form textarea {
  display: block; flex: 1; min-width: 0; min-height: 44px; max-height: calc(5 * 22px + 22px); padding: 10px 14px;
  border: 1px solid var(--a-border); border-radius: 12px; background: var(--a-bg); color: var(--a-ink);
  font: inherit; font-size: 16px; line-height: 22px; resize: none; overflow-y: auto; overflow-wrap: anywhere;
}
.assistant-send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--a-navy); color: #fff; cursor: pointer; }
.assistant-note { margin: 0; padding: 4px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; font-size: 12px; color: var(--a-muted); }

/* Phone and tablet: the panel takes what is seen of the page (assistant.js, visualViewport), the field to write in
   always above the keyboard; the conversation starts at its bottom, next to the field, and grows upward. */
@media (max-width: 899px) {
  .assistant-panel { top: var(--a-view-top, 0px); bottom: auto; height: var(--a-view-height, 100dvh); }
  .assistant-log > :first-child { margin-top: auto; }
  .assistant-panel.is-short .assistant-head { padding-top: 6px; padding-bottom: 6px; }
  .assistant-panel.is-short .assistant-head p, .assistant-panel.is-short .assistant-head img, .assistant-panel.is-short .assistant-note { display: none; }
  .assistant-panel.is-short .assistant-form { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

/* On a phone the panel is the whole screen. */
@media (max-width: 600px) {
  .assistant-panel { width: 100%; border-left: 0; box-shadow: none; }
}

/* The app: above the bottom menu on a phone, never over the steps of «Νέα αίτηση» (their own buttons at the bottom),
   and the content ends above the button. */
@media (max-width: 899px) {
  .has-assistant .assistant { --a-bottom: 96px; }
  .has-assistant.is-focus .assistant-launcher { display: none; }
  .has-assistant .content { padding-bottom: 176px; }
}
@media (min-width: 900px) {
  .has-assistant .content { padding-bottom: 104px; }
}

/* The icon «Βοηθός» at the top right of the app (partner and back office). */
.topbar-assistant {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-left: auto; padding: 0 14px 0 10px;
  border: 1px solid #E6E9EF; border-radius: 12px; background: #fff; color: #183961;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.topbar-assistant + .topbar-bell { margin-left: 0; }
.mobile-header__assistant { margin-left: auto; margin-right: 8px; border: 0; background: transparent; cursor: pointer; }
.assistant-competitors { padding: 12px 14px; border-radius: 12px; background: var(--a-bg); color: var(--a-muted); font-size: 14px; }
.assistant-competitors__title { display: block; margin-bottom: 6px; font-weight: 600; }
.assistant-competitors__list { margin: 0; padding: 0; list-style: none; }
.assistant-competitors__list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--a-border); }
.assistant-competitors__list li:first-child { border-top: 0; }
.assistant-competitors__name { min-width: 0; overflow-wrap: anywhere; }
.assistant-competitors__cost { font-variant-numeric: tabular-nums; white-space: nowrap; }
