/* DeployForge Gate — refined 2100 login
   Tokens come from /static/css/theme.css — change colors there, not here. */

.gate {
  --ink: var(--df-ink);
  --mist: var(--df-mist);
  --paper: var(--df-paper);
  --lime: var(--df-lime);
  --lime-deep: var(--df-lime-deep);
  --signal: var(--df-signal);
  --ai: var(--df-ai);
  --mute: var(--df-mute);
  --line: var(--df-line);
  --font-display: var(--df-font-display);
  --font-body: var(--df-font-body);
  --font-mono: var(--df-font-mono);

  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--mist);
}

#nebula {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.gate-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(1000px 560px at 18% 70%, var(--df-wash-a), transparent 58%),
    radial-gradient(800px 520px at 82% 55%, var(--df-wash-b), transparent 55%),
    radial-gradient(700px 480px at 70% 90%, var(--df-wash-c), transparent 50%),
    linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--df-mist) 70%, transparent) 100%);
}

.aurora {
  position: absolute;
  inset: -20% -10%;
  z-index: 1;
  pointer-events: none;
  background:
    conic-gradient(from 120deg at 30% 60%, rgba(200, 245, 66, 0.08), transparent 40%, rgba(61, 124, 255, 0.07), transparent 70%);
  animation: auroraDrift 18s ease-in-out infinite alternate;
  filter: blur(40px);
  opacity: 0.9;
}

.gate-chrome,
.gate-main,
.gate-ticker {
  position: relative;
  z-index: 2;
}

.gate-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.75rem;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.mark-orb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(200, 245, 66, 0.25);
  animation: markPulse 2.4s ease-in-out infinite;
}

.mark-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.chrome-hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Push content to vertical + horizontal center balance */
.gate-main {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 2.75rem;
  align-items: center;
  justify-items: stretch;
  min-height: calc(100vh - 120px);
  padding: 2.5rem 1.75rem 2.75rem;
  padding-top: clamp(2rem, 6vh, 4rem);
}

.gate-hero {
  padding-bottom: 0;
  max-width: 680px;
  justify-self: center;
  will-change: transform;
}

/* Bigger solid white form, centered in its column */
.gate-dock {
  position: relative;
  justify-self: center;
  align-self: center;
  width: min(460px, 100%);
  margin-bottom: 0;
  animation: dockIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
  will-change: transform;
}

.dock-inner {
  position: relative;
  z-index: 1;
  background: var(--df-paper);
  border: 1px solid rgba(14, 20, 27, 0.08);
  border-radius: 28px;
  padding: 2.15rem 1.85rem 1.75rem;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 28px 70px rgba(14, 20, 27, 0.12),
    0 2px 0 rgba(255, 255, 255, 0.9) inset;
}

.dock-form {
  display: grid;
  gap: 0.95rem;
  flex: 1;
}

.field > span {
  display: block;
  margin-bottom: 0.4rem;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  color: var(--df-mute, #64748b);
  pointer-events: none;
  z-index: 1;
}

.field-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
}

.field input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(14, 20, 27, 0.12);
  background: var(--df-paper-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;
}

.field-control input {
  padding: 0.75rem 0.95rem 0.75rem 2.55rem;
  transform: none;
}

.field-control input.has-toggle {
  padding-right: 2.75rem;
}

.field-toggle {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--df-mute, #64748b);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  z-index: 1;
}

