/* Page-specific layout. All colours/radii/shadows come from theme.css tokens. */

/* ---------- Background: animated grid + glows ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.bg-glow {
  position: fixed;
  z-index: -1;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.bg-glow--blue {
  top: -30vmax;
  left: -25vmax;
  background: radial-gradient(circle, rgba(0, 63, 138, 0.1), transparent 65%);
}
.bg-glow--green {
  bottom: -35vmax;
  right: -25vmax;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.07), transparent 65%);
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-nav);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: clamp(64px, 3vw + 52px, 84px);
  padding: 0 var(--gutter);         /* equal distance from left and right edges */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-logo {
  height: clamp(32px, 1.5vw + 26px, 50px);
  width: auto;
  display: block;
  flex-shrink: 0;
}
.nav-date {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}
.nav-date .icon-tile { width: 40px; height: 40px; }
.nav-date-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}
.nav-day {
  font-family: var(--f-head);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--c-primary);
  font-size: clamp(0.9rem, 0.4vw + 0.8rem, 1.1rem);
}
.nav-fulldate {
  font-size: clamp(0.72rem, 0.2vw + 0.68rem, 0.85rem);
  color: var(--c-subtle);
  font-weight: 500;
}

/* ---------- Main ---------- */
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) clamp(4.5rem, 8vw, 6.5rem);
}

.hero {
  max-width: 760px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  text-align: center;
}
.hero .badge { margin-bottom: 1.25rem; }
.hero .page-title { margin-bottom: 1rem; }
.hero-sub {
  color: var(--c-muted);
  font-size: clamp(0.95rem, 0.3vw + 0.9rem, 1.1rem);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Form ---------- */
.form-card {
  max-width: 720px;
  margin: 0 auto;
}
.form-card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.form-card-head h2 { font-size: 1.25rem; font-weight: 700; }
.form-card-head p { color: var(--c-muted); font-size: 0.88rem; line-height: 1.5; }
.req { color: var(--c-red); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.25rem;
}
.field { margin-bottom: 1.1rem; }
.field--full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 0.5rem; }
.error-msg {
  display: block;
  min-height: 1.2em;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--c-red);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.form-note { font-size: 0.8rem; color: var(--c-subtle); }

/* ---------- Toast (red popup) ---------- */
.toast {
  position: fixed;
  top: 96px;
  left: 50%;
  z-index: 100;
  width: max-content;
  max-width: calc(100% - 32px);
  background-color: var(--c-white);
  box-shadow: var(--sh-card-hover);
  opacity: 0;
  transform: translate(-50%, -20px);
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Success modal ---------- */
.modal-card { text-align: center; }
.modal-card .icon-tile { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: var(--r-md); }
.modal-card .icon-tile svg { width: 24px; height: 24px; }
.modal-card h2 { font-size: clamp(1.4rem, 2vw + 1rem, 1.75rem); margin-bottom: 0.4rem; }
.modal-card > p { color: var(--c-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.modal-card .table-wrap { margin-bottom: 1.75rem; text-align: left; }
.modal-card .table th { width: 36%; }

/* Redirect bar */
.redirect { text-align: left; }
.redirect-text {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--c-muted);
  line-height: 1.4;
}
.redirect-text strong { color: var(--c-primary); font-weight: 600; }
.redirect-count { flex-shrink: 0; font-weight: 600; color: var(--c-subtle); font-variant-numeric: tabular-nums; }
.redirect-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--tint-blue-bg);
  overflow: hidden;
}
.redirect-bar {
  height: 100%;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .form-actions .btn { width: 100%; }
  .nav-date .icon-tile { display: none; }
  .toast { top: 80px; }
}
