/*
 * condonos - the look shared by the app (web/condonos) and the public site (web/site, MODX):
 * colours from assets/condonos.svg (teal mark, navy wordmark), type, buttons, the top bar, page width
 * and cards. The app imports it (src/styles.css); the site serves it as /assets/condonos/condonos.css.
 * Sizes are in rem, so the root font size below scales the whole UI.
 */
:root {
  /* the whole UI is sized in rem: 90% of the browser's 16px - like Chrome at 90% */
  font-size: 90%;
  --teal: #06b6aa;
  --teal-dark: #00817e;
  --teal-light: #e6f8f6;
  --navy: #001638;
  --text: #1c2733;
  --muted: #64707d;
  --line: #e2e7ec;
  --bg: #f5f7f9;
  --card: #ffffff;
  --danger: #c0392b;
  --warn: #b7791f;
  --radius: 10px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 0.25rem; color: var(--navy); }
h2 { font-size: 1.15rem; margin: 1.25rem 0 0.75rem; color: var(--navy); }
h3 { margin: 0 0 0.25rem; color: var(--navy); }
code { background: var(--teal-light); padding: 0 4px; border-radius: 4px; }

button {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card);
  color: var(--text); padding: 0.45rem 0.9rem; border-radius: 8px;
}
button:hover:not(:disabled) { border-color: var(--teal); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
button.primary:hover:not(:disabled) { background: var(--teal-dark); }
button.danger { color: var(--danger); }
button.link { border: 0; background: none; padding: 0 0.25rem; color: var(--teal-dark); }
button.link.danger { color: var(--danger); }

input, select, textarea {
  font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-light); border-color: var(--teal); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.pre { white-space: pre-wrap; }
.warn { color: var(--warn); }

.topbar {
  display: flex; align-items: center; gap: 2rem; padding: 0.6rem 1.5rem;
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.2rem; color: var(--navy); }
.brand img { height: 1.9rem; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 1.25rem; flex: 1; }
.topbar nav a { color: var(--muted); padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.topbar nav a.active { color: var(--navy); border-bottom-color: var(--teal); }
.topbar nav a:hover { text-decoration: none; color: var(--navy); }
.user { display: flex; align-items: center; gap: 0.6rem; border: 0; background: none; padding: 0.2rem 0.3rem 0.2rem 0.6rem; border-radius: 999px; }
.user:hover:not(:disabled) { background: var(--teal-light); }
.avatar.initials { display: inline-grid; place-items: center; background: var(--teal); color: #fff; font-weight: 600; font-size: 0.8rem; }
.avatar { width: 1.75rem; height: 1.75rem; border-radius: 50%; flex: none; }
.avatar.large { width: 4rem; height: 4rem; font-size: 1.4rem; }

.content { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.card-head h2 { margin: 0; }
.card.empty { color: var(--muted); text-align: center; padding: 2rem; }
a.button { display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: inherit; background: var(--card); }
a.button:hover { border-color: var(--teal); color: var(--teal); }

/* language switcher in the top bar - БГ · EN · DE (a <nav> too: it opts out of the menu's stretch and underline) */
.topbar nav.languages { flex: none; display: flex; gap: 0.15rem; padding: 0.15rem; border: 1px solid var(--line); border-radius: 999px; }
.topbar nav.languages a { padding: 0.15rem 0.55rem; border: 0; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.topbar nav.languages a:hover { text-decoration: none; color: var(--navy); }
.topbar nav.languages a.active { background: var(--teal-light); color: var(--teal-dark); }

/* links that look like the app's controls - the site's header uses them */
a.button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
a.button.primary:hover { background: var(--teal-dark); color: #fff; }
a.user { color: inherit; }
a.user:hover { text-decoration: none; }

/* feature cards - picture, title, text; the site's blocks (MODX chunk condonosCard), usable in the app too.
   With a link in the title the whole card is clickable. */
.feature-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.feature-card {
  position: relative; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 0.5rem;
  box-shadow: 0 1px 2px rgba(0, 22, 56, 0.04), 0 6px 20px rgba(0, 22, 56, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:has(h3 a):hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0, 22, 56, 0.05), 0 12px 32px rgba(0, 22, 56, 0.1); }
.feature-card-media { border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #eef3f7, var(--teal-light)); }
.feature-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.feature-card-body { padding: 1.25rem 1rem 1.1rem; }
.feature-card h3 { margin: 0 0 0.6rem; font-size: 1.2rem; line-height: 1.35; }
.feature-card h3 a { color: inherit; }
.feature-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }
.feature-card h3 a:focus-visible { outline: none; }
.feature-card:has(h3 a:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.feature-card p { margin: 0; line-height: 1.55; }

/* numbered steps - "how it works"; an <ol class="steps"> of <li><h3>…</h3><p>…</p></li> */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin: 1.5rem 0; padding: 0; }
.steps > li {
  counter-increment: step; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.25rem 1.25rem 1.25rem 4.25rem; box-shadow: 0 1px 2px rgba(0, 22, 56, 0.04), 0 6px 20px rgba(0, 22, 56, 0.06);
}
.steps > li::before {
  content: counter(step); position: absolute; left: 1.25rem; top: 1.2rem; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #17d4b5, var(--teal-dark));
}
.steps h3 { margin: 0.25rem 0 0.4rem; font-size: 1.1rem; }
.steps p { margin: 0; line-height: 1.55; }

/* a landing page's opening: title and lead */
.hero { max-width: 760px; padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: 2.1rem; line-height: 1.2; margin-bottom: 0.6rem; }
.hero .lead { margin: 0; font-size: 1.15rem; color: var(--muted); }

@media (max-width: 760px) {
  .topbar { gap: 1rem; padding: 0.6rem 1rem; flex-wrap: wrap; }
}

/* -------------------------------------------------------------------------------------------------
   The features accordion (web/site: section.feature-accordion, snippet condonosFeature; accordion.js):
   a band the width of the page - the list and its controls on the left, the open item's picture on the
   right; on a phone the picture is in the item. Without the script: every item open, one under another.
   ------------------------------------------------------------------------------------------------- */
.feature-accordion { margin: 2.5rem 0; }
.feature-accordion h2 { font-size: 1.7rem; margin: 0 0 1.25rem; }
/* the band: its background reaches both edges of the window (a wide shadow, clipped above and below) */
.feature-accordion.is-ready {
  margin: 3rem 0; padding: 3rem 0 3.25rem; position: relative;
  background: #e9f4f5; box-shadow: 0 0 0 100vmax #e9f4f5; clip-path: inset(0 -100vmax);
}
.fa-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 3.5rem; align-items: center; }
.fa-inner > h2 { grid-column: 1 / -1; }
.fa-item { position: relative; border-top: 1px solid var(--line); }
.fa-list .fa-item:last-child { border-bottom: 1px solid var(--line); }
.fa-title { margin: 0; font-size: 1.15rem; }
.fa-head {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 0.25rem;
  border: 0; border-radius: 0; background: none; color: var(--navy); font-weight: 600; font-size: inherit; text-align: left;
}
.fa-head:hover { color: var(--teal-dark); }
.fa-head:focus-visible, .fa-nav:focus-visible, .fa-dot:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.fa-icon { position: relative; flex: none; width: 14px; height: 14px; }
.fa-icon::before, .fa-icon::after { content: ''; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 1px; background: currentColor; transition: transform 0.25s; }
.fa-icon::after { transform: rotate(90deg); }
.fa-item.is-open .fa-icon::after { transform: rotate(0deg); }
.fa-panel-inner { padding: 0 0.25rem 1.25rem; color: var(--muted); }
.fa-panel-inner p { margin: 0 0 0.75rem; font-size: 1.02rem; line-height: 1.55; }
.fa-link { font-weight: 600; }
.fa-media { margin: 0 0 1.25rem; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #eef3f7, var(--teal-light)); }
.fa-media img, .fa-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fa-progress { display: none; }

/* with the script: one open - its panel grows (grid rows 0fr → 1fr), the others are titles */
.feature-accordion.is-ready .fa-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.feature-accordion.is-ready .fa-panel-inner { overflow: hidden; padding-bottom: 0; transition: padding 0.35s ease; }
.feature-accordion.is-ready .fa-item.is-open .fa-panel { grid-template-rows: 1fr; }
.feature-accordion.is-ready .fa-item.is-open .fa-panel-inner { padding-bottom: 1.25rem; }
.feature-accordion.is-ready .fa-media { display: none; }

/* the open item's line: teal; while the items take turns it fills with the time left */
.feature-accordion.is-ready .fa-item.is-open::before { content: ''; position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--teal); }
.feature-accordion.is-auto .fa-item.is-open::before { display: none; }
.feature-accordion.is-auto .fa-item.is-open .fa-progress {
  display: block; position: absolute; left: 0; top: -1px; height: 2px; width: 100%; background: var(--teal);
  transform-origin: left; animation: fa-progress var(--fa-duration, 7s) linear forwards;
}
@keyframes fa-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* the controls: previous, a dot per item (the current one long, filling with the time), next, pause / play */
.fa-controls { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.5rem; }
.fa-nav {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--navy); box-shadow: 0 1px 2px rgba(0, 22, 56, 0.06);
}
.fa-nav:hover { border-color: var(--teal); color: var(--teal-dark); }
.fa-nav::before { content: ''; width: 0.5rem; height: 0.5rem; border: solid currentColor; border-width: 0 2px 2px 0; }
.fa-prev::before { transform: translateX(2px) rotate(135deg); }
.fa-next::before { transform: translateX(-2px) rotate(-45deg); }
.fa-toggle { margin-left: 0.4rem; }
.fa-toggle::before { width: 0; height: 0; border-width: 0.4rem 0 0.4rem 0.65rem; border-color: transparent transparent transparent currentColor; transform: translateX(1px); }
.fa-toggle.is-playing::before { width: 0.6rem; height: 0.7rem; border: solid currentColor; border-width: 0 3px; transform: none; }
.fa-dots { display: flex; align-items: center; gap: 0.4rem; }
.fa-dot { position: relative; width: 0.6rem; height: 0.6rem; padding: 0; border: 0; border-radius: 999px; background: #c5d0da; overflow: hidden; transition: width 0.3s ease, background 0.3s; }
.fa-dot:hover { background: #9fb0bf; }
.fa-dot.is-current { width: 2.2rem; background: #c5d0da; }
.fa-dot-bar { position: absolute; inset: 0; border-radius: inherit; background: var(--teal); transform: scaleX(0); transform-origin: left; }
.fa-dot.is-current .fa-dot-bar { transform: none; }
.feature-accordion.is-auto .fa-dot.is-current .fa-dot-bar { transform: scaleX(0); animation: fa-progress var(--fa-duration, 7s) linear forwards; }
.feature-accordion.is-auto.is-paused .fa-progress, .feature-accordion.is-auto.is-paused .fa-dot-bar { animation-play-state: paused; }

/* the pictures, one at a time, fading */
.fa-stage { position: sticky; top: 1.5rem; display: grid; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #eef3f7, var(--teal-light)); box-shadow: 0 2px 4px rgba(0, 22, 56, 0.05), 0 18px 40px rgba(0, 22, 56, 0.12); }
.fa-frame { grid-area: 1 / 1; opacity: 0; transform: scale(1.02); transition: opacity 0.45s ease, transform 0.6s ease; }
.fa-frame.is-shown { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .fa-inner { grid-template-columns: 1fr; }
  .fa-stage { display: none; }
  .feature-accordion.is-ready .fa-item.is-open .fa-media { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-accordion.is-ready .fa-panel, .feature-accordion.is-ready .fa-panel-inner, .fa-frame, .fa-icon::before, .fa-icon::after, .fa-dot { transition: none; }
}

/* -------------------------------------------------------------------------------------------------
   The carousel (web/site: section.hero-carousel, snippet condonosSlide; carousel.js): one slide at a time - its
   picture behind the band from the left edge of the window to the right (--hc-page: the window's width without
   the scroll bar, set by the script), its text in the page's column; arrows on both sides of the window, the dots
   and pause / play under it. Without the script: the slides one under another.
   ------------------------------------------------------------------------------------------------- */
.hero-carousel { margin: 0 0 2.5rem; }
.hc-slide { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 2.5rem; align-items: center; padding: 1.5rem 0; }
.hc-text h2 { margin: 0 0 0.9rem; font-size: 2.6rem; line-height: 1.12; letter-spacing: -0.01em; color: var(--navy); }
.hc-text p { margin: 0 0 1.5rem; font-size: 1.15rem; line-height: 1.55; color: var(--text); max-width: 34rem; }
.hc-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hc-actions .button { padding: 0.7rem 1.3rem; border-radius: 10px; font-weight: 600; font-size: 1rem; }
.hc-actions .button:not(.primary) { background: rgba(255, 255, 255, 0.9); border: 1.5px solid var(--navy); color: var(--navy); }
.hc-actions .button:not(.primary):hover { background: #fff; text-decoration: none; }
.hc-media img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 2px 4px rgba(0, 22, 56, 0.05), 0 22px 48px rgba(0, 22, 56, 0.16); }

/* the page's hero gives way to a carousel right after it - the slides have their own titles - and the carousel
   starts right under the top bar */
.hero:has(+ .hero-carousel) { display: none; }
.content > .hero-carousel:first-child, .hero:has(+ .hero-carousel) + .hero-carousel { margin-top: -1.5rem; }

.hero-carousel.is-ready { position: relative; isolation: isolate; padding: 4rem 0 4.5rem; min-height: 30rem; display: flex; flex-direction: column; justify-content: center; }
.hc-backdrop { position: absolute; z-index: -1; top: 0; bottom: 0; left: 50%; width: var(--hc-page, 100vw); transform: translateX(-50%); overflow: hidden; background: #e9f4f5; }
.hc-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 0.7s ease; }
.hc-bg.is-plain { background: linear-gradient(120deg, #e8f2f7 0%, #f5f8fb 50%, #dcf4ef 100%); }
.hc-bg.is-current { opacity: 1; }
/* a light veil on the left keeps the text readable over any picture */
.hc-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(245, 249, 251, 0.9) 0%, rgba(245, 249, 251, 0.72) 35%, rgba(245, 249, 251, 0) 62%);
}

/* the slides share one place - the band is as tall as the tallest, nothing jumps */
.hc-track { display: grid; padding: 0 3.5rem; }
.hero-carousel.is-ready .hc-slide { grid-area: 1 / 1; padding: 0; opacity: 0; visibility: hidden; transform: translateX(1.5rem); transition: opacity 0.5s ease, transform 0.6s ease, visibility 0s 0.6s; }
.hero-carousel.is-ready .hc-slide.is-current { opacity: 1; visibility: visible; transform: none; transition: opacity 0.5s ease 0.1s, transform 0.6s ease 0.1s, visibility 0s; }

/* the arrows, at both edges of the window */
.hc-arrow {
  position: absolute; z-index: 2; top: 50%; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-top: -1.6rem; padding: 0;
  border: 1px solid rgba(0, 22, 56, 0.08); border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--navy);
  box-shadow: 0 4px 16px rgba(0, 22, 56, 0.14); backdrop-filter: blur(4px);
}
.hc-arrow:hover { color: var(--teal-dark); border-color: var(--teal); }
.hc-arrow::before { content: ''; width: 0.75rem; height: 0.75rem; border: solid currentColor; border-width: 0 2.5px 2.5px 0; }
.hc-prev { left: calc(50% - var(--hc-page, 100vw) / 2 + 1.25rem); }
.hc-next { right: calc(50% - var(--hc-page, 100vw) / 2 + 1.25rem); }
.hc-prev::before { transform: translateX(3px) rotate(135deg); }
.hc-next::before { transform: translateX(-3px) rotate(-45deg); }

/* the dots (the current one long, filling with the time) and pause / play, centred under the slides */
.hc-controls { position: absolute; left: 0; right: 0; bottom: 1.25rem; display: flex; justify-content: center; align-items: center; gap: 0.75rem; }
.hc-dots { display: flex; align-items: center; gap: 0.45rem; }
.hc-dot { position: relative; width: 0.65rem; height: 0.65rem; padding: 0; border: 0; border-radius: 999px; background: rgba(0, 22, 56, 0.22); overflow: hidden; transition: width 0.3s ease; }
.hc-dot:hover { background: rgba(0, 22, 56, 0.38); }
.hc-dot.is-current { width: 2.4rem; }
.hc-dot-bar { position: absolute; inset: 0; border-radius: inherit; background: var(--teal-dark); transform: scaleX(0); transform-origin: left; }
.hc-dot.is-current .hc-dot-bar { transform: none; }
.hero-carousel.is-auto .hc-dot.is-current .hc-dot-bar { transform: scaleX(0); animation: hc-time var(--hc-duration, 8s) linear forwards; }
.hero-carousel.is-auto.is-paused .hc-dot-bar { animation-play-state: paused; }
@keyframes hc-time { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hc-toggle { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 1px solid rgba(0, 22, 56, 0.12); border-radius: 50%; background: rgba(255, 255, 255, 0.9); color: var(--navy); }
.hc-toggle::before { content: ''; width: 0; height: 0; border: solid transparent; border-width: 0.35rem 0 0.35rem 0.55rem; border-left-color: currentColor; transform: translateX(1px); }
.hc-toggle.is-playing::before { width: 0.5rem; height: 0.6rem; border: solid currentColor; border-width: 0 2.5px; transform: none; }
.hc-arrow:focus-visible, .hc-dot:focus-visible, .hc-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* the window just wider than the page's column: the arrows at the band's edge, the slides make room */
@media (max-width: 1320px) {
  .hc-prev { left: 0; }
  .hc-next { right: 0; }
}

@media (max-width: 860px) {
  .hc-slide { grid-template-columns: 1fr; gap: 1.5rem; }
  .hc-text h2 { font-size: 1.9rem; }
  .hc-track { padding: 0; }
  .hero-carousel.is-ready { padding: 2rem 0 4.5rem; min-height: 0; }
  .hc-backdrop::after { background: rgba(245, 249, 251, 0.82); }
  .hc-arrow { top: auto; bottom: 0.7rem; margin: 0; width: 2.6rem; height: 2.6rem; }
  .hc-prev { left: 0; }
  .hc-next { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hc-bg, .hero-carousel.is-ready .hc-slide, .hero-carousel.is-ready .hc-slide.is-current, .hc-dot { transition: none; }
  .hero-carousel.is-ready .hc-slide { transform: none; }
}
