/* Full LOOP lander stylesheet — deferred via <link>.
 * Critical above-fold rules are inlined in views/lander.html.ts and the thx
 * templates. This file complements the inline block: design tokens, hover
 * states, spinner, accessibility, and complementary thx page rules. We do
 * not re-declare what is already inlined.
 *
 * Source of truth for sizes/colors: PRPs/ai_docs/visual_design_spec.md and
 * Old_code/active_lander_dn-ec-1727/screenshots/computed-styles-desktop.json.
 *
 * Budget: <= 8 KB gzipped. No @import. Roboto is preloaded by the HTML head.
 */

:root {
  --color-page-bg: #f0f4ff;
  --color-card-bg: #ffffff;
  --color-headline: #333333;
  --color-body: #000000;
  --color-muted: #999999;
  --color-cta-bg: #03b70c;
  --color-cta-bg-hover: #029a0a;
  --color-cta-border: #079813;
  --color-cta-text: #ffffff;
  --color-input-border: #dddddd;
  --color-input-border-focus: #03b70c;
  --color-input-border-error: #dc3545;
  --color-input-border-valid: #03b70c;
  --color-loading: #03b70c;
  --color-news-alert: #d92027;
  --color-thx-green: #0a7d10;
  --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-cta-focus: 0 0 0 0.2rem rgba(3, 183, 12, 0.25);
  --radius-card-top: 15px;
  --radius-input: 8px;
  --radius-cta: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --bp-mobile: 767.98px;
  --bp-desktop: 1200px;
  --font-stack: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Reset font on form controls so inputs inherit Roboto, not the legacy Arial
 * fallback the screenshots show (computed-styles-desktop.json:116 confirms). */
input,
select,
textarea,
button {
  font-family: var(--font-stack);
}

a {
  color: inherit;
  transition: color 0.15s ease, background-color 0.15s ease;
}

img {
  max-width: 100%;
  height: auto;
}

/* Lander layout: complement the inline block. */
.content-wrapper {
  width: 100%;
}

/* Validation states for the form-control inputs. The inline block sets the
 * default 2px solid #ddd border + green focus. Here we add error/valid states
 * driven by `aria-invalid` for accessibility-first UX. */
.form-control[aria-invalid="true"],
.form-control.is-invalid {
  border-color: var(--color-input-border-error);
}

.form-control[aria-invalid="true"]:focus,
.form-control.is-invalid:focus {
  border-color: var(--color-input-border-error);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2);
}

.form-control.is-valid {
  border-color: var(--color-input-border-valid);
}

.form-control:disabled,
.form-control[readonly] {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* Submit button hover/active/focus.
 * IMPORTANT: legacy CSS (Old_code/.../style.css:84-88) flipped the CTA from
 * green to light blue (#60a5fa) on hover — almost certainly a bug. The
 * rebuild keeps the CTA green and goes a shade darker on hover. */
.btn-primary {
  transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-cta-bg-hover) !important;
  color: var(--color-cta-text);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-cta-focus);
}

.btn-primary:active {
  transform: scale(0.99);
}

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

/* Loading state container shown during async submit. */
#loading {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

#loading[hidden] {
  display: none;
}

#loading.visible {
  display: block;
}

#loading p {
  font-size: 16px;
  color: var(--color-headline);
  margin: 0;
}

.spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-loading);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Inline error message rendered below an input by the client when xverify
 * flags an email or phone as invalid. */
.field-error {
  display: block;
  margin-top: -16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--color-input-border-error);
}

/* ----------------------------------------------------------------------- */
/* Thx page (qualified) — urgency banner + countdown + agent count.        */
/* The inline critical block in views/thx_qualified.html.ts already covers */
/* layout. Here we add hover/animation polish + .urgency-banner alias.     */
/* ----------------------------------------------------------------------- */

.urgency-banner,
.news-alert {
  background: var(--color-news-alert);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 8px 16px;
}

.urgency-banner {
  animation: pulse-bg 2.4s ease-in-out infinite;
}

@keyframes pulse-bg {
  0%,
  100% {
    background-color: var(--color-news-alert);
  }
  50% {
    background-color: #b8181f;
  }
}

.btnContainer a.btn,
.phone-btn {
  display: inline-block;
  background: var(--color-thx-green);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  padding: 18px 28px;
  border-radius: 10px;
  text-decoration: none;
  letter-spacing: 1px;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.btnContainer a.btn:hover,
.btnContainer a.btn:focus,
.phone-btn:hover,
.phone-btn:focus {
  background-color: #086208;
  color: #fff;
  outline: none;
}

.btnContainer a.btn:active,
.phone-btn:active {
  transform: scale(0.98);
}

.countdown,
#countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-news-alert);
}

.agent-count,
#agentCount {
  font-weight: 700;
  color: var(--color-thx-green);
}

.agents-status,
.timer-status {
  font-size: 16px;
  margin: 6px 0;
}

/* Thx (standard) soft-cta polish. */
.soft-cta:hover,
.soft-cta:focus {
  text-decoration: underline;
  outline: none;
}

/* ----------------------------------------------------------------------- */
/* Tablet / mid-width: the lander card stays at its desktop max but breath */
/* a little less. Inline block covers <=767.98px; this targets the gap.    */
/* ----------------------------------------------------------------------- */

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
  .agents-status,
  .timer-status {
    font-size: 18px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 720px;
  }
  h2 {
    font-size: 30px;
  }
}

/* ----------------------------------------------------------------------- */
/* Accessibility: prefers-reduced-motion + visible focus.                  */
/* ----------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .spinner {
    animation: none;
  }
  .urgency-banner {
    animation: none;
  }
}

a:focus-visible,
button:focus-visible,
.form-control:focus-visible {
  outline: 2px solid var(--color-cta-bg);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------------- */
/* Print: hide interactive bits, keep readable text.                       */
/* ----------------------------------------------------------------------- */

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .urgency-banner,
  .news-alert,
  .cf-turnstile,
  .btn,
  .phone-btn {
    display: none !important;
  }
  #debt-form {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
