.app-startup {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-sm);
  padding: var(--content-gutter);
  background: var(--canvas);
  color: var(--sage-700);
  font-size: var(--text-body);
  text-align: center;
}
.app-startup img { display: block; width: clamp(156px, 46vw, 240px); height: auto; }
.app-startup[hidden] { display: none; }

.login-shell {
  --login-soft-green: linear-gradient(120deg, #eef0d3, #e5eac1);
  --login-header-height: var(--mobile-header-height);
  --login-footer-height: var(--mobile-footer-height);
  display: grid;
  grid-template-rows: var(--login-header-height) minmax(0, 1fr) var(--login-footer-height);
  width: min(100%, var(--app-max));
  height: 100%;
  height: var(--visible-viewport-bottom, 100dvh);
  margin-inline: auto;
}
.login-shell[hidden] { display: none; }
[data-preview-app]:not([hidden]) { display: contents; }
.preview-logout {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: start;
}

.login-shell .login-header {
  display: block;
  height: var(--login-header-height);
  min-height: 0;
}
.login-main {
  grid-row: 2;
  width: min(84.5%, 30rem);
  height: auto;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(.75rem, 3.1vw, 1.5rem) 0 var(--space-sm);
  overflow-y: auto;
  overscroll-behavior-y: none;
  scrollbar-width: none;
  text-align: center;
}
.login-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: 0;
  color: #233620;
  font-size: var(--text-title);
  font-weight: 850;
  line-height: 1.08;
}
.login-title::before, .login-title::after {
  content: "";
  flex: 0 0 clamp(1.65rem, 9vw, 3rem);
  height: 1em;
  background-position: center;
  background-size: 210% auto;
  background-repeat: no-repeat;
}
.login-title::before, .login-title::after { background-image: url('../login/listky.png'); }
.login-title::before { transform: scaleX(-1); }
.login-intro {
  max-width: 33ch;
  margin: var(--space-sm) auto var(--space-lg);
  color: #283b2e;
  line-height: var(--line-compact);
}
.login-form { display: grid; gap: var(--space-sm); }
.login-form[hidden] { display: none; }
.login-form[data-view]:not([hidden]) { margin-top: var(--space-lg); }
.qr-registration { text-align: start; }
.qr-registration-summary {
  display: grid;
  gap: .35rem;
  padding: var(--space-sm);
  border: 1px solid #dce4ce;
  border-radius: var(--radius-sm);
  background: #eef2e3;
  color: #344534;
}
.qr-registration-summary-row { display: flex; justify-content: space-between; gap: var(--space-sm); margin: 0; font-size: var(--text-sm); }
.qr-registration-summary-row strong { text-align: end; overflow-wrap: anywhere; }
.qr-registration-file { display: grid; place-items: center; position: relative; overflow: hidden; cursor: pointer; }
.qr-registration-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.qr-registration-camera { display: grid; gap: var(--space-sm); }
.qr-registration-camera[hidden] { display: none; }
.qr-registration-camera video { width: 100%; max-height: 55dvh; object-fit: cover; border-radius: var(--radius-sm); background: #203323; }
.qr-registration-seed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin: 0; padding: 0; list-style: none; }
.qr-registration-seed li { min-width: 0; padding: .55rem; border: 1px solid #e0c8a7; border-radius: var(--radius-sm); background: #fcf3e6; color: #2f4d2e; overflow-wrap: anywhere; }
.qr-registration-seed strong { font-size: var(--text-sm); }
.qr-registration [data-seed-position] { text-transform: lowercase; }
.login-field, .login-password { display: block; position: relative; }
.login-field-email { --field-icon: url('../login/email.png'); }
.login-field-password { --field-icon: url('../login/heslo.png'); }
.login-field::before {
  content: "";
  position: absolute;
  inset-inline-start: var(--space-sm);
  top: 50%;
  width: calc(var(--icon-size) * 1.25);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: var(--field-icon, none) center / 145% auto no-repeat;
  pointer-events: none;
}
.login-field-family::before {
  background: url('../login/rodina.svg') center / 105% auto no-repeat;
}
.login-field-plain::before { display: none; }
.login-field input:not([type="checkbox"]) {
  width: 100%;
  padding-inline: calc(var(--icon-size) * 1.25 + 2 * var(--space-sm)) var(--space-sm);
  min-height: var(--control-size);
  border: 1px solid #e0c8a7;
  border-radius: var(--radius-sm);
  background: #fcf3e6;
  box-shadow: 0 3px 7px rgb(103 70 34 / 9%);
  font-size: max(1rem, var(--text-body));
}
.login-field-plain input:not([type="checkbox"]) { padding-inline-start: var(--space-sm); }
.login-field-password input:not([type="checkbox"]) { padding-inline-end: var(--control-size); }
.login-password-toggle {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--control-size);
  border: 0;
  border-radius: var(--radius-sm);
  background: url('../login/oko.png') center / 78% auto no-repeat;
  cursor: pointer;
}
.login-password-toggle.is-revealed::after {
  content: "";
  position: absolute;
  inset: 50% 27% auto;
  border-top: 2px solid #355f19;
  transform: rotate(-40deg);
}
.login-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 var(--space-xs);
  margin-block-end: var(--space-xs);
  color: #2f4130;
  font-size: var(--text-sm);
}
.login-options label, .login-text-button { min-height: 44px; display: inline-flex; align-items: center; }
.login-options label { gap: var(--space-xs); cursor: pointer; }
.login-remember-switch {
  appearance: none;
  display: grid;
  align-items: center;
  flex: none;
  inline-size: 2.65em;
  block-size: 1.5em;
  margin: 0;
  padding: .16em;
  border: 1px solid #838d73;
  border-radius: .4em;
  background: var(--login-soft-green);
  font-size: inherit;
  cursor: pointer;
}
.login-remember-switch::before {
  content: "";
  inline-size: 1em;
  block-size: 1em;
  border-radius: .24em;
  background: #fffaf0;
  box-shadow: 0 1px 3px rgb(47 65 48 / 28%);
}
.login-remember-switch:checked {
  justify-items: end;
  border-color: #426c16;
  background: #426c16;
}
@media (forced-colors: active) {
  .login-remember-switch { appearance: auto; }
  .login-remember-switch::before { content: none; }
}
.login-text-button { padding: 0; border: 0; background: none; color: #37621c; text-decoration: underline; cursor: pointer; }
.login-button {
  min-height: var(--control-size);
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid #709636;
  border-radius: var(--radius-sm);
  background: var(--login-soft-green);
  color: #274a16;
  box-shadow: 0 3px 7px rgb(103 70 34 / 11%);
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: var(--line-compact);
  cursor: pointer;
}
.login-button.login-primary { background: linear-gradient(#61801d, #3d650d); color: #fff; }
.login-button:hover { filter: brightness(1.035); }
.login-button:active { filter: brightness(.95); }
.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: clamp(1.6rem, 8vw, 2.75rem);
  margin: var(--space-xs) 5%;
  background: url('../login/oddelovac.png') center / auto 140% no-repeat;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: #aebe79; }
.login-divider::before { margin-inline-end: 1rem; }
.login-divider::after { margin-inline-start: 1rem; }
.login-invite {
  display: grid;
  grid-template-columns: minmax(0, 27%) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border: 1px solid #fffdf6;
  border-radius: var(--radius);
  background: #fff4e3 url('../login/vetev.png') right top / 3.5rem auto no-repeat;
  box-shadow: 0 4px 11px rgb(103 70 34 / 12%);
  text-align: left;
}
.login-ticket {
  aspect-ratio: 1;
  background: url('../login/pozvanka.png') center / 122% auto no-repeat;
}
.login-invite-content { padding-inline-start: var(--space-sm); border-inline-start: 1px solid #c7bd7e; }
.login-invite h2 { margin: 0; padding-inline-end: 1.35rem; color: #263b24; font-size: var(--text-lg); line-height: 1.12; }
.login-invite p { margin: var(--space-xs) 0 var(--space-sm); font-size: var(--text-sm); line-height: var(--line-compact); }
.login-invite .login-button { font-size: var(--text-body); }
.login-version { margin-block-start: calc(var(--space-sm) + 10px); }
.login-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(96%, 30rem);
  margin-inline: auto;
  gap: clamp(.2rem, 1vw, .6rem);
}
.login-info-grid-android { translate: 0 -10px; }
.login-info-button {
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: center;
  gap: .1em;
  min-height: 44px;
  padding: .2em .25em .35em;
  border: 1px solid #a5b07e;
  border-radius: var(--radius-sm);
  background: rgb(251 249 225 / 94%);
  box-shadow: 0 2px 6px rgb(39 74 22 / 14%);
  color: #274a16;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.login-info-button img { display: block; width: clamp(1.65rem, 7vw, 2.75rem); height: auto; }
.login-status { margin: var(--space-sm) 0 0; color: #3e5e2e; font-size: var(--text-sm); }
.login-status.is-error { color: #8c342d; }
.login-status:empty { display: none; }
.activation-form { text-align: center; }
.activation-title { margin: 0; color: #263b24; font-size: var(--text-lg); font-weight: 850; line-height: 1.15; }
.activation-description { margin: 0; color: #344534; font-size: var(--text-body); line-height: var(--line-compact); }
.activation-email { margin: 0; color: #3e5e2e; font-size: var(--text-sm); font-weight: 750; overflow-wrap: anywhere; }
.activation-entry-time { margin: 0; color: #52684b; font-size: var(--text-xs); }
.activation-code { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(.25rem, 1.6vw, .55rem); width: min(100%, 22rem); margin-inline: auto; }
.qr-registration-code { margin-block: var(--space-sm); }
.activation-code > span { display: grid; place-items: center; min-width: 0; aspect-ratio: .82; border: 1px solid #d9c5a7; border-radius: var(--radius-sm); background: #fcf3e6; box-shadow: 0 3px 7px rgb(103 70 34 / 9%); color: #2f4d2e; font-size: clamp(1.15rem, 5vw, 1.65rem); font-weight: 800; }
.activation-code input { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; caret-color: transparent; cursor: text; font-size: 1rem; }
.activation-status { min-height: 0; margin: 0; color: #3e5e2e; font-size: var(--text-sm); line-height: var(--line-compact); }
.activation-status:empty, .activation-status[hidden] { display: none; }
.activation-status.is-error { color: #8c342d; }
.activation-resend { justify-content: center; width: 100%; line-height: var(--line-compact); }
.activation-resend:disabled, .login-button:disabled { opacity: .68; cursor: wait; }
.login-form .login-button[hidden] { display: none; }
.login-landscape {
  grid-row: 3;
  display: grid;
  align-items: end;
  min-height: 0;
  padding-block-end: calc(var(--mobile-safe-bottom) + .25rem);
  background: url('../login/paticka.png') center bottom / 100% auto no-repeat;
}

@media (max-width: 1199px) and (orientation: landscape) and (max-height: 600px) {
  .login-shell {
    --login-header-height: min(var(--mobile-header-height), 34dvh);
    --login-footer-height: max(72px, min(var(--mobile-footer-height), 23dvh));
  }
  .login-shell .login-header { position: relative; }
  .login-header::before, .login-landscape { background-size: contain; background-position: center bottom; }
}

@media (min-width: 1200px) {
  .login-preview,
  .login-preview body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .login-shell {
    --login-header-height: 180px;
    height: calc(100dvh - 48px);
  }
  .login-shell .login-header { position: relative; }
  .login-landscape { width: min(100%, 65rem); margin-inline: auto; }
  .login-header::before {
    background-image: url('../images/desktop/header.png');
    background-position: center;
    background-size: cover;
  }
}
