:root {
  --bg: #ffffff;
  --box: #d9d9d9;
  --text: #000000;
  --button: #ffffff;
  --bar: #bdbdbd;
  --redirect-delay: 2s; /* keep in sync with REDIRECT_DELAY_MS in js/home.js */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.box {
  position: relative;
  width: min(660px, 100%);
  min-height: 320px;
  background: var(--box);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 24px;
  text-align: center;
  overflow: hidden;
  animation: fade-in .35s ease-out both;
}

.box h1 {
  font-weight: 400;
  font-size: clamp(1.05rem, 4.2vw, 2.1rem);
  line-height: 1.25;
  max-width: 20em;
}

.btn {
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--button);
  border: 0;
  width: 125px;
  height: 32px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease;
}
.btn:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Progress bar showing the redirect countdown */
.progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: var(--bar);
  transform-origin: left;
  animation: fill var(--redirect-delay) linear forwards;
}
.box.cancelled .progress { animation-play-state: paused; opacity: .4; }

@keyframes fill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  .box { min-height: 220px; padding: 28px 16px; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .box, .progress { animation: none; }
}
