/* Оформление страницы проверки: тёплая песочная палитра, золото, плавные анимации.
   Подключается из web/index.templ после xess.css, поэтому перекрывает его. */

:root {
  /* Перекрываем переменные xess, иначе заголовок и полоса остаются в стиле по умолчанию */
  --body-title-font: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --progress-bar-outline: none;
  --progress-bar-fill: rgba(169, 122, 38, 0.14);

  --sand-0: #fffaf0;
  --sand-1: #f7ead1;
  --sand-2: #eed9b0;
  --ink: #2b2218;
  --muted: #7c6a52;
  --gold-1: #e9c882;
  --gold-2: #c99a3f;
  --gold-3: #a97a26;
  --line: rgba(169, 122, 38, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  overflow-x: hidden;
  background: linear-gradient(165deg, var(--sand-0) 0%, var(--sand-1) 52%, var(--sand-2) 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Фон: мягкие золотые пятна света и «след» маршрута */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.75;
}

.sky__glow--warm {
  top: -18vw;
  left: -10vw;
  width: 48vw;
  height: 48vw;
  background: radial-gradient(circle, rgba(233, 200, 130, 0.85), transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.sky__glow--sand {
  right: -14vw;
  bottom: -20vw;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(240, 214, 168, 0.9), transparent 70%);
  animation: drift-b 32s ease-in-out infinite alternate;
}

.sky__glow--gold {
  top: 34%;
  left: 46%;
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, rgba(201, 154, 63, 0.35), transparent 70%);
  animation: drift-c 22s ease-in-out infinite alternate;
}

.sky__trail {
  position: absolute;
  top: -20%;
  left: -30%;
  width: 160%;
  height: 160%;
  background:
    repeating-linear-gradient(
      102deg,
      rgba(201, 154, 63, 0.07) 0 1px,
      transparent 1px 34px
    );
  mask-image: radial-gradient(60% 50% at 50% 45%, #000 0%, transparent 78%);
  animation: trail 40s linear infinite;
}

@keyframes drift-a {
  to { transform: translate3d(4vw, 3vh, 0) scale(1.08); }
}
@keyframes drift-b {
  to { transform: translate3d(-5vw, -3vh, 0) scale(1.12); }
}
@keyframes drift-c {
  to { transform: translate3d(-3vw, 4vh, 0) scale(0.92); }
}
@keyframes trail {
  to { transform: translate3d(6%, 4%, 0); }
}

/* Центральная колонка */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  max-width: 30rem;
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s forwards;
}

body.ready .shell {
  animation-duration: 0.55s;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* Печать-штамп с самолётом */
.stamp {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  color: var(--gold-3);
  background: radial-gradient(circle at 50% 30%, #fffdf7, var(--sand-1));
  box-shadow:
    0 10px 26px -14px rgba(122, 82, 20, 0.55),
    inset 0 0 0 1px rgba(169, 122, 38, 0.28);
}

.stamp__ring {
  position: absolute;
  inset: 0;
  color: var(--gold-2);
  animation: spin 26s linear infinite;
}

.stamp__plane {
  position: relative;
  filter: drop-shadow(0 2px 4px rgba(169, 122, 38, 0.35));
  animation: float 4.6s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, -2px, 0) rotate(-6deg); }
  50% { transform: translate3d(0, 3px, 0) rotate(6deg); }
}

/* Карточка билета */
.card {
  position: relative;
  width: 100%;
  padding: 2.2rem 1.9rem 2rem;
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 252, 244, 0.72));
  box-shadow:
    0 30px 60px -34px rgba(120, 84, 24, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

/* Золотая «кромка билета» */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, transparent, var(--gold-2), var(--gold-1), var(--gold-2), transparent);
  opacity: 0.85;
}

/* Прожектор под курсором */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 0%),
    rgba(233, 200, 130, 0.4),
    transparent 72%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card:hover::after {
  opacity: 1;
}

.card__title::after {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  margin: 0.75rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
  animation: accent 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s both;
}

@keyframes accent {
  from { width: 0; opacity: 0; }
  to { width: 54px; opacity: 1; }
}

.card__title {
  position: relative;
  margin: 0 0 0.9rem;
  font-family: var(--body-title-font);
  font-size: clamp(1.28rem, 1.05rem + 1.1vw, 1.66rem);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

/* Пунктирная линия-разрыв билета */
.check {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.check__status {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.check__error {
  margin: 0;
  color: #a4381f;
  font-size: 0.9rem;
  line-height: 1.5;
}

.check__note {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

#progress {
  display: none;
  width: min(22rem, 100%);
  height: 8px;
  margin: 0.15rem 0 0.1rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: rgba(169, 122, 38, 0.14);
  box-shadow: inset 0 1px 2px rgba(120, 84, 24, 0.18);
}

.bar-inner {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2) 45%, var(--gold-1) 70%, var(--gold-3));
  background-size: 240% 100%;
  box-shadow: 0 0 14px rgba(201, 154, 63, 0.55);
  animation: shimmer 2.4s linear infinite;
  transition: width 0.25s ease-in;
}

@keyframes shimmer {
  to { background-position: -240% 0; }
}

/* Блок «что происходит» */
.why {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.8rem 1rem;
  text-align: left;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font-size: 0.85rem;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.why:hover {
  background: rgba(255, 252, 244, 0.85);
  border-color: rgba(169, 122, 38, 0.38);
}

.why summary {
  color: #6b5527;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
}

.why summary::-webkit-details-marker {
  display: none;
}

.why summary::before {
  content: "＋";
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--gold-2);
  transition: transform 0.25s ease;
}

.why[open] summary::before {
  content: "－";
}

.why p {
  margin: 0.6rem 0 0;
  line-height: 1.6;
}

.why a {
  color: var(--gold-3);
}

.check img#image {
  display: none;
}

.foot {
  margin: 0;
  color: rgba(110, 92, 66, 0.72);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}

.card a {
  color: var(--gold-3);
  text-decoration-color: rgba(169, 122, 38, 0.4);
  text-underline-offset: 3px;
}

.card pre {
  padding: 0.6rem;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: rgba(169, 122, 38, 0.07);
  color: var(--muted);
  font-size: 0.7rem;
  text-align: left;
  white-space: pre-wrap;
}

.centered-div {
  text-align: center;
}

@media (max-width: 420px) {
  .card {
    padding: 1.8rem 1.2rem 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell,
  .stamp__ring,
  .stamp__plane,
  .bar-inner,
  .sky__glow,
  .sky__trail {
    animation: none;
  }

  .shell {
    opacity: 1;
    transform: none;
  }
}
