/* UltraPass-Website – Demo im Kopfbereich: der Generator im Look von App 1.17
   (ultrapass/lib/widgets/generator/generatorHandy.dart). Nur auf der Startseite geladen.
   Knöpfe, Menü, Snackbar und untere Leiste: css/demo-knoepfe.css; Karte der Einstellungen:
   css/demo-einstellungen.css; Blatt „Weitere Optionen“, Raster, „Vergrößern“: css/demo-blatt.css.

   Maße in Punkten der App: --u ist ein Punkt eines 402 pt breiten iPhones, umgerechnet
   auf die Breite des Bildschirms im Rahmen (Container-Einheiten). So sieht die Demo in
   jeder Größe aus wie ein verkleinerter Screenshot der App. Farben aus den Screenshots
   der App (themeLight / themeDark, knopfStil.dart, einzelwahl.dart, auswahlFeld.dart). */

/* Ubuntu Mono wie in der App (Ubuntu Font Licence 1.0), auf ASCII, § und – gekürzt */
@font-face {
  font-family: "Ubuntu Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ubuntu-mono-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Ubuntu Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ubuntu-mono-bold.woff2") format("woff2");
}

.phone {
  width: min(330px, 86vw);
  aspect-ratio: 330 / 694;
  padding: 10px;
  border-radius: 52px;
  background: #121513;
  box-shadow: var(--shadow-phone), inset 0 0 0 2px #2c322e;
}

/* Helles Design der App */
.app {
  --a-bg: #ffffff;
  --a-card: #f5f5f5;
  --a-text: #1f1f1f;
  --a-muted: #616161;
  --a-primary: #2e7d32;
  --a-on-primary: #ffffff;
  --a-tonal: #e0e9e1;
  --a-neutral: #e6eae6;
  --a-raised: #ffffff;
  --a-unselected: #4f5550;
  --a-line: #e2e6e2;
  --a-nav: rgb(248 248 248 / 0.94);
  --a-nav-active: #dde5dd;
  --a-digit: #1565c0;
  --a-special: #7b1fa2;
  --a-sheet: #ffffff;
  --a-reason: #8a5a00;
  --a-switch-off: #e9e9ea;
  --a-strong: #2e7d32;
  --a-medium: #6e6000;
  --a-weak: #b45309;
  --a-very-weak: #c62828;
  color: var(--a-text);
}

@media (prefers-color-scheme: dark) {
  .app {
    --a-bg: #202124;
    --a-card: #26272a;
    --a-text: #eeeeee;
    --a-muted: #9e9e9e;
    --a-primary: #a5d6a7;
    --a-tonal: #29312d;
    --a-neutral: #35373b;
    --a-raised: #4a4d52;
    --a-unselected: #bdbdbd;
    --a-line: rgb(255 255 255 / 0.1);
    --a-nav: rgb(38 39 42 / 0.94);
    --a-nav-active: #2f3733;
    --a-digit: #81d4fa;
    --a-special: #ce93d8;
    --a-sheet: #202124;
    --a-reason: #ffcc80;
    --a-switch-off: #39393d;
    --a-strong: #a5d6a7;
    --a-medium: #fbc02d;
    --a-weak: #ff9800;
    --a-very-weak: #e57373;
  }
}

.app__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 42px;
  background: var(--a-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.3;
  text-align: left;
  container-type: inline-size;
  --u: calc(100cqw / 402);
}

.app :focus-visible {
  outline: 2px solid var(--a-primary);
  outline-offset: 1px;
}

:where(.app) button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Kopfzeile: Statusleiste frei, rechts das Menü */
.app__bar {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  padding: calc(64 * var(--u)) calc(16 * var(--u)) 0;
  height: calc(112 * var(--u));
  box-sizing: border-box;
}

.app__bar-icon {
  width: calc(26 * var(--u));
  height: calc(26 * var(--u));
  margin-top: calc(-13 * var(--u));
  color: var(--a-primary);
}

.app__main {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: calc(8 * var(--u)) calc(16 * var(--u)) calc(120 * var(--u));
  scrollbar-width: none;
}

.app__main::-webkit-scrollbar {
  display: none;
}

/* Karte mit dem Passwort */
.app-card {
  padding: calc(18 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u)) calc(20 * var(--u));
  border-radius: calc(20 * var(--u));
  background: var(--a-card);
}

.app-card__pwd {
  display: flex;
  align-items: center;
  min-height: calc(64 * var(--u));
  padding-right: calc(8 * var(--u));
}

.app-pwd {
  --size: calc(var(--pwd-size, 26) * var(--u));
  display: flex;
  flex-wrap: wrap;
  column-gap: calc(var(--size) * 0.55);
  row-gap: calc(var(--size) * 0.3);
  max-height: calc(var(--size) * (1.25 * 5 + 0.3 * 4));
  margin: 0;
  overflow-y: auto;
  font-family: "Ubuntu Mono", ui-monospace, monospace;
  font-size: var(--size);
  line-height: 1.25;
  letter-spacing: calc(1.5 * var(--u));
  color: var(--a-text);
  overflow-wrap: anywhere;
}

.app-pwd.is-phrase {
  column-gap: 0;
}

.app-pwd__group {
  white-space: nowrap;
}

.app-pwd .is-d,
.app-enlarge__text .is-d {
  color: var(--a-digit);
}

.app-pwd .is-s,
.app-enlarge__text .is-s {
  color: var(--a-special);
}

.app-card__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(8 * var(--u)) calc(10 * var(--u));
  margin-top: calc(12 * var(--u));
}

/* Stärke: vier kurze Balken und das Wort */
.app-strength {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  margin: 0;
  font-size: calc(14 * var(--u));
  font-weight: 700;
  white-space: nowrap;
  color: var(--a-strong);
}

.app-strength.is-medium { color: var(--a-medium); }
.app-strength.is-weak { color: var(--a-weak); }
.app-strength.is-very-weak { color: var(--a-very-weak); }

.app-strength__bars {
  display: flex;
  gap: calc(3 * var(--u));
}

.app-strength__bars i {
  width: calc(10 * var(--u));
  height: calc(6 * var(--u));
  border-radius: calc(2 * var(--u));
  background: currentColor;
  opacity: 0.2;
}

.app-strength__bars i.is-filled,
.app:not(.is-live) .app-strength__bars i {
  opacity: 1;
}
