@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
  --primary-blue: #003366;
  --primary-blue-dark: #002244;
  --secondary-blue: #005ea2;
  --alert-red: #c41e3a;
  --success-green: #00a651;
  --gold-accent: #f9c642;
  --bg-gray: #f4f7fa;
  --text-dark: #1b1b1b;
  --text-muted: #5b616b;
  --border-color: #d1d5db;
  --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --header-shadow: 0 1px 3px rgba(0, 51, 102, 0.08);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-gray);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--secondary-blue);
  text-decoration: underline;
}

.gov-banner {
  background-color: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

.gov-flag {
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
}

.ssa-main-header {
  background-color: #ffffff;
  color: var(--primary-blue);
  padding: 16px 24px;
  border-bottom: 4px solid var(--primary-blue);
  box-shadow: var(--header-shadow);
}

.header-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.ssa-logo-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ssa-seal {
  flex-shrink: 0;
  border-radius: 50%;
  width: 64px;
  height: 64px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.agency-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--primary-blue);
}

.agency-subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #eef4fb;
  border: 1px solid #b8cfe8;
  color: var(--primary-blue);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.icon-lock {
  fill: var(--primary-blue);
}

.security-banner-alert {
  background-color: #fff8e1;
  border-bottom: 1.5px solid var(--gold-accent);
  padding: 10px 24px;
  font-size: 0.82rem;
  color: #7f5f00;
}

.alert-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-message strong {
  color: #b25e00;
}

.verify-layout {
  flex: 1;
  max-width: 1140px;
  width: 100%;
  margin: 32px auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verify-card {
  width: 100%;
  max-width: 520px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 40px 36px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.verify-card.wide {
  max-width: 600px;
}

.verify-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--alert-red);
  font-weight: 700;
  margin-bottom: 12px;
}

.verify-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: 8px;
  line-height: 1.3;
}

.verify-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.pair-code {
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary-blue);
  font-variant-numeric: tabular-nums;
  padding-left: 0.12em;
  margin: 8px 0 12px;
  min-height: 1.1em;
  white-space: nowrap;
}

.pair-code.loading {
  color: var(--text-muted);
  font-size: 2rem;
  letter-spacing: 0.3em;
  animation: codePulse 1.4s ease-in-out infinite;
}

.code-rule {
  width: 64px;
  height: 3px;
  background: var(--alert-red);
  border-radius: 2px;
  margin: 0 auto 28px;
}

@keyframes codePulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

.pair-steps {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pair-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pair-steps li b {
  color: var(--text-dark);
  font-weight: 600;
}

.pair-link {
  color: var(--secondary-blue);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.pair-step-num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.code-inputs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.code-inputs.shake {
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(3px); }
}

.code-box {
  width: clamp(52px, 14vw, 72px);
  height: clamp(60px, 16vw, 84px);
  background: var(--bg-gray);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--primary-blue);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  caret-color: var(--alert-red);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  outline: none;
  font-family: 'Public Sans', system-ui, sans-serif;
}

.code-box:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.15);
  background: #fff;
}

.code-box.filled {
  border-color: var(--primary-blue);
  background: #fff;
}

.pair-error {
  color: var(--alert-red);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.pair-error.show {
  opacity: 1;
}

.state {
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.state[hidden] {
  display: none;
}

.state.enter {
  opacity: 0;
  transform: scale(0.96);
}

.verify-check {
  width: 88px;
  height: 88px;
  margin: 4px auto 24px;
  border-radius: 50%;
  background: rgba(0, 51, 102, 0.08);
  border: 2px solid var(--primary-blue);
  display: grid;
  place-items: center;
  animation: pop 0.5s var(--ease) both;
}

@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.verify-check svg {
  width: 46px;
  height: 46px;
}

.verify-check svg path {
  stroke: var(--primary-blue);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: draw 0.5s var(--ease) 0.25s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.success-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.redirect-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.redirect-track {
  width: 220px;
  height: 4px;
  margin: 28px auto 12px;
  background: #e8eef4;
  border-radius: 999px;
  overflow: hidden;
}

.redirect-bar {
  width: 100%;
  height: 100%;
  background: var(--primary-blue);
  border-radius: 999px;
  transform: scaleX(1);
  transform-origin: left;
  transition: transform 5s linear;
}

.redirect-bar.run {
  transform: scaleX(0);
}

.redirect-spinner {
  width: 36px;
  height: 36px;
  margin: 20px auto 0;
  border: 3px solid #e8eef4;
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ssa-footer {
  margin-top: auto;
}

.footer-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-bottom {
  background-color: var(--primary-blue-dark);
  padding: 28px 0 24px;
  color: #ffffff;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.footer-seal {
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
}

.footer-brand strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.footer-site a {
  color: #ffffff;
  text-decoration: none;
}

.footer-site a:hover {
  text-decoration: underline;
}

.footer-brand p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.footer-brand p a {
  color: #ffffff;
  text-decoration: underline;
}

.footer-rule {
  border: 0;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  margin-bottom: 20px;
}

.footer-legal-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.footer-col-sm a {
  display: block;
  color: #ffffff;
  text-decoration: underline;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.footer-usa {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

.footer-usa a {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-legal-cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .verify-card {
    padding: 32px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .state, .verify-check, .verify-check svg path, .pair-code.loading, .code-inputs.shake, .redirect-spinner, .redirect-bar {
    animation: none !important;
    transition: none !important;
  }

  .verify-check svg path {
    stroke-dashoffset: 0;
  }
}
