/*
  APPVOLUTION DEMO KIT — technical chrome only.
  ---------------------------------------------------------------------------
  This file deliberately contains NO website design. It only styles the
  Appvolution frame around a concept demo: the demo bar, the explore overlay,
  the shared modal and the toast. Every demo keeps its own visual identity in
  its own stylesheet.

  All selectors are prefixed `appv-` and every property is stated explicitly so
  that neither the demo nor the main Appvolution site can leak styles in or out.
*/
:root {
  --appv-bar-h: 46px;
  --appv-ink: #f2f6fb;
  --appv-bg: #0a1524;
  --appv-line: rgba(178, 207, 237, .18);
  --appv-accent: #51def4;
  --appv-brand: linear-gradient(118deg, #ff4c68 0%, #50a8f8 55%, #51def4 100%);
  --appv-font: Inter, ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (max-width: 720px) { :root { --appv-bar-h: 42px; } }

html.appv-demo { scroll-padding-top: calc(var(--appv-bar-h) + 16px); }
body.appv-demo-body { margin-top: var(--appv-bar-h); }

/* ---------------------------------------------------------------- demo bar */
.appv-bar {
  position: fixed; inset: 0 0 auto; z-index: 2147483000;
  display: flex; align-items: center; gap: 14px;
  box-sizing: border-box; height: var(--appv-bar-h); padding: 0 clamp(10px, 2vw, 20px);
  font-family: var(--appv-font); font-size: 13px; line-height: 1.2; color: var(--appv-ink);
  background: rgba(6, 15, 27, .93); border-bottom: 1px solid var(--appv-line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .28);
}
.appv-bar * { box-sizing: border-box; }
.appv-bar__mark {
  display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto;
  color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -.01em; white-space: nowrap;
}
.appv-bar__mark img { display: block; width: 104px; height: auto; }
.appv-bar__tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  border: 1px solid var(--appv-line); border-radius: 999px;
  font-size: 11px; font-weight: 650; color: #cddced; white-space: nowrap;
}
.appv-bar__tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--appv-accent); box-shadow: 0 0 10px var(--appv-accent);
}
.appv-bar__spacer { flex: 1 1 auto; min-width: 0; }
.appv-bar__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.appv-bar__switch {
  display: inline-flex; align-items: center; padding: 3px; gap: 2px;
  border: 1px solid var(--appv-line); border-radius: 999px; background: rgba(255, 255, 255, .05);
}
.appv-bar__switch button {
  appearance: none; border: 0; margin: 0; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 650; color: #a9bed6; background: transparent;
  transition: color .18s ease, background .18s ease;
}
.appv-bar__switch button[aria-pressed="true"] { color: #04101b; background: var(--appv-accent); }
.appv-bar__switch button:focus-visible { outline: 2px solid var(--appv-accent); outline-offset: 2px; }

.appv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 13px; border: 1px solid var(--appv-line); border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 680; color: #e8f1fb; background: rgba(255, 255, 255, .06);
  text-decoration: none; white-space: nowrap; transition: background .18s ease, border-color .18s ease;
}
.appv-btn:hover { background: rgba(81, 222, 244, .12); border-color: rgba(81, 222, 244, .4); }
.appv-btn:focus-visible { outline: 2px solid var(--appv-accent); outline-offset: 2px; }
.appv-btn--primary { color: #fff; border-color: transparent; background: var(--appv-brand); }
.appv-btn--primary:hover { border-color: transparent; filter: brightness(1.08); }
.appv-btn__count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 11px; font-weight: 750; color: #04101b; background: var(--appv-accent);
}
.appv-btn__count[hidden] { display: none; }

/* The bar is chrome around someone else's website: it has to stay on one line
   at every width without ever pushing the demo sideways. */
.appv-bar__short { display: none; }

@media (max-width: 900px) { .appv-bar__tag { display: none; } }
@media (max-width: 720px) {
  .appv-bar { gap: 6px; font-size: 12px; padding: 0 10px; }
  .appv-bar__mark img { width: 78px; }
  .appv-bar__long { display: none; }
  .appv-bar__short { display: inline; }
  .appv-btn { gap: 5px; padding: 6px 10px; font-size: 11.5px; }
  .appv-btn--back { padding: 6px 11px; font-size: 15px; line-height: 1; }
  .appv-bar__switch { padding: 2px; }
  .appv-bar__switch button { padding: 5px 9px; font-size: 11.5px; }
}
@media (max-width: 400px) {
  .appv-bar { gap: 4px; padding: 0 8px; }
  .appv-bar__mark img { width: 66px; }
  .appv-bar__switch button { padding: 5px 7px; font-size: 11px; }
  .appv-btn { padding: 6px 8px; font-size: 11px; }
}