.field-toggle:hover {
  color: var(--df-lime-deep, #8fb814);
  background: color-mix(in srgb, var(--df-lime, #c8f542) 22%, transparent);
}

.field-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  fill: none;
}

.field-toggle .icon-eye-off {
  display: none;
}

.field-toggle.is-shown .icon-eye {
  display: none;
}

.field-toggle.is-shown .icon-eye-off {
  display: block;
}

/* Detect browser autofill so login enable can re-check */
@keyframes df-autofill {
  from { opacity: 0.99; }
  to { opacity: 1; }
}
.field input:-webkit-autofill,
.field-control input:-webkit-autofill {
  animation-name: df-autofill;
  animation-duration: 0.01s;
}

/* Same radius/border as inputs; lime mix (light + deeper same family) */
.gate-btn {
  position: relative;
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--df-lime-deep, #8fb814) 35%, rgba(14, 20, 27, 0.12));
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: #14532d;
  background: transparent;
  box-shadow: none;
  transform: none;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.gate-btn-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--df-lime, #c8f542) 88%, #ffffff) 0%,
    var(--df-lime, #c8f542) 48%,
    color-mix(in srgb, var(--df-lime, #c8f542) 72%, var(--df-lime-deep, #8fb814)) 100%
  );
  transition: background 0.18s ease, filter 0.18s ease;
}

.gate-btn-icon,
.gate-btn-label,
.gate-btn-arrow {
  position: relative;
  z-index: 1;
  color: #14532d;
}

.gate-btn-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
}

.gate-btn-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  fill: none;
}

.gate-btn-label {
  flex: 1 1 auto;
  text-align: center;
  font-weight: 700;
  color: #14532d;
}

.gate-btn-arrow {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: rgba(20, 83, 45, 0.14);
  font-size: 0.95rem;
  line-height: 1;
  color: #14532d;
  transition: transform 0.2s ease, background 0.2s ease;
}

.gate-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--df-lime-deep, #8fb814) 55%, rgba(14, 20, 27, 0.14));
}

.gate-btn:hover:not(:disabled) .gate-btn-bg {
  background: linear-gradient(
    180deg,
    var(--df-lime, #c8f542) 0%,
    color-mix(in srgb, var(--df-lime, #c8f542) 55%, var(--df-lime-deep, #8fb814)) 55%,
    var(--df-lime-deep, #8fb814) 100%
  );
}

.gate-btn:hover:not(:disabled) .gate-btn-arrow {
  background: rgba(20, 83, 45, 0.22);
}

.gate-btn:active:not(:disabled) .gate-btn-bg {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--df-lime, #c8f542) 70%, var(--df-lime-deep, #8fb814)) 0%,
    var(--df-lime-deep, #8fb814) 100%
  );
}

.gate-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--df-lime-deep, #8fb814) 55%, transparent);
  outline-offset: 2px;
}

.gate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ai);
  margin: 0 0 0.85rem;
  animation: riseIn 0.7s ease both;
}

.hero-brand {
  margin: 0;
  line-height: 0.88;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.4rem, 8.5vw, 6.6rem);
  letter-spacing: -0.045em;
  animation: riseIn 0.8s ease 0.05s both;
}

.hero-line { display: block; }

.hero-accent {
  color: transparent;
  background: linear-gradient(115deg, var(--ink) 10%, var(--signal) 48%, var(--ai) 78%, var(--lime-deep) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: gradientShift 8s ease infinite;
}

.hero-lead {
  margin: 1.25rem 0 0.9rem;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--mute);
  animation: riseIn 0.8s ease 0.1s both;
}

.hero-rotate {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  color: var(--mute);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
  animation: riseIn 0.8s ease 0.14s both;
}

.rotate-word {
  display: inline-block;
  min-width: 11ch;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--lime);
  padding-bottom: 0.08rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.rotate-word.is-swap {
  opacity: 0;
  transform: translateY(8px);
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  animation: riseIn 0.9s ease 0.18s both;
}

.mission-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 0.85rem;
  backdrop-filter: blur(10px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  transform-style: preserve-3d;
}

.mission-card:hover {
  border-color: rgba(61, 124, 255, 0.35);
  box-shadow: 0 16px 36px rgba(14, 20, 27, 0.08);
}

.mission-ico {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--ai);
  margin-bottom: 0.45rem;
}

.mission-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mission-card p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--mute);
}

.dock-glow {
  position: absolute;
  inset: -18% -12%;
  background: radial-gradient(circle at 50% 35%, rgba(61, 124, 255, 0.22), rgba(200, 245, 66, 0.18), transparent 68%);
  filter: blur(32px);
  z-index: 0;
  pointer-events: none;
  animation: glowBreathe 5s ease-in-out infinite;
}

