/* Nationwide Pardons — Eligibility Checker LP
   Single-viewport frame: no page scroll */

:root {
  --red: #b4232c;
  --red-dark: #8f1a22;
  --red-soft: #f8e9ea;
  --charcoal: #1c1c1c;
  --charcoal-2: #2a2a2a;
  --grey-100: #f5f5f5;
  --grey-200: #e8e8e8;
  --grey-600: #5c5c5c;
  --white: #ffffff;
  --font-sans: "Source Sans 3", system-ui, -apple-system, sans-serif;
  --font-serif: "Libre Baskerville", Georgia, serif;
  --radius: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  color: var(--charcoal);
  background: #1a1214;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--red);
}

.app {
  position: relative;
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  background: #0e1012;
  color: var(--white);
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}

/* —— Canadian mountains background —— */
.bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.04);
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(8, 10, 12, 0.72) 0%,
      rgba(10, 10, 12, 0.78) 40%,
      rgba(8, 8, 10, 0.9) 100%
    ),
    linear-gradient(
      105deg,
      rgba(6, 6, 8, 0.55) 0%,
      rgba(6, 6, 8, 0.35) 50%,
      rgba(6, 6, 8, 0.5) 100%
    );
}

.bg-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 28px 28px;
}

.topbar,
.trust,
.stage,
.foot {
  position: relative;
  z-index: 1;
}

/* —— Header —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem max(1.25rem, env(safe-area-inset-right)) 0.65rem max(1.25rem, env(safe-area-inset-left));
  border-bottom: 1px solid var(--grey-200);
  background: var(--white);
  color: var(--charcoal);
  min-height: 52px;
}

.topbar-inner {
  width: min(100%, 680px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--charcoal);
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: auto;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--charcoal);
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--grey-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--white);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  background: var(--red);
  transition: background 0.15s ease;
}

.phone:hover {
  background: var(--red-dark);
  color: var(--white);
}

.phone-icon {
  flex-shrink: 0;
}

/* —— Trust —— */
.trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.45rem;
  padding: 0.45rem max(1.5rem, env(safe-area-inset-right)) 0.45rem max(1.5rem, env(safe-area-inset-left));
  font-size: 0.75rem;
  color: var(--charcoal);
  border-bottom: 1px solid var(--grey-200);
  background: var(--white);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stars {
  color: #f5b301;
  letter-spacing: -0.05em;
  font-size: 0.7rem;
}

.trust-sep {
  color: var(--grey-600);
  opacity: 0.7;
}

/* —— Stage / panels —— */
.stage {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem 0.5rem;
}

.panel {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  max-width: 560px;
  width: 100%;
  margin-inline: auto;
  animation: panelIn 0.22s ease;
}

.panel.is-active {
  display: flex;
}

.panel[hidden] {
  display: none !important;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8a0a4;
}

.display {
  margin: 0 0 0.45rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  line-height: 1.2;
  color: var(--white);
}

.display-sm {
  font-size: clamp(1.25rem, 3.5vw, 1.65rem);
}

.lede {
  margin: 0 0 0.85rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.lede-tight {
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
}

.benefits {
  margin: 0 auto 0.85rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 0.85rem;
  max-width: 36rem;
}

.benefits li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  white-space: nowrap;
}

.benefit-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  border: 1px solid #d45a60;
  color: #fff;
}

.benefit-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.micro {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.micro a {
  color: #f0c4c6;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  width: 100%;
}

.btn-primary:hover {
  background: var(--red-dark);
  color: var(--white);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-back {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0;
  min-height: 40px;
  text-align: left;
}

.btn-back:hover {
  color: var(--white);
}

.btn-back[hidden] {
  display: none;
}

/* —— Quiz —— */
.progress-row {
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.progress {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--red);
  border-radius: inherit;
  transition: width 0.28s ease;
}

.progress-label {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.quiz-body {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.question {
  margin: 0 0 0.7rem;
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--white);
  flex-shrink: 0;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  flex: 0 1 auto;
  min-height: 0;
  align-content: start;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  text-align: left;
  color: var(--charcoal);
}

.choice:hover {
  border-color: #cfcfcf;
  background: #fafafa;
}

.choice.is-selected {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--red);
}

.choice.is-selected .choice-icon {
  color: var(--white);
}

.choice-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.choice-label {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.25;
}

.choice--wide {
  grid-column: 1 / -1;
}

.quiz-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  flex-shrink: 0;
}

.quiz-actions .btn-primary {
  width: 100%;
  order: 1;
}

.quiz-actions .btn-back {
  order: 2;
  text-align: center;
  width: 100%;
}

.quiz-actions--inline {
  margin-top: 0.85rem;
}

/* Province select */
.field-wrap {
  margin-top: 0.15rem;
}

.field-wrap[hidden] {
  display: none !important;
}

.field-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.select,
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  color: var(--charcoal);
}