/* ------------------------------------------------------------ explore mode */
.appv-marker {
  position: absolute; z-index: 40; display: none;
  align-items: center; gap: 6px; padding: 5px 10px 5px 6px;
  border: 1px solid rgba(81, 222, 244, .55); border-radius: 999px; cursor: pointer;
  font-family: var(--appv-font); font-size: 12px; font-weight: 680; line-height: 1;
  color: #04101b; background: #51def4; box-shadow: 0 8px 22px rgba(4, 16, 27, .35);
}
.appv-marker::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(4, 16, 27, .18);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 17v-5M12 8h.01'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 17v-5M12 8h.01'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E") center / contain no-repeat;
  background-color: #04101b;
}
.appv-marker:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body.appv-explore .appv-marker { display: inline-flex; }
body.appv-explore [data-appv-feature] { position: relative; }
body.appv-explore [data-appv-feature]::after {
  content: ""; position: absolute; inset: -10px; z-index: 30; pointer-events: none;
  border: 1.5px dashed rgba(81, 222, 244, .55); border-radius: 14px;
  background: rgba(81, 222, 244, .05);
}
@media (prefers-reduced-motion: no-preference) {
  body.appv-explore [data-appv-feature]::after { animation: appv-pulse 2.6s ease-in-out infinite; }
  @keyframes appv-pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
}

/* ------------------------------------------------------------------- modal */
.appv-modal {
  position: fixed; inset: 0; z-index: 2147483100; display: grid; place-items: center;
  padding: 20px; font-family: var(--appv-font); background: rgba(3, 9, 18, .74);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.appv-modal[hidden] { display: none; }
.appv-modal__panel {
  box-sizing: border-box; width: min(520px, 100%); max-height: min(84vh, 720px); overflow-y: auto;
  padding: clamp(22px, 4vw, 32px); border: 1px solid var(--appv-line); border-radius: 18px;
  color: var(--appv-ink); text-align: left;
  background: linear-gradient(158deg, #0d1f34, #071426);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .55);
}
.appv-modal__panel * { box-sizing: border-box; }
.appv-modal__eyebrow {
  display: block; margin: 0 0 12px; color: var(--appv-accent);
  font-size: 11px; font-weight: 780; letter-spacing: .14em; text-transform: uppercase;
}
.appv-modal__panel h2 {
  margin: 0 0 12px; font-size: clamp(1.35rem, 3.4vw, 1.72rem); font-weight: 780;
  line-height: 1.18; letter-spacing: -.02em; color: #fff;
}
.appv-modal__panel p { margin: 0 0 12px; font-size: 14px; line-height: 1.62; color: #c3d3e5; }
.appv-modal__panel p:last-of-type { margin-bottom: 0; }
.appv-modal__note {
  margin-top: 16px; padding: 12px 14px; border-left: 2px solid var(--appv-accent);
  border-radius: 0 8px 8px 0; background: rgba(81, 222, 244, .07);
  font-size: 12.5px; line-height: 1.55; color: #b7cde2;
}
.appv-modal__list { margin: 14px 0 0; padding: 0; list-style: none; }
.appv-modal__list li {
  display: flex; gap: 9px; padding: 7px 0; border-top: 1px solid var(--appv-line);
  font-size: 13px; color: #d7e4f2;
}
.appv-modal__list li::before { content: "✓"; color: var(--appv-accent); font-weight: 800; }
.appv-modal__actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.appv-modal__close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--appv-line); border-radius: 9px; cursor: pointer;
  color: #cddced; background: rgba(255, 255, 255, .05); font-size: 17px; line-height: 1;
}
.appv-modal__wrap { position: relative; width: min(520px, 100%); }
.appv-modal__close:focus-visible { outline: 2px solid var(--appv-accent); outline-offset: 2px; }

/* ------------------------------------------------------------------- toast */
.appv-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 2147483200; transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 32px)); padding: 12px 18px;
  border: 1px solid var(--appv-line); border-radius: 12px;
  font-family: var(--appv-font); font-size: 13px; font-weight: 640; color: var(--appv-ink);
  background: rgba(9, 22, 38, .96); box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.appv-toast[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .appv-toast { animation: appv-rise .28s cubic-bezier(.22, .61, .36, 1); }
  @keyframes appv-rise { from { opacity: 0; transform: translate(-50%, 10px); } }
}

/* ----------------------------------------------------- shared form helpers */
[data-appv-form] .appv-error {
  display: block; margin-top: 6px; font-size: 12.5px; font-weight: 620; color: #d63c3c;
}
[data-appv-form] .appv-error:empty { display: none; }
[data-appv-form] [aria-invalid="true"] { border-color: #d63c3c !important; }

/* Demo stylesheets set `display` on buttons and sections, which would otherwise
   beat the user-agent rule for [hidden]. Every demo relies on toggling hidden
   for steps, drawers and empty states, so it has to win. */
[hidden] { display: none !important; }

/* Screen-reader-only helper used by every demo. */
.appv-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.appv-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

/* Print: the Appvolution frame is screen chrome only. */
@media print {
  .appv-bar, .appv-marker, .appv-toast, .appv-modal { display: none !important; }
  body.appv-demo-body { margin-top: 0; }
}
