/*
 * Lacolline Engineering's online tools (layouts/app-frame): the site's
 * colours, fonts and themes in an app's shape. A slim bar, a tinted canvas
 * with the work on it, and a one-line footer. Loaded after main.css and
 * cms.css, so the site's colour variables (and dark theme) apply.
 */
:root {
  --app-canvas: #eef2f8;
  --app-bar-height: 60px;
}
:root[data-theme="dark"] {
  --app-canvas: #0a1018;
}

body.app-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--app-canvas);
}

/* The bar: logo, the tool's name, a few actions and the way out. */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--app-bar-height);
  padding: 0 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  background: var(--background-color);
  border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
}
.app-bar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  color: var(--heading-color);
  text-decoration: none;
}
.app-bar__brand:hover {
  color: var(--heading-color);
}
.app-bar__logo {
  display: block;
  height: 32px;
  width: auto;
}
.app-bar__logo--dark,
:root[data-theme="dark"] .app-bar__logo--light {
  display: none;
}
:root[data-theme="dark"] .app-bar__logo--dark {
  display: block;
}
.app-bar__name {
  padding-left: 14px;
  border-left: 1px solid color-mix(in srgb, var(--default-color), transparent 82%);
  font-family: var(--heading-font);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-bar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.app-bar__icon,
.app-bar .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--heading-color);
  font-size: 1.05rem;
}
.app-bar__btn,
.app-bar__exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
  border-radius: 8px;
  background: transparent;
  color: var(--heading-color);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.app-bar__exit {
  border-color: transparent;
}
.app-bar__icon[hidden] { display: none; }

/* Share menu (Solar Estimator). */
.share-menu { position: relative; }
.share-menu__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 86%);
  border-radius: 10px;
  background: var(--background-color);
  box-shadow: 0 14px 34px rgba(8, 15, 25, 0.18);
}
.share-menu__list[hidden] { display: none; }
.share-menu__title {
  margin: 4px 10px 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}
