/* Aether sign up and verify demo. Dark premium theme. */

:root {
  --bg: #0B0B10;
  --surface: #16161F;
  --surface-2: #1C1C26;
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #F4F4F6;
  --muted: #9A9AA6;
  --muted-2: #8A8A96;
  --label: #C7C7D0;
  --accent: #7C6CF5;
  --accent-ink: #0B0B10;
  --accent-soft: rgba(124, 108, 245, 0.18);
  --danger: #F08A8A;
  --radius: 16px;
  --radius-sm: 12px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: 680px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.hairline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0.55;
}

/* Brand */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

/* Progress */
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.progress-meta .now { color: var(--accent); }
.track {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: barGrow 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Headings */
.h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.lead { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.lead strong { color: var(--text); font-weight: 500; }

/* Form */
.form { display: flex; flex-direction: column; gap: 16px; }
.grow { flex-grow: 1; }
.field { display: block; }
.field .label {
  display: block;
  font-size: 13px;
  color: var(--label);
  margin-bottom: 8px;
}
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input::placeholder { color: #6E6E7A; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.inputwrap { position: relative; }
.inputwrap .input { padding-right: 46px; }
.reveal {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.reveal:hover { color: var(--text); }

/* Buttons */
.btn {
  height: 52px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  position: relative;
  overflow: hidden;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary .label-top { position: relative; z-index: 1; }
.sheen {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 36%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: sheen 3.2s ease-in-out infinite;
}
.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 500;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.22); }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #6E6E7A;
  font-size: 12px;
}
.divider span { height: 1px; background: var(--line); flex-grow: 1; }

/* OTP */
.otp { display: flex; gap: 10px; justify-content: space-between; }
.otp-box {
  width: 100%;
  height: 66px;
  text-align: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  animation: pop 0.45s ease both;
}
.otp-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Centered state screens */
.center {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
}

/* Mail glyph */
.mail { position: relative; width: 132px; height: 132px; animation: floaty 4s ease-in-out infinite; }
.mail-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ring 2.6s ease-out infinite;
}
.mail-ring.delay { animation-delay: 1.3s; }
.mail-icon {
  position: absolute;
  inset: 26px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #14141C;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dots 1.2s ease-in-out infinite;
}
.pill .dot:nth-child(2) { animation-delay: 0.2s; }
.pill .dot:nth-child(3) { animation-delay: 0.4s; }

/* Spinner */
.spin-wrap { position: relative; width: 96px; height: 96px; }
.spin-pulse {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.14;
  animation: pulse 1.8s ease-in-out infinite;
}
.spinner { position: absolute; inset: 0; animation: spin 1.1s linear infinite; }
.shim {
  width: 220px; height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.shim span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  animation: shimmer 1.4s ease-in-out infinite;
}

/* Success check */
.check-wrap { position: relative; width: 124px; height: 124px; animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.check-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ring 2.4s ease-out infinite 0.4s;
}
.check-path {
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  animation: draw 0.7s 0.45s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Footer and links */
.foot { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.link { color: var(--accent); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* Flash and demo banner */
.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid var(--line);
  background: var(--surface);
}
.flash.error { border-color: rgba(240, 138, 138, 0.4); color: var(--danger); }
.flash.ok { border-color: rgba(124, 108, 245, 0.4); color: var(--text); }
.banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed rgba(124, 108, 245, 0.5);
  font-size: 13px;
  color: var(--muted);
}
.banner strong { color: var(--accent); font-family: var(--font-display); letter-spacing: 2px; }

/* Verifying overlay shown while a form posts */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 16, 0.82);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 22px;
  text-align: center;
  z-index: 50;
}
.overlay.show { display: flex; }
.overlay p { margin: 0; font-family: var(--font-display); font-size: 18px; }

/* Dashboard stub */
.dash {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash .tile {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
}
.dash .tile h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 16px; }
.dash .tile p { margin: 0; color: var(--muted); font-size: 14px; }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Keyframes */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes barGrow { from { width: 0; } }
@keyframes sheen { 0% { transform: translateX(-140%); } 60%, 100% { transform: translateX(320%); } }
@keyframes ring { 0% { transform: scale(0.55); opacity: 0.55; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes dots { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(0.9); opacity: 0.55; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes popIn { 0% { transform: scale(0.3); opacity: 0; } 65% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.reveal-up { animation: fadeUp 0.6s ease both; }

/* T&C acceptance slide toggle (step 1) */
.tc-field {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-track {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}
.switch input:checked + .switch-track {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.switch input:checked + .switch-track::before {
  transform: translateX(18px);
  background: var(--accent);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tc-text {
  font-size: 0.9rem;
  color: var(--label);
  line-height: 1.4;
}
.tc-text a {
  color: var(--accent);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .check-path { stroke-dashoffset: 0; }
}
