:root {
  --color-background: #f2f7fb;
  --color-surface: #ffffff;
  --color-text: #183247;
  --color-muted: #526b7d;
  --color-border: #cfdee8;
  --color-primary: #0069a6;
  --color-primary-hover: #005486;
  --color-focus: #ffbf47;
  --color-accent-soft: #e6f4fb;
  --color-accent-strong: #0069a6;
  --shadow-card: 0 24px 70px rgba(23, 67, 96, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-background);
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--color-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(49, 174, 220, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 86%, rgba(0, 105, 166, 0.09), transparent 32rem),
    var(--color-background);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

body.error-access {
  --color-accent-soft: #e8f3fb;
  --color-accent-strong: #0069a6;
}

body.error-request {
  --color-accent-soft: #f4effc;
  --color-accent-strong: #6542a5;
}

body.error-system {
  --color-accent-soft: #fff1e4;
  --color-accent-strong: #9b4b08;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  color: #ffffff;
  background: #163f5b;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  border-radius: 10px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 154px;
  height: auto;
}

.brand-copy {
  display: grid;
  gap: 1px;
  padding-left: 16px;
  border-left: 1px solid var(--color-border);
}

.brand-copy strong {
  color: #0b4f7c;
  font-size: 1rem;
}

.brand-copy span {
  color: var(--color-muted);
  font-size: 0.78rem;
}

.error-main {
  width: min(1040px, calc(100% - 40px));
  margin: auto;
  padding: 40px 0 72px;
}

.error-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.55fr);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid rgba(181, 205, 220, 0.82);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
}

.error-status {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(34px, 6vw, 64px) 28px;
  color: var(--color-accent-strong);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.92) 0 32%, transparent 33%),
    var(--color-accent-soft);
  border-right: 1px solid var(--color-border);
  text-align: center;
}

.status-label,
.status-kind {
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-label {
  font-size: 0.73rem;
}

.error-code {
  margin-block: 8px;
  font-size: clamp(4.8rem, 11vw, 8.2rem);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: -0.08em;
  text-indent: -0.08em;
}

.status-kind {
  font-size: 0.78rem;
}

.error-content {
  padding: clamp(34px, 6vw, 66px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--color-accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  max-width: 19ch;
  margin: 0;
  color: #153f5c;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.error-message {
  max-width: 60ch;
  margin: 20px 0 0;
  color: var(--color-muted);
  font-size: clamp(1rem, 2vw, 1.13rem);
}

.recovery-panel {
  max-width: 620px;
  margin-top: 26px;
  padding: 18px 20px;
  background: #f7fafc;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.recovery-panel h2 {
  margin: 0;
  color: #23475f;
  font-size: 1rem;
}

.recovery-panel ul {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  color: var(--color-muted);
}

.recovery-panel li + li {
  margin-top: 6px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 10px 22px rgba(0, 91, 150, 0.2);
}

.button-primary:hover {
  background: var(--color-primary-hover);
}

.button-secondary {
  color: #174866;
  background: #ffffff;
  border-color: #b9cedc;
}

.technical {
  max-width: 620px;
  margin-top: 26px;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.technical summary {
  width: fit-content;
  cursor: pointer;
  color: #23475f;
  font-weight: 700;
}

.technical p {
  margin: 10px 0 0;
}

.support-note {
  margin: 22px 0 0;
  color: var(--color-muted);
  text-align: center;
  font-size: 0.92rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0 28px;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.button:focus-visible,
.brand:focus-visible,
.skip-link:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer,
  .error-main {
    width: min(100% - 28px, 1040px);
  }

  .site-header {
    min-height: 76px;
  }

  .brand img {
    width: 132px;
  }

  .brand-copy {
    display: none;
  }

  .error-main {
    padding: 18px 0 44px;
  }

  .error-card {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .error-status {
    min-height: 178px;
    padding: 26px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .error-code {
    font-size: clamp(4.4rem, 22vw, 6.5rem);
  }

  .error-content {
    padding: 30px 22px 32px;
  }

  .actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .site-footer {
    display: grid;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .site-header,
  .site-footer,
  .error-main {
    width: calc(100% - 20px);
  }

  .error-content {
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