.share-menu__item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--heading-color);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.share-menu__item[hidden] { display: none; }
.share-menu__item i { width: 18px; font-size: 1.05rem; text-align: center; color: var(--accent-color); }
.share-menu__item .bi-whatsapp { color: #25d366; }
.share-menu__item .bi-facebook { color: #1877f2; }
.share-menu__item .bi-linkedin { color: #0a66c2; }
.share-menu__item .bi-twitter-x { color: var(--heading-color); }
.share-menu__item:hover,
.share-menu__item:focus-visible { background: color-mix(in srgb, var(--accent-color), transparent 91%); color: var(--heading-color); outline: none; }
@media (max-width: 575.98px) {
  .share-menu__list { position: fixed; top: calc(var(--app-bar-height, 60px) + 6px); right: 10px; left: auto; }
}

/* "Chat with us here": a short hint under the chat button in the bar. */
.chat-hint {
  position: fixed;
  z-index: 70;
  max-width: 220px;
  padding: 9px 13px;
  border-radius: 9px;
  background: #0f1f33;
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.35;
  box-shadow: 0 10px 26px rgba(8, 15, 25, 0.25);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.chat-hint::before {
  content: "";
  position: absolute;
  top: -6px;
  right: var(--arrow-right, 16px);
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}
.chat-hint.is-shown { opacity: 1; transform: none; }
:root[data-theme="dark"] .chat-hint { background: var(--accent-color); }
@media (prefers-reduced-motion: reduce) { .chat-hint { transition: none; } }
.app-bar__icon:hover,
.app-bar .theme-toggle:hover,
.app-bar__btn:hover,
.app-bar__exit:hover {
  background: color-mix(in srgb, var(--default-color), transparent 93%);
  color: var(--heading-color);
}
.app-bar a:focus-visible,
.app-bar button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* The work area and the footer line. */
.app-main {
  flex: 1;
  width: 100%;
}
.app-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}
.app-foot a,
.app-foot__link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.app-foot a:hover,
.app-foot__link:hover {
  color: var(--accent-color);
}

/* A plain card on the canvas, for the smaller tools. */
.app-card {
  background: var(--background-color);
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 31, 51, 0.04), 0 8px 24px rgba(15, 31, 51, 0.05);
}
.app-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 32px;
}
.app-page__head {
  margin-bottom: 20px;
}
.app-page__head h1 {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 700;
}
.app-page__head p {
  margin: 0;
  max-width: 62ch;
  color: color-mix(in srgb, var(--default-color), transparent 20%);
}

@media (max-width: 575.98px) {
  .app-bar {
    gap: 8px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  .app-bar__logo {
    height: 26px;
  }
  .app-bar__name {
    padding-left: 10px;
    font-size: 0.95rem;
  }
  .app-bar__brand {
    gap: 10px;
  }
  /* Icon only on phones; the words stay for screen readers. */
  .app-bar__exit span,
  .app-bar__btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .app-bar__exit,
  .app-bar__btn {
    width: 40px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
  }
  .app-page {
    padding: 18px 14px 24px;
  }
}
@media (max-width: 380px) {
  /* Very narrow phones: the logo's mark and words are enough; the name stays. */
  .app-bar__logo {
    height: 22px;
  }
}

/* ---------- The Solar Estimator ---------- */

.estimator__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
/* From the summary on, the estimate is in the form, and the live panel steps aside. */
.estimator__grid.is-finished {
  grid-template-columns: minmax(0, 1fr);
}
.estimator__grid.is-finished .estimator__work {
  max-width: 820px;
}
.estimator__live[hidden] { display: none; }
/* The questions fill the height there is, so it works like a screen. */
.estimator .planner--inline {
  max-width: none;
  height: clamp(520px, calc(100dvh - var(--app-bar-height) - 210px), 760px);
}
.estimator .planner--inline .planner__panel {
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 31, 51, 0.04), 0 8px 24px rgba(15, 31, 51, 0.05);
}
.estimator .planner--inline .planner__progress {
  padding-top: 20px;
}

.estimator__live {
  position: sticky;
  top: calc(var(--app-bar-height) + 24px);
  padding: 22px 22px 20px;
}
.estimator__live-bar {
  display: none;
}
.estimator__live-title {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}
.estimator__steps {
  counter-reset: step;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.estimator__steps li {
  position: relative;
  padding: 0 0 12px 36px;
  counter-increment: step;
}
.estimator__steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-color);
  color: var(--contrast-color);
  font-size: 0.8rem;
  font-weight: 700;
}
.estimator__steps strong {
  display: block;
  color: var(--heading-color);
}
.estimator__steps span,
.estimator__good span {
  font-size: 0.88rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--default-color), transparent 20%);
}
.estimator__good {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.estimator__good li {
  display: flex;
  gap: 8px;
}
.estimator__good i {
  flex: none;
  color: var(--accent-color);
}
.estimator__live-empty {
  margin: 0;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
}
.estimator__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.estimator__facts div {
  display: inline-flex;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--default-color), transparent 94%);
  font-size: 0.8rem;
}
.estimator__facts dt {
  font-weight: 400;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.estimator__facts dd {
  margin: 0;
  font-weight: 600;
  color: var(--heading-color);
}
.estimator__figures {
  margin: 0 0 12px;
}
.estimator__figures div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
}
.estimator__figures div:last-child {
  border-bottom: 0;
}
.estimator__figures dt {
  font-weight: 400;
  color: color-mix(in srgb, var(--default-color), transparent 20%);
}
.estimator__figures dd {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading-color);
  text-align: right;
}
/* The three that make the system stand out; daily use stays quieter. */
.estimator__figures div:nth-child(-n + 3) dd {
  color: var(--accent-color);
}
.estimator__note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-color), transparent 92%);
  font-size: 0.86rem;
  line-height: 1.5;
}
.estimator__fine {
  margin: 0 0 14px;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--default-color), transparent 35%);
}
.estimator__off {
  max-width: 640px;
  padding: 24px;
}

/* Tablets and phones: one column; the system becomes a bar at the bottom
   that opens up when tapped. */
@media (max-width: 991.98px) {
  .estimator__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .estimator .planner--inline {
    height: clamp(460px, calc(100dvh - var(--app-bar-height) - 200px), 720px);
  }
  .estimator-page .app-main {
    padding-bottom: 72px;
  }
  .estimator-page .app-main:has(.estimator__grid.is-finished) {
    padding-bottom: 0;
  }
  .estimator__live {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0;
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
    box-shadow: 0 -6px 24px rgba(15, 31, 51, 0.12);
  }
  .estimator__live-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border: 0;
    background: transparent;
    color: var(--heading-color);
    font-weight: 600;
    text-align: left;
  }
  .estimator__live.has-result .estimator__live-bar span {
    color: var(--accent-color);
  }
  .estimator__live-bar i {
    transition: transform 0.2s ease;
  }
  .estimator__live.is-open .estimator__live-bar i {
    transform: rotate(180deg);
  }
  .estimator__live-body {
    display: none;
    max-height: 60dvh;
    overflow-y: auto;
    padding: 0 20px 20px;
  }
  .estimator__live.is-open .estimator__live-body {
    display: block;
  }
  /* The bar already says what's open. */
  .estimator__live-body > div > h2.estimator__live-title {
    display: none;
  }
}
@media (max-width: 575.98px) {
  .estimator .app-page__head p {
    font-size: 0.92rem;
  }
}

