/* ============================================================
   FRATIUM — Warranty Activation Page
   Mobile-first · Premium Dark · ORBIX Red
   ============================================================ */

/* ── Design Tokens (aligned with main site) ─────────────────── */
:root {
  --clr-bg:        #030305;
  --clr-bg-2:      #07070b;
  --clr-bg-3:      #0c0c12;
  --clr-surface:   #111118;
  --clr-surface-2: #17171f;

  --clr-border:    rgba(255,255,255,0.06);
  --clr-border-h:  rgba(255,255,255,0.11);

  --clr-text:   #f0ede8;
  --clr-text-2: rgba(240,237,232,0.55);
  --clr-text-3: rgba(240,237,232,0.28);

  --clr-red:        #e52222;
  --clr-red-bright: #ff3838;
  --clr-red-dim:    rgba(229,34,34,0.12);
  --clr-red-glow:   rgba(229,34,34,0.06);
  --clr-silver:     #a8aba9;

  --font-head: 'Brink', 'Barlow Condensed', sans-serif;
  --font-body: 'DM Sans', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --r:     8px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --r-full:9999px;

  --dur-base: 280ms;
  --dur-slow: 450ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --shadow-card: 0 1px 0 rgba(255,255,255,0.03), 0 24px 64px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(229,34,34,0.2), 0 0 80px rgba(229,34,34,0.08);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--clr-red); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(229,34,34,.25); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ── Noise overlay ───────────────────────────────────────────── */
.noise {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ── Layout ──────────────────────────────────────────────────── */
.wpage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 48px;
  position: relative;
}

/* Ambient glow */
.wpage::before {
  content: '';
  position: fixed;
  top: -200px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229,34,34,0.08) 0%, transparent 65%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.wcontainer {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

/* ── Header ──────────────────────────────────────────────────── */
.whead {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0 32px;
  gap: 12px;
}

.whead__logo {
  height: 22px;
  width: auto;
  color: var(--clr-text);
  transition: opacity var(--dur-base);
  opacity: 0.9;
}
.whead__logo:hover { opacity: 0.65; }

.whead__product {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clr-red);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.whead__product::before,
.whead__product::after {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--clr-red);
  opacity: 0.4;
}

/* ── VIEWS system ────────────────────────────────────────────── */
.wview {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.wview.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.wview.visible {
  opacity: 1;
  transform: none;
}

/* ── Landing Card ────────────────────────────────────────────── */
.wcard {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: 36px 28px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.wcard::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229,34,34,0.4), transparent);
}

/* ── Product hero image ───────────────────────────────────── */
.wproduct-hero {
  margin: -36px -28px 0;
  position: relative;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  overflow: hidden;
}
.wproduct-hero__img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.wproduct-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--clr-surface));
  pointer-events: none;
}

.wproduct-visual {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--clr-bg-3);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  margin-bottom: 4px;
}

.wproduct-visual__orb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(229,34,34,0.3), var(--clr-bg-3));
  border: 1px solid rgba(229,34,34,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(229,34,34,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: orbPulse 4s ease-in-out infinite;
}
@keyframes orbPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(229,34,34,0.12), inset 0 1px 0 rgba(255,255,255,0.06); }
  50%       { box-shadow: 0 0 40px rgba(229,34,34,0.25), inset 0 1px 0 rgba(255,255,255,0.08); }
}

.wproduct-visual__orb svg {
  width: 32px;
  height: 32px;
  color: var(--clr-red);
  opacity: 0.8;
}

.wproduct-visual__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wproduct-visual__name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--clr-text), var(--clr-red-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wproduct-visual__sku {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--clr-text-3);
  letter-spacing: 0.08em;
}
.wproduct-visual__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  padding: 3px 10px;
  background: rgba(229,34,34,0.08);
  border: 1px solid rgba(229,34,34,0.2);
  border-radius: var(--r-full);
  font-size: 10px;
  color: var(--clr-red-bright);
  letter-spacing: 0.12em;
  font-weight: 500;
  text-transform: uppercase;
  width: fit-content;
}
.wproduct-visual__badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--clr-red-bright);
  animation: dotBlink 2.5s ease-in-out infinite;
}
@keyframes dotBlink {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; box-shadow: 0 0 8px var(--clr-red); }
}