.select:focus,
.field input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.form-error {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #b42318;
}

.field--recaptcha {
  margin-top: 0.5rem;
}

.field input.is-invalid {
  border-color: var(--red);
  outline: 2px solid var(--red-soft);
}

/* —— Result —— */
.result-note {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.result-note[hidden] {
  display: none !important;
}

.panel--result {
  text-align: center;
  justify-content: center;
}

.result-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(180, 35, 44, 0.18);
  border: 1px solid rgba(180, 35, 44, 0.45);
  color: #f0c4c6;
}

.result-icon svg {
  width: 28px;
  height: 28px;
}

.result-confirm {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.panel--result .btn-primary {
  margin-top: 0.15rem;
}

.panel--result .result-note {
  text-align: left;
}

/* —— Contact —— */
.panel--contact {
  justify-content: flex-start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  margin-top: 0.35rem;
}

.fields {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.field input {
  font-size: 1rem;
}

[data-panel="contact"] .quiz-actions {
  margin-top: 0.85rem;
}

[data-panel="contact"] .lede-tight {
  margin-bottom: 0.35rem;
}

.panel--cover {
  text-align: center;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.35rem;
  padding-bottom: 0.5rem;
}

.panel--cover .cover-copy {
  width: 100%;
  flex-shrink: 0;
}

.panel--cover .lede {
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.panel--cover .team-card {
  width: min(100%, 640px);
  max-width: 640px;
  max-height: none;
  height: auto;
  flex: 0 0 auto;
  margin-top: 0.75rem;
  align-self: center;
}

.panel--cover .team-photo {
  width: 100%;
  height: auto;
  max-height: none;
  min-height: 0;
  object-fit: fill;
  flex: none;
  display: block;
}

.panel--cover .btn-primary {
  margin-top: 0.15rem;
  flex-shrink: 0;
  max-width: 420px;
}

.panel--cover .micro--cover-phone {
  width: 100%;
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

@media (min-height: 780px) {
  .panel--cover {
    padding-top: 0.5rem;
  }
}

/* —— Team photo —— */
.team-card {
  margin: 0.55rem 0 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.25);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 12px 32px rgba(0, 0, 0, 0.45);
  flex-shrink: 1;
  min-height: 0;
  max-height: 28vh;
  display: flex;
  flex-direction: column;
}

.team-photo {
  width: 100%;
  height: 100%;
  min-height: 72px;
  max-height: 22vh;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.team-caption {
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(8, 10, 12, 0.72);
  flex-shrink: 0;
}

.team-card--compact {
  max-height: none;
  width: 88px;
  height: 64px;
  flex-shrink: 0;
  margin: 0;
}

.team-card--compact .team-photo {
  max-height: none;
  height: 64px;
  min-height: 64px;
  object-position: center 25%;
}

.contact-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
}

.contact-head .lede-tight {
  margin-bottom: 0;
}

/* —— Footer —— */
.foot {
  padding: 0.4rem 1rem 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 12, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.disclaimer {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}

/* —— Compact heights —— */
@media (max-height: 700px) {
  .topbar {
    min-height: 46px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
  }

  .brand-logo {
    width: 34px;
  }

  .brand-sub {
    display: none;
  }

  .trust {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.7rem;
  }

  .stage {
    padding: 0.6rem 0.85rem 0.35rem;
  }

  .display {
    font-size: clamp(1.25rem, 3.8vw, 1.7rem);
  }

  .benefits {
    margin-bottom: 0.45rem;
    gap: 0.3rem;
  }

  .benefits li {
    font-size: 0.82rem;
  }

  .benefit-icon {
    width: 30px;
    height: 30px;
  }

  .benefit-icon svg {
    width: 16px;
    height: 16px;
  }

  .panel--cover .team-card {
    margin-top: 0.45rem;
    max-height: none;
  }

  .panel--cover .team-photo {
    max-height: none;
    object-fit: contain;
  }

  .choice {
    min-height: 42px;
    padding: 0.4rem 0.6rem;
  }

  .choice span {
    font-size: 0.82rem;
  }

  .btn {
    min-height: 44px;
  }

  .disclaimer {
    font-size: 0.58rem;
  }
}

@media (max-width: 420px) {
  .benefits {
    gap: 0.4rem 0.7rem;
  }

  .benefits li {
    font-size: 0.78rem;
    gap: 0.35rem;
  }

  .phone-num {
    font-size: 0.82rem;
  }

  .trust-sep:nth-of-type(2),
  .trust-item:last-child {
    /* keep all if possible; wrap is fine within trust row */
  }

  .choices {
    gap: 0.35rem;
  }
}

@media (min-width: 720px) {
  .topbar,
  .trust {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
  }

  .stage {
    padding-top: 1.1rem;
  }

  .choices {
    gap: 0.55rem;
  }

  .choice {
    min-height: 52px;
  }
}
