/* Samostatny chybovy stav V2 Reakce.

   Chyba neni dalsi faze progressu: jakmile backend autoritativne oznami
   `failed`, progress DOM se skryje a zobrazi se tato samostatna plocha.
   Schvaleny navrh: analysis/fable/homepage/
   varianta-g2b-zpracovani-chyba.html. */

#ndError {
  display: none;
  min-height: max(32rem, calc(100vh - 14rem));
  min-height: max(32rem, calc(100dvh - 14rem));
  align-items: center;
  padding: 2rem 0 4rem;
}

.nd-error-page {
  width: min(47rem, 100%);
}

.nd-error-label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.15rem;
  color: #b42318;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nd-error-symbol {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: rgba(180, 35, 24, .075);
  font-size: .82rem;
}

.nd-error-title {
  max-width: 43rem;
  margin: 0;
  color: var(--nd-ink);
  font-size: clamp(2.75rem, 6vw, 5.2rem);
  line-height: .98;
  font-weight: 200;
  letter-spacing: -.05em;
}

.nd-error-title-compact {
  max-width: 44rem;
  font-size: clamp(2.35rem, 4.6vw, 4.15rem);
  line-height: 1.03;
  letter-spacing: -.045em;
}

.nd-error-message {
  max-width: 39rem;
  margin: 1.35rem 0 1.65rem;
  color: var(--nd-muted);
  font-size: clamp(1.02rem, 2vw, 1.25rem);
  line-height: 1.55;
  font-weight: 300;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nd-error-safe {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  max-width: 42rem;
}

.nd-error-safe-icon {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(22, 132, 91, .075);
  color: #16845b;
  font-size: .9rem;
}

.nd-error-safe h2 {
  margin: .02rem 0 .25rem;
  color: var(--nd-muted);
  font-size: .93rem;
  line-height: 1.35;
  font-weight: 600;
}

.nd-error-safe p {
  margin: 0;
  color: var(--nd-muted);
  font-size: .86rem;
  line-height: 1.55;
}

.nd-error-actions {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.nd-error-limit-actions {
  gap: .65rem;
  margin-top: 1.6rem;
}

.nd .nd-error-limit-actions > a {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nd-error-limit-privacy {
  margin-top: 1.65rem;
}

.nd .nd-error-retry {
  min-height: 3.25rem;
  padding: .85rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid var(--nd-accent);
  border-radius: 9px;
  background: var(--nd-accent);
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  line-height: 1;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(211, 84, 0, .12);
  transition: background .18s ease, border-color .18s ease,
    transform .18s ease;
}

.nd .nd-error-retry:hover {
  border-color: #b34700;
  background: #b34700;
  color: #fff;
  transform: translateY(-1px);
}

.nd .nd-error-retry:focus-visible {
  outline: 3px solid rgba(249, 115, 22, .24);
  outline-offset: 3px;
}

@media (min-width: 992px) {
  #rkLayout .rk-main:has(#ndRoot[data-view-state="error"]) {
    overflow-y: hidden;
  }

  #rkLayout .rk-main:has(#ndRoot[data-view-state="error"]) .rk-main-inner,
  #rkLayout .rk-main:has(#ndRoot[data-view-state="error"]) .nd,
  #ndRoot[data-view-state="error"] {
    height: 100%;
    min-height: 0;
  }

  #rkLayout .rk-main:has(#ndRoot[data-view-state="error"]) .rk-main-inner {
    padding-top: 0;
    padding-bottom: 0;
  }

  #rkLayout .rk-main:has(#ndRoot[data-view-state="error"]) .nd {
    padding-bottom: 0;
  }

  #ndRoot[data-view-state="error"] {
    padding-top: 0;
  }

  #ndRoot[data-view-state="error"] #ndError {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }
}

@media (max-height: 670px) and (min-width: 641px) {
  #ndError {
    align-items: flex-start;
    padding-top: 1.5rem;
  }

  .nd-error-title {
    font-size: clamp(2.65rem, 8vh, 4.2rem);
  }

  .nd-error-title-compact {
    font-size: clamp(2.2rem, 11vw, 3.35rem);
  }

  .nd-error-actions {
    margin-top: 1.4rem;
  }
}

@media (max-width: 640px) {
  #ndError {
    min-height: 0;
    align-items: flex-start;
    padding: 2.4rem 0 3.5rem;
  }

  .nd-error-title {
    font-size: clamp(2.5rem, 13vw, 4rem);
    line-height: 1.02;
  }

  .nd-error-title-compact {
    font-size: clamp(2.15rem, 10.5vw, 3.2rem);
    line-height: 1.06;
  }

  .nd-error-message {
    margin: 1rem 0 1.4rem;
  }

  .nd-error-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nd-error-retry {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nd-error-retry {
    transition: none;
  }
}