/* The floating cookie button would sit on the tool; the footer has the link. */
body.app-frame .lc-cookie-fab {
  display: none !important;
}

/* Phones: the steps take the space between the bar and the system bar. */
@media (max-width: 575.98px) {
  .estimator .app-page__head {
    margin-bottom: 14px;
  }
  .estimator .app-page__head h1 {
    font-size: 1.3rem;
  }
  .estimator .app-page__head p {
    display: none;
  }
  .estimator .planner--inline {
    height: max(420px, calc(100dvh - var(--app-bar-height) - 72px - 92px));
  }
}

/* ---------- Client Previews ---------- */

.app-page--top {
  padding-bottom: 0;
}
/* The portal's screens sit on the canvas, the width of the app. */
.portal-app .section {
  padding: 0 0 36px;
  background: transparent;
}
.portal-app .section .container {
  max-width: 1180px;
  padding-left: 20px;
  padding-right: 20px;
}
.portal-app .contact-form-container,
.portal-app .portal-signed-in,
.portal-app .portal-empty {
  background: var(--background-color);
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 31, 51, 0.04), 0 8px 24px rgba(15, 31, 51, 0.05);
}
.portal-app .contact-form-container {
  padding: 28px;
}
.portal-app .contact-form-container::before,
.portal-app .contact-form-container h3::before {
  display: none;
}
.portal-card-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
}
.portal-card-title + p {
  margin-bottom: 16px;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
}
.portal-app .portal-guide {
  padding: 4px 0 0;
}
.portal-app .portal-guide h2 {
  font-size: 1.05rem;
}
.portal-app .portal-signed-in {
  padding: 14px 18px;
  margin-bottom: 20px;
}
.portal-app .portal-site-card {
  border-radius: 12px;
  background: var(--background-color);
}
@media (max-width: 575.98px) {
  .portal-app .section .container {
    padding-left: 14px;
    padding-right: 14px;
  }
  .portal-app .contact-form-container {
    padding: 20px 18px;
  }
}

/* ---------- Document Check ---------- */

.check__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}
.check__guide {
  padding-top: 4px;
}
.check__guide h2,
.check__guide h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}
.check__guide h3 {
  margin-top: 8px;
}
@media (max-width: 991.98px) {
  .check__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}
.check__result {
  margin-bottom: 20px;
  padding: 24px;
  border-left-width: 4px;
}
.check__result--ok {
  border-left-color: #1e8e4e;
}
.check__result--unknown {
  border-left-color: #c2410c;
}
.check__status {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.check__status i {
  flex: none;
  font-size: 2rem;
  line-height: 1;
}
.check__result--ok .check__status i {
  color: #1e8e4e;
}
.check__result--unknown .check__status i {
  color: #c2410c;
}
.check__status h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
}
.check__status p {
  margin: 0;
  color: color-mix(in srgb, var(--default-color), transparent 20%);
}
.check__meta,
.check__figures,
.check__answers {
  margin: 0 0 16px;
}
.check__meta div,
.check__figures div,
.check__answers div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
}
.check dt {
  font-weight: 400;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
.check dd {
  margin: 0;
  color: var(--heading-color);
}
.check__meta dd {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.check__figures {
  padding: 4px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-color), transparent 92%);
}
.check__figures div:last-child {
  border-bottom: 0;
}
.check__figures dd {
  font-weight: 700;
}
.check__sub {
  margin: 20px 0 4px;
  font-size: 1rem;
  font-weight: 700;
}
.check__hint {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
}
.check__warn {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, #c2410c, transparent 92%);
  font-size: 0.92rem;
}
.check__warn i {
  color: #c2410c;
}
.check__steps {
  margin: 0 0 16px;
  padding-left: 1.2rem;
}
.check__steps li {
  margin-bottom: 6px;
}
.check__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  font-weight: 600;
}
.check__contact a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.check__form {
  padding: 20px 24px;
}
.check__form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--heading-color);
}
.check__row {
  display: flex;
  gap: 10px;
}
.check__row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.check__row button {
  flex: none;
  padding: 0 22px;
  border: 0;
  border-radius: 6px;
  background: var(--accent-color);
  color: var(--contrast-color);
  font-weight: 600;
}
.check__row button:hover {
  background: color-mix(in srgb, var(--accent-color), black 10%);
}
.check__where {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}
@media (max-width: 575.98px) {
  .check__result {
    padding: 18px 16px;
  }
  .check__meta div,
  .check__figures div,
  .check__answers div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .check__form {
    padding: 16px;
  }
}
:root[data-theme="dark"] .check__result--ok .check__status i { color: #4ade80; }
:root[data-theme="dark"] .check__result--unknown .check__status i,
:root[data-theme="dark"] .check__warn i { color: #fb923c; }