/* ── Heading ─────────────────────────────────────────────────── */
.wtitle {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 5.5vw, 2.1rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--clr-text);
  margin-bottom: 8px;
}
.wtitle strong {
  color: var(--clr-red-bright);
  font-weight: 900;
}

.wsub {
  font-size: 0.9rem;
  color: var(--clr-text-2);
  line-height: 1.7;
  margin-bottom: 4px;
}

/* ── Legal notice ────────────────────────────────────────────── */
.wlegal-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  font-size: 0.78rem;
  color: var(--clr-text-3);
  line-height: 1.6;
}
.wlegal-note svg {
  width: 14px;
  height: 14px;
  color: var(--clr-silver);
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.5;
}

/* ── Trust badges ────────────────────────────────────────────── */
.wtrust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.wtrust__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--clr-text-3);
  letter-spacing: 0.08em;
}
.wtrust__item svg {
  width: 14px; height: 14px;
  color: var(--clr-red);
  opacity: 0.7;
}

/* ── Primary button ──────────────────────────────────────────── */
.wbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  min-height: 52px;
  position: relative;
  overflow: hidden;
}
.wbtn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: none;
}
.wbtn:hover::before { left: 100%; transition: left 0.55s var(--ease-out); }

.wbtn--primary {
  background: linear-gradient(135deg, var(--clr-red), #c91b1b);
  color: #fff;
  box-shadow: 0 4px 24px rgba(229,34,34,0.25), inset 0 1px 0 rgba(255,255,255,.1);
}
.wbtn--primary:hover {
  background: linear-gradient(135deg, var(--clr-red-bright), var(--clr-red));
  box-shadow: 0 8px 40px rgba(229,34,34,0.4), 0 2px 12px rgba(229,34,34,0.3), inset 0 1px 0 rgba(255,255,255,.15);
  transform: translateY(-2px);
}
.wbtn--primary:active { transform: translateY(0) scale(0.98); }
.wbtn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.wbtn--ghost {
  background: transparent;
  color: var(--clr-text-2);
  border: 1px solid var(--clr-border);
  font-size: 0.8rem;
  padding: 12px 24px;
  min-height: 44px;
}
.wbtn--ghost:hover {
  border-color: var(--clr-border-h);
  color: var(--clr-text);
  background: rgba(255,255,255,0.03);
}

.wbtn__spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.wbtn.loading .wbtn__spinner { display: block; }
.wbtn.loading .wbtn__label { opacity: 0.7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form ────────────────────────────────────────────────────── */
.wform {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wfield {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.wfield__label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-text-2);
}
.wfield__label span {
  color: var(--clr-red);
  margin-left: 2px;
}

.wfield__input,
.wfield__select {
  width: 100%;
  padding: 13px 16px;
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  transition: border-color var(--dur-base), box-shadow var(--dur-base);
  min-height: 50px;
  -webkit-appearance: none;
  appearance: none;
}
.wfield__input::placeholder { color: var(--clr-text-3); }
.wfield__input:focus,
.wfield__select:focus {
  outline: none;
  border-color: rgba(229,34,34,0.5);
  box-shadow: 0 0 0 3px rgba(229,34,34,0.08);
}
.wfield__input.error { border-color: rgba(229,34,34,0.7); }
.wfield__input.valid { border-color: rgba(34,197,94,0.4); }

.wfield__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8aba9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
.wfield__select option { background: var(--clr-surface); }

.wfield__hint {
  font-size: 0.75rem;
  color: var(--clr-text-3);
  line-height: 1.5;
}
.wfield__error {
  font-size: 0.75rem;
  color: #ff6b6b;
  display: none;
  align-items: center;
  gap: 5px;
}
.wfield__error.visible { display: flex; }
.wfield__error svg { width: 13px; height: 13px; flex-shrink: 0; }

/* Order ID help link */
.wfield__help {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--clr-red);
  cursor: pointer;
  transition: opacity var(--dur-base);
  opacity: 0.75;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.wfield__help:hover { opacity: 1; }

/* Order ID tooltip */
.worder-help {
  display: none;
  padding: 14px 16px;
  background: rgba(229,34,34,0.05);
  border: 1px solid rgba(229,34,34,0.15);
  border-radius: var(--r-lg);
  font-size: 0.8rem;
  color: var(--clr-text-2);
  line-height: 1.6;
}
.worder-help.visible { display: block; }
.worder-help code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--clr-red-bright);
  background: rgba(229,34,34,0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── Checkboxes ──────────────────────────────────────────────── */
.wcheckbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  transition: border-color var(--dur-base), background var(--dur-base);
}
.wcheckbox:hover {
  border-color: var(--clr-border-h);
  background: rgba(255,255,255,0.02);
}
.wcheckbox--required {
  background: rgba(229,34,34,0.03);
  border-color: rgba(229,34,34,0.12);
}
.wcheckbox--required:hover {
  border-color: rgba(229,34,34,0.25);
}

.wcheckbox input[type="checkbox"] {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--clr-red);
  cursor: pointer;
  border-radius: 4px;
}