.dock-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.dock-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.85rem;
}

.dock-brand-copy {
  min-width: 0;
}

.dock-brand-kicker {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--df-lime-deep, #8fb814);
}

.dock-brand .dock-title {
  margin: 0;
  line-height: 1.1;
}

.dock-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
}

.blink {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime-deep);
  animation: markPulse 1.4s ease-in-out infinite;
}

.dock-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.dock-sub {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--mute);
}

.field {
  display: grid;
  gap: 0.32rem;
  margin: 0;
}

.field span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mute);
}

.field input:focus {
  outline: none;
  background: var(--df-paper);
  border-color: rgba(61, 124, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(61, 124, 255, 0.12);
  transform: translateY(-1px);
}

.field-control input:focus {
  transform: none;
}

.email-check-status {
  display: block;
  min-height: 1em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--mute);
}

.email-check-status--checking { color: var(--ai, #3d7cff); }
.email-check-status--ok { color: #059669; }
.email-check-status--taken,
.email-check-status--invalid { color: #e11d48; }

.field input.input-invalid {
  border-color: rgba(225, 29, 72, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

.field input.input-ok {
  border-color: rgba(5, 150, 105, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

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

.gate-btn.is-loading .gate-btn-label::after {
  content: " …";
}

.dock-links {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.15rem;
  font-size: 0.88rem;
}

.dock-links a {
  color: var(--mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.dock-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--signal);
}

.gate .alert {
  margin-bottom: 0.85rem;
}

.gate-ticker {
  border-top: 1px solid var(--line);
  overflow: hidden;
  padding: 0.75rem 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}

.ticker-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  animation: ticker 32s linear infinite;
}

.ticker-track span::before {
  content: "◆";
  color: var(--ai);
  margin-right: 0.65rem;
}

.gate.is-leaving {
  animation: leaveGate 0.42s ease forwards;
}

[data-theme="dark"] .dock-brand-kicker {
  color: var(--df-lime, #d4ff4a);
}

[data-theme="dark"] .field input {
  background: var(--df-paper-soft);
  color: var(--df-ink);
  border-color: var(--df-line);
}

[data-theme="dark"] .field input:focus {
  background: color-mix(in srgb, var(--df-paper-soft) 86%, var(--df-ai) 14%);
  border-color: color-mix(in srgb, var(--df-ai) 55%, var(--df-line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--df-ai) 20%, transparent);
}

[data-theme="dark"] .mission-card,
[data-theme="dark"] .gate-ticker {
  background: rgba(21, 27, 36, 0.76);
  border-color: var(--df-line);
}

[data-theme="dark"] .gate-btn {
  color: #14532d;
  border: 1px solid color-mix(in srgb, var(--df-lime-deep, #b8e03a) 40%, var(--df-line));
  box-shadow: none;
  transform: none;
}

[data-theme="dark"] .gate-btn-bg {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--df-lime, #d4ff4a) 85%, #ffffff) 0%,
    var(--df-lime, #d4ff4a) 48%,
    color-mix(in srgb, var(--df-lime, #d4ff4a) 70%, var(--df-lime-deep, #b8e03a)) 100%
  );
}

[data-theme="dark"] .gate-btn-label,
[data-theme="dark"] .gate-btn-arrow,
[data-theme="dark"] .gate-btn-icon {
  color: #14532d;
}

[data-theme="dark"] .gate-btn-arrow {
  background: rgba(20, 83, 45, 0.16);
}

[data-theme="dark"] .gate-btn:hover:not(:disabled) {
  box-shadow: none;
  filter: none;
}

[data-theme="dark"] .gate-btn:hover:not(:disabled) .gate-btn-bg {
  background: linear-gradient(
    180deg,
    var(--df-lime, #d4ff4a) 0%,
    color-mix(in srgb, var(--df-lime, #d4ff4a) 50%, var(--df-lime-deep, #b8e03a)) 55%,
    var(--df-lime-deep, #b8e03a) 100%
  );
}

[data-theme="dark"] .field-icon,
[data-theme="dark"] .field-toggle {
  color: var(--df-mute);
}

@keyframes markPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(200, 245, 66, 0.2); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(200, 245, 66, 0); }
}

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

@keyframes dockIn {
  from { opacity: 0; transform: translateY(48px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes leaveGate {
  to { opacity: 0; filter: blur(8px); transform: scale(1.02); }
}

@keyframes auroraDrift {
  from { transform: translate(-2%, 1%) rotate(0deg); }
  to { transform: translate(3%, -2%) rotate(8deg); }
}

@keyframes glowBreathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (max-width: 980px) {
  .gate-main {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    gap: 1.25rem;
    padding: 1.25rem 1rem 1.5rem;
  }

  .gate-chrome {
    padding: 1rem;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .hero-brand {
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .hero-lead {
    font-size: 0.95rem;
  }

  .gate-dock {
    justify-self: stretch;
    width: 100%;
    margin: 0;
  }

  .dock-inner {
    min-height: 0;
    padding: 1.45rem 1.2rem 1.25rem;
    border-radius: 22px;
  }

  .gate-ticker {
    padding: 0.55rem 0;
  }
}

@media (max-width: 560px) {
  .gate-hero .mission-grid { display: none; }
  .chrome-hint { display: none; }
  .dock-title { font-size: 1.45rem; }
  .otp-ring.is-ring { width: 188px; height: 188px; }
  .otp-slot { width: 46px; height: 46px; }
  .otp-box { font-size: 1.15rem; }
}

/* ── Recovery OTP: line → diamond ring on fill ── */
.otp-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--mute);
}
.otp-hint.is-on {
  display: flex;
  animation: otp-hint-bob 1.6s ease-in-out infinite;
}
.otp-progress {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--df-lime, #c8f542) 28%, #e8f5e9);
  margin: 0 0 0.85rem;
  overflow: hidden;
}
.otp-progress span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--df-lime-deep, #84cc16) 55%, #059669), transparent);
  animation: otp-progress-slide 1.8s ease-in-out infinite;
}
@keyframes otp-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
#stepOtp.otp-enter {
  animation: otp-panel-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes otp-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes otp-line-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.otp-hint-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ai, #3d7cff);
  box-shadow: 0 0 0 0 rgba(61, 124, 255, 0.45);
  animation: otp-pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}
@keyframes otp-hint-bob {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-3px); opacity: 1; }
}
@keyframes otp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 124, 255, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(61, 124, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 124, 255, 0); }
}

.otp-ring {
  --otp-size: 210px;
  --otp-box: 52px;
  --otp-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --otp-spin: 0.75s;
  position: relative;
  margin: 0.35rem auto 0.75rem;
  transition: height 0.55s var(--otp-ease), width 0.55s var(--otp-ease);
}

.otp-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

/* Straight line while typing */
.otp-ring.is-line {
  width: 100%;
  max-width: 280px;
  height: calc(var(--otp-box) + 12px);
}
.otp-ring.is-line .otp-ring-orbit {
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}
.otp-ring.is-line .otp-carousel {
  display: flex;
  gap: 0.65rem;
}
.otp-ring.is-line .otp-slot {
  position: relative;
  top: auto;
  left: auto;
  flex: 0 0 var(--otp-box);
  width: var(--otp-box);
  height: var(--otp-box);
  transition: top 0.55s var(--otp-ease), left 0.55s var(--otp-ease);
  animation: otp-line-float 2.8s ease-in-out infinite;
}
.otp-ring.is-line .otp-slot--1 { animation-delay: 0s; }
.otp-ring.is-line .otp-slot--2 { animation-delay: 0.12s; }
.otp-ring.is-line .otp-slot--3 { animation-delay: 0.24s; }
.otp-ring.is-line .otp-slot--4 { animation-delay: 0.36s; }
.otp-ring.is-line .otp-box {
  transform: none;
  border-radius: 12px;
  box-shadow:
    0 6px 16px rgba(15, 23, 42, 0.06),
    inset -2px 0 0 color-mix(in srgb, var(--ai, #3d7cff) 55%, transparent);
}

/* After all 4 filled → move into diamond ring */
.otp-ring.is-ring {
  width: var(--otp-size);
  height: var(--otp-size);
}
.otp-ring.is-ring .otp-carousel {
  position: absolute;
  inset: 0;
  display: block;
  gap: 0;
}
.otp-ring.is-ring .otp-ring-orbit {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--df-lime-deep, #84cc16) 70%, #059669);
  opacity: 1;
  transform: scale(1);
  pointer-events: none;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--df-lime, #c8f542) 22%, transparent),
    0 0 24px color-mix(in srgb, var(--ai, #3d7cff) 18%, transparent);
  transition: opacity 0.45s var(--otp-ease), transform 0.55s var(--otp-ease), border-color 0.35s, box-shadow 0.35s;
  animation: otp-orbit-appear 0.55s var(--otp-ease);
}
.otp-ring.is-ring .otp-slot {
  position: absolute;
  width: var(--otp-box);
  height: var(--otp-box);
  transform: translate(-50%, -50%) rotate(45deg);
  transition: top 0.55s var(--otp-ease), left 0.55s var(--otp-ease), transform 0.55s var(--otp-ease);
  z-index: 1;
}
.otp-ring.is-ring .otp-slot--1 { top: 8%; left: 50%; }
.otp-ring.is-ring .otp-slot--2 { top: 50%; left: 92%; }
.otp-ring.is-ring .otp-slot--3 { top: 92%; left: 50%; }
.otp-ring.is-ring .otp-slot--4 { top: 50%; left: 8%; }
.otp-ring.is-ring .otp-box {
  transform: rotate(-45deg);
  border-radius: 12px;
  transition: transform 0.55s var(--otp-ease), border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

/* Full circle spin — all 4 diamonds orbit once, then result */
.otp-ring.is-spinning .otp-carousel {
  animation: otp-carousel-spin var(--otp-spin) cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
}
.otp-ring.is-spinning .otp-ring-orbit {
  animation: otp-orbit-pulse var(--otp-spin) ease-in-out;
}
.otp-ring.is-spinning .otp-slot {
  /* diamond keeps 45° while parent spins */
  animation: otp-diamond-hold var(--otp-spin) linear forwards;
}
.otp-ring.is-spinning .otp-box {
  /* counter-spin so digits stay upright */
  animation: otp-digit-counter var(--otp-spin) cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
}
.otp-ring.is-spinning .otp-slot--1 { animation-delay: 0ms; }
.otp-ring.is-spinning .otp-slot--2 { animation-delay: 40ms; }
.otp-ring.is-spinning .otp-slot--3 { animation-delay: 80ms; }
.otp-ring.is-spinning .otp-slot--4 { animation-delay: 120ms; }

.otp-ring.is-verified .otp-ring-orbit {
  border-color: #059669;
  box-shadow: 0 0 0 5px rgba(5, 150, 105, 0.18);
  animation: otp-orbit-ok 0.55s var(--otp-ease);
}
.otp-ring.is-invalid .otp-ring-orbit {
  border-color: #e11d48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.14);
}
.otp-ring.is-shake {
  animation: otp-shake 0.45s ease;
}

@keyframes otp-orbit-appear {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes otp-carousel-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes otp-digit-counter {
  0% { transform: rotate(-45deg); }
  100% { transform: rotate(-405deg); } /* -45 - 360 — digits stay upright */
}
@keyframes otp-diamond-hold {
  0%, 100% { /* keep diamond orientation relative to carousel */ }
}
@keyframes otp-orbit-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  45% { transform: scale(1.06); filter: brightness(1.08); }
}
@keyframes otp-orbit-ok {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.otp-box {
  width: 100%;
  height: 100%;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 750;
  font-family: ui-monospace, "Cascadia Code", Menlo, monospace;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--df-paper-soft, #f8fafc);
  color: var(--ink);
  outline: none;
  box-shadow: inset -2px 0 0 color-mix(in srgb, var(--ai, #3d7cff) 55%, transparent);
}
.otp-slot.is-active .otp-box,
.otp-box:focus {
  border-color: color-mix(in srgb, var(--ai, #3d7cff) 65%, var(--line));
  background: var(--df-paper);
  box-shadow:
    inset -2px 0 0 color-mix(in srgb, var(--ai, #3d7cff) 75%, transparent),
    0 0 0 4px rgba(61, 124, 255, 0.14);
}
.otp-slot.is-filled .otp-box {
  border-color: color-mix(in srgb, var(--df-lime-deep, #84cc16) 55%, #059669);
  background: var(--df-paper);
  box-shadow:
    inset -2px 0 0 color-mix(in srgb, var(--df-lime-deep, #84cc16) 80%, transparent),
    0 0 0 3px rgba(5, 150, 105, 0.12);
}

.otp-result {
  margin: 0.15rem 0 0.85rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  min-height: 1.4em;
}
.otp-result.is-ok {
  color: #059669;
  animation: otp-result-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.otp-result.is-bad {
  color: #e11d48;
  animation: otp-result-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes otp-result-pop {
  0% { opacity: 0; transform: scale(0.86) translateY(8px); }
  70% { transform: scale(1.04) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}

.otp-dev {
  margin: -0.15rem 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b45309;
  text-align: center;
  word-break: break-all;
}

.otp-timer {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mute);
}
.otp-timer strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.otp-timer.is-expired,
.otp-timer-expired { color: #e11d48; }

.otp-resend {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0;
  padding: 0.45rem;
  border: none;
  background: transparent;
  color: var(--mute);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.otp-resend:hover { color: var(--ink); }

.otp-success {
  text-align: center;
  margin: 0 0 1.15rem;
  padding: 1rem 0.75rem 0.35rem;
  opacity: 0;
  transform: translateY(8px);
}
.otp-success.play {
  animation: otp-success-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.otp-success strong {
  display: block;
  margin: 0.65rem 0 0.25rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: #059669;
}
.otp-success p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--mute);
}
.otp-success-ring {
  width: 56px;
  height: 56px;
  margin: 0 auto;
}
.otp-success-ring svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #059669;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.otp-success.play .otp-success-ring circle {
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  animation: otp-ring-draw 0.55s ease forwards;
}
.otp-success.play .otp-success-ring path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: otp-check 0.35s 0.35s ease forwards;
}
@keyframes otp-success-in {
  to { opacity: 1; transform: none; }
}
@keyframes otp-ring-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes otp-check {
  to { stroke-dashoffset: 0; }
}

#verifyOtpBtn { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  .mark-orb,
  .blink,
  .aurora,
  .dock-glow,
  .hero-accent,
  .gate-btn-bg,
  .gate-hero *,
  .gate-dock,
  .otp-hint.is-on,
  .otp-hint-pulse,
  .otp-ring.is-spinning .otp-carousel,
  .otp-ring.is-spinning .otp-box,
  .otp-ring.is-spinning .otp-ring-orbit,
  .otp-ring.is-verified .otp-ring-orbit,
  .otp-result,
  .otp-success.play {
    animation: none !important;
    transition: none !important;
  }
  .otp-success { opacity: 1; transform: none; }
}

[data-theme="dark"] .otp-slot.is-active .otp-box,
[data-theme="dark"] .otp-box:focus {
  background: var(--df-paper-soft);
}
[data-theme="dark"] .otp-slot.is-filled .otp-box {
  background: color-mix(in srgb, var(--df-ok) 12%, var(--df-paper));
}
[data-theme="dark"] .otp-result.is-ok { color: var(--df-ok); }
[data-theme="dark"] .otp-result.is-bad { color: var(--df-danger); }
