/* ═══════════════════════════════════════════
   SURVEY / REDIRECT PAGES — Theme & Animations
   Base tokens and layout from shared.css.
   ═══════════════════════════════════════════ */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

/* ── ACTIVE REDIRECT BUTTON ── */
#goNowBtn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 3px;
  padding: clamp(10px, 1.8vh, 13px) 16px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(0.85rem, 2.2vw, 0.95rem);
  font-weight: 700;
  background: var(--theme-accent, var(--accent));
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
  letter-spacing: 0.01em;
  text-align: center;
}
#goNowBtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
#goNowBtn:active { transform: translateY(0); }
#goNowBtn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--theme-accent, var(--accent)) 35%, transparent);
  outline-offset: 2px;
}

body.is-in-app-browser #goNowBtn {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: none;
}
body.is-in-app-browser #goNowBtn:hover {
  box-shadow: none;
  background: var(--bg-2);
}

/* ── THEME-COLORED CLOSED HOME BUTTON ── */
body.theme-educators .closed-home-btn,
body.theme-parents   .closed-home-btn,
body.theme-video     .closed-home-btn {
  background: var(--theme-accent);
}

/* ── CLOSED STATE SECTION LAYOUT ── */
.closed-info {
  position: relative;
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.5vh, 14px);
  margin-bottom: clamp(2px, 0.5vh, 4px);
}

/* ── CLOSED STATE BADGE & TITLE ── */
.badge-closed {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
  background: color-mix(in srgb, var(--success) 7%, transparent);
}
.badge-closed::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--success);
  flex-shrink: 0;
  animation: none;
  opacity: 1;
}

.closed-title {
  background: linear-gradient(
    90deg,
    var(--ink) 0%,
    var(--success) 35%,
    var(--ink) 50%,
    var(--success) 65%,
    var(--ink) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 8s linear infinite;
}

/* ── CLOSED STATUS BOX ── */
.closed-status {
  position: relative;
  width: 100%;
  background: color-mix(in srgb, var(--success) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 18%, transparent);
  border-radius: 3px;
  padding: clamp(10px, 1.8vh, 14px) 14px;
}

.closed-status-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  line-height: 1.5;
  font-family: "Inter", system-ui, sans-serif;
}

.closed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: var(--success);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── IN-APP PROMPT ── */
.inapp-prompt {
  background: linear-gradient(180deg, var(--surface-glass), rgba(255,255,255,0.58));
}

/* ── FALLBACK ── */
#fallback {
  position: relative;
  margin: clamp(8px, 1.2vh, 14px) 0 0;
  font-size: clamp(0.72rem, 1.8vw, 0.8rem);
  color: var(--ink-3);
  line-height: 1.55;
  word-break: break-word;
}
#fallback a {
  color: var(--theme-accent, var(--accent));
  font-weight: 600;
  text-underline-offset: 3px;
  word-break: break-all;
}

/* ── ANIMATIONS ── */
@keyframes tick {
  0%   { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
@keyframes text-shimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

#timer.tick { animation: tick 0.35s var(--ease-spring); }

#progressBar {
  background-size: 200% auto;
  animation: shimmer 1.8s linear infinite;
}

.redirect-card h1 {
  letter-spacing: 0;
  background: linear-gradient(
    90deg,
    var(--ink) 0%,
    var(--theme-accent, var(--accent)) 35%,
    var(--ink) 50%,
    var(--theme-accent, var(--accent)) 65%,
    var(--ink) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 8s linear infinite;
}

/* ── RESPONSIVE ── */
@media (max-width: 390px) {
  .redirect-page { padding: 12px; }
  .redirect-card { padding: 16px 14px 14px; }
}
@media (max-width: 480px) {
  .redirect-page { padding: 16px; }
  .redirect-card { padding: 20px 16px 16px; }
}
@media (max-height: 600px) {
  .redirect-gif { width: clamp(80px, 25vmin, 140px); height: clamp(80px, 25vmin, 140px); }
  .redirect-page { padding: 10px 20px; }
  .redirect-card { padding: 14px 20px 12px; }
  .redirect-card h1 { font-size: clamp(1.1rem, 3.5vw, 1.5rem); }
  .redirect-subtitle { display: none; }
}
@media (min-height: 601px) and (max-height: 700px) {
  .redirect-gif { width: clamp(100px, 28vmin, 160px); height: clamp(100px, 28vmin, 160px); }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  #progressBar { transition: none; animation: none; }
  #goNowBtn { transition: none; }
  #timer.tick { animation: none; }
  body.page-exit { transition: none; }
  body.page-exit .redirect-gif { animation: none; }
  .btn-spinner { animation: none; }
  .redirect-card h1 { animation: none; }
}

/* ── Landing-style unification for redirect and survey states ── */
body.theme-educators,
body.theme-parents,
body.theme-video {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--accent) 5.5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--accent) 5.5%, transparent) 1px, transparent 1px),
    var(--noise);
  background-size: 48px 48px, 48px 48px, 200px 200px;
}

.redirect-card,
.redirect-status,
.closed-status,
.closed-home-btn,
#goNowBtn,
.inapp-prompt,
.origin-disclosure {
  border-radius: 3px;
}

.redirect-card {
  background: var(--surface);
  box-shadow: 0 18px 60px color-mix(in srgb, var(--accent) 10%, transparent);
}

.redirect-card h1,
.closed-title {
  font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  letter-spacing: 0;
}

/* ── FIXED FOOTER FOR SURVEY & REDIRECT PAGES ── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  z-index: 10;
}

/* Ensure content has padding at bottom to prevent overlap with fixed footer */
.redirect-page {
  padding-bottom: clamp(80px, 12vh, 100px);
}