.wcheckbox__label {
  font-size: 0.83rem;
  color: var(--clr-text-2);
  line-height: 1.5;
  cursor: pointer;
}
.wcheckbox__label strong { color: var(--clr-text); font-weight: 500; }

/* ── Privacy note ────────────────────────────────────────────── */
.wprivacy {
  font-size: 0.72rem;
  color: var(--clr-text-3);
  text-align: center;
  line-height: 1.6;
  padding: 0 4px;
}
.wprivacy a {
  color: var(--clr-text-2);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: color var(--dur-base), border-color var(--dur-base);
}
.wprivacy a:hover { color: var(--clr-red); border-color: var(--clr-red); }

/* ── Global error banner ─────────────────────────────────────── */
.werror-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(229,34,34,0.08);
  border: 1px solid rgba(229,34,34,0.3);
  border-radius: var(--r-lg);
  font-size: 0.83rem;
  color: #ff8080;
  line-height: 1.5;
}
.werror-banner.visible { display: flex; }
.werror-banner svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--clr-red-bright); }

/* ── Confirmation ────────────────────────────────────────────── */
.wconfirm__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  margin: 0 auto;
  animation: confirmPop 0.5s var(--ease-spring) forwards;
}
@keyframes confirmPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.wconfirm__icon svg {
  width: 36px; height: 36px;
  color: #4ade80;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 0.5s 0.3s ease-out forwards;
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.wconfirm__title {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-align: center;
  line-height: 1.25;
}

.wconfirm__message {
  font-size: 0.88rem;
  color: var(--clr-text-2);
  text-align: center;
  line-height: 1.7;
}

.wrecap {
  background: var(--clr-bg-3);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wrecap__title {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clr-text-3);
  margin-bottom: 4px;
}

.wrecap__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--clr-border);
}
.wrecap__row:last-child { border-bottom: none; padding-bottom: 0; }

.wrecap__key {
  font-size: 0.78rem;
  color: var(--clr-text-3);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.wrecap__val {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--clr-text);
  text-align: right;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.wrecap__ordernote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--r);
  font-size: 0.77rem;
  color: var(--clr-text-3);
  line-height: 1.5;
}
.wrecap__ordernote svg {
  width: 13px; height: 13px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--clr-silver);
  opacity: 0.5;
}

/* ── Footer ──────────────────────────────────────────────────── */
.wfooter {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.wfooter__back {
  font-size: 0.78rem;
  color: var(--clr-text-3);
  transition: color var(--dur-base);
  display: flex;
  align-items: center;
  gap: 5px;
}
.wfooter__back:hover { color: var(--clr-text-2); }
.wfooter__back svg { width: 12px; height: 12px; }
.wfooter__copy {
  font-size: 0.7rem;
  color: var(--clr-text-3);
  letter-spacing: 0.06em;
  opacity: 0.5;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  .wcard { padding: 28px 20px; border-radius: var(--r-xl); }
  .whead { padding: 28px 0 24px; }
  .wtitle { font-size: 1.4rem; }
  .wproduct-visual { padding: 16px; gap: 14px; }
  .wproduct-visual__orb { width: 52px; height: 52px; }
  .wrecap__row { flex-direction: column; gap: 4px; }
  .wrecap__val { text-align: left; }
}
