/*
 * Preview-only TechMy theme for the future security challenge page.
 * Brand values are CSS variables so each protected storefront can reuse the
 * same interaction and accessibility contract while changing only its skin.
 */
:root {
  --brand: #9d001a;
  --brand-dark: #760014;
  --brand-soft: #f8eef0;
  --ink: #29272a;
  --muted: #6c686b;
  --line: #e9e5e6;
  --surface: #ffffff;
  --page: #f7f6f5;
  --success: #24855d;
  --danger: #b53b43;
  --shadow: 0 24px 70px rgba(38, 24, 28, 0.08), 0 2px 8px rgba(38, 24, 28, 0.04);
  font-family: Montserrat, "Noto Sans", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 50% 20%, rgba(157, 0, 26, 0.045), transparent 33rem),
    var(--page);
}

button,
a {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-header {
  display: flex;
  justify-content: center;
  padding: 32px 24px 12px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 154px;
  height: 58px;
  overflow: hidden;
  background: var(--brand);
}

.brand-mark img {
  display: block;
  width: 124px;
  height: auto;
}

.brand-caption {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.challenge {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 28px 24px 48px;
}

.challenge-card {
  position: relative;
  width: min(100%, 620px);
  padding: 52px 60px 46px;
  overflow: hidden;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(232, 227, 229, 0.92);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.challenge-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--brand-dark), #bf1b36 55%, var(--brand));
}

.status-visual {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 28px;
  color: var(--brand);
}

.status-ring {
  display: block;
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.status-ring circle {
  fill: none;
  stroke-width: 3;
}

.status-ring-track {
  stroke: #eee9ea;
}

.status-ring-progress {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-dasharray: 112 195;
  animation: ring-spin 1.25s linear infinite;
}

.status-icon {
  position: absolute;
  inset: 22px;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-icon-alert {
  display: none;
}

.eyebrow {
  margin: 0 0 11px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(27px, 4.5vw, 38px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.lead {
  max-width: 460px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.verification-progress {
  width: min(100%, 360px);
  margin: 32px auto 0;
}

.progress-line {
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: #ede9ea;
  border-radius: 999px;
}

.progress-line-value {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-dark), #c82a43);
  border-radius: inherit;
  animation: progress-slide 1.55s ease-in-out infinite;
}

.progress-label {
  display: block;
  margin-top: 12px;
  color: #817d80;
  font-size: 12px;
}

.captcha-slot,
.actions {
  width: min(100%, 390px);
  margin: 30px auto 0;
}

.captcha-placeholder {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: 16px 18px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: #fbfafa;
  border: 1px solid #ddd8da;
  border-radius: 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.captcha-placeholder:hover {
  border-color: #c3babc;
  box-shadow: 0 7px 22px rgba(38, 24, 28, 0.07);
  transform: translateY(-1px);
}

.captcha-placeholder:focus-visible,
.button:focus-visible,
.preview-button:focus-visible {
  outline: 3px solid rgba(157, 0, 26, 0.24);
  outline-offset: 3px;
}

.placeholder-check {
  width: 27px;
  height: 27px;
  margin-right: 14px;
  background: var(--surface);
  border: 2px solid #aaa4a6;
  border-radius: 5px;
}

.placeholder-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.placeholder-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.placeholder-copy small {
  color: var(--muted);
  font-size: 10px;
}

.placeholder-shield {
  width: 27px;
  height: 27px;
  margin-left: 14px;
  color: var(--brand);
}

.placeholder-shield svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
}

.button {
  min-height: 46px;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  border: 0;
  border-radius: 7px;
}

.button-primary {
  color: #fff;
  background: var(--brand);
}

.button-primary:hover {
  background: var(--brand-dark);
}

.support-note {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.noscript-message {
  margin-top: 24px;
  padding: 12px 14px;
  color: #783d20;
  font-size: 12px;
  line-height: 1.5;
  background: #fff4e8;
  border-radius: 8px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  padding: 16px 24px 24px;
  color: #8b8789;
  font-size: 10px;
  letter-spacing: 0.035em;
}

.footer-separator {
  width: 3px;
  height: 3px;
  background: #b9b4b6;
  border-radius: 50%;
}

/* The visible preview switcher is intentionally omitted unless ?preview=1. */
.preview-controls {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: calc(100vw - 36px);
  padding: 7px;
  background: rgba(35, 32, 34, 0.93);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.preview-button {
  min-height: 31px;
  padding: 0 10px;
  color: #eee;
  font-size: 10px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.preview-button:hover,
.preview-button[aria-pressed="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* State classes are the only UI contract the future validator needs to drive. */
.state-challenge .status-ring-progress {
  animation-duration: 2.2s;
}

.state-challenge .verification-progress {
  display: none;
}

.state-success .status-visual {
  color: var(--success);
}

.state-success .status-ring-progress {
  stroke-dasharray: 195 195;
  animation: none;
}

.state-success .progress-line-value {
  width: 100%;
  background: var(--success);
  animation: none;
}

.state-error .status-visual {
  color: var(--danger);
}

.state-error .status-ring-progress {
  stroke-dasharray: 195 195;
  animation: none;
}

.state-error .status-icon-shield {
  display: none;
}

.state-error .status-icon-alert {
  display: block;
}

.state-error .verification-progress {
  display: none;
}

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

@keyframes progress-slide {
  0% {
    transform: translateX(-105%);
  }
  55%,
  100% {
    transform: translateX(245%);
  }
}

@media (max-width: 620px) {
  body {
    background: var(--surface);
  }

  .site-header {
    padding-top: 25px;
  }

  .brand-mark {
    width: 137px;
    height: 52px;
  }

  .brand-mark img {
    width: 110px;
  }

  .brand-caption {
    font-size: 9px;
  }

  .challenge {
    align-items: start;
    padding: 32px 21px 36px;
  }

  .challenge-card {
    padding: 34px 4px 28px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .challenge-card::before {
    display: none;
  }

  .status-visual {
    margin-bottom: 24px;
  }

  h1 {
    font-size: 29px;
  }

  .lead {
    max-width: 340px;
    font-size: 14px;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .footer-separator {
    display: none;
  }

  .preview-controls {
    right: 50%;
    bottom: 10px;
    width: max-content;
    transform: translateX(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
