/* ==========================================================================
 * СТРАНИЦА «ТАКОЙ СТРАНИЦЫ НЕ СУЩЕСТВУЕТ» (404)
 * --------------------------------------------------------------------------
 * Разметка — pages/not-found.php, показывается внутри index.php, когда
 * .htaccess отправляет неизвестный адрес с меткой sw404. Поэтому шапка,
 * меню, счётчики и подвал сайта остаются на месте.
 *
 * Все классы в namespace .sw404*, чтобы не задевать стили темы.
 * Файл подключается в <head> index.php с версией по содержимому.
 * ========================================================================== */

.sw404 {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  margin: 36px auto 10px;
  padding: 40px 30px 34px;
  border: 1px solid rgba(216, 178, 104, .22);
  border-radius: 20px;
  background:
    radial-gradient(120% 130% at 50% -30%, rgba(255, 206, 112, .10), transparent 60%),
    linear-gradient(180deg, rgba(34, 35, 43, .82), rgba(17, 18, 23, .9));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, .08),
    0 20px 46px -22px rgba(0, 0, 0, .9);
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
}

/* Мягкое золотое свечение за значком */
.sw404__glow {
  position: absolute;
  top: -70px;
  left: 50%;
  width: 340px;
  height: 340px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 80, .16), transparent 62%);
  pointer-events: none;
  z-index: -1;
}

.sw404__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 205, 110, .38);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02)),
    linear-gradient(180deg, rgba(46, 44, 34, .9), rgba(24, 22, 18, .92));
  box-shadow:
    inset 0 1px 0 rgba(255, 238, 190, .22),
    0 10px 24px -14px rgba(0, 0, 0, .95),
    0 0 26px -12px rgba(255, 190, 80, .6);
  color: #ffcf6a;
}

.sw404__badge svg { display: block; width: 28px; height: 28px; }

.sw404__code {
  display: block;
  margin: 0 0 6px;
  font: 800 68px/1 Arial, Helvetica, sans-serif;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #ffeaad 0%, #ffd35c 42%, #e59f16 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 30px rgba(255, 170, 40, .22);
}

.sw404__title {
  margin: 0 0 12px;
  color: #f7f4ec;
  font: 700 24px/1.3 Arial, Helvetica, sans-serif;
}

.sw404__text {
  max-width: 560px;
  margin: 0 auto 24px;
  color: #9a9aa6;
  font-size: 14.5px;
  line-height: 1.65;
}

.sw404__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.sw404__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 10px;
  font: 700 13.5px/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease, color .16s ease;
}

.sw404__btn--primary {
  border: 1px solid rgba(255, 238, 158, .9);
  background: linear-gradient(180deg, #fff0bd 0%, #ffd75f 30%, #f0a81c 72%, #d08c0d 100%);
  color: #2b1d04;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .85),
    inset 0 -7px 12px -8px rgba(140, 84, 0, .55),
    0 10px 24px -12px rgba(255, 175, 45, .85);
}

.sw404__btn--primary:hover { transform: translateY(-2px); filter: brightness(1.05); }

.sw404__btn--ghost {
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  color: #e9e7e0;
}

.sw404__btn--ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 205, 110, .5);
  color: #ffe1a1;
}

.sw404__btn:focus-visible,
.sw404__links a:focus-visible {
  outline: 2px solid #f0cf85;
  outline-offset: 3px;
}

/* Популярные разделы — подсказка, куда пойти вместо несуществующей страницы */
.sw404__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.sw404__links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: #cfcfd6;
  font: 600 12.5px/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.sw404__links a:hover {
  color: #ffe1a1;
  border-color: rgba(255, 205, 110, .45);
  background: rgba(255, 198, 7, .09);
}

/* Узкие экраны: блок становится компактнее, кнопки — на всю ширину */
@media (max-width: 700px) {
  .sw404 { margin: 18px auto 6px; padding: 28px 18px 24px; border-radius: 16px; }
  .sw404__badge { width: 54px; height: 54px; border-radius: 15px; }
  .sw404__badge svg { width: 24px; height: 24px; }
  .sw404__code { font-size: 52px; }
  .sw404__title { font-size: 19px; }
  .sw404__text { font-size: 13.5px; }
  .sw404__actions { flex-direction: column; }
  .sw404__btn { width: 100%; }
  .sw404__links { gap: 6px; }
  .sw404__links a { min-height: 32px; padding: 0 11px; font-size: 12px; }
}
