/* Account pages (sign up, log in, password reset, legal) - same look as the home page. */
:root {
  --bg: #07060d;
  --fg: #f4f2fa;
  --muted: #b3aec4;
  --faint: #8a859d;
  --glass: rgba(20, 16, 34, 0.62);
  --glass-line: rgba(255, 255, 255, 0.1);
  --brand: #a78bfa;
  --accent: #22d3ee;
  --ok: #4ade80;
  --err: #fca5a5;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 80% at 50% -10%, #1d1335 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; letter-spacing: -0.02em; }
a { color: #d8b4fe; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; opacity: 0; transition: opacity 1.6s ease; }
html.webgl-ready #scene { opacity: 1; }
html.no-webgl #scene { display: none; }
html.no-webgl body {
  background: radial-gradient(60% 50% at 20% 30%, #3b1d6e 0%, transparent 70%), radial-gradient(50% 40% at 80% 70%, #0e4a5c 0%, transparent 70%), var(--bg);
  background-attachment: fixed;
}
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: rgba(7, 6, 13, 0.35); }

header, main, footer { position: relative; z-index: 2; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-family: 'Space Grotesk', sans-serif; font-size: 19px; text-decoration: none; color: var(--fg); }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #7c3aed, #d946ef); box-shadow: 0 0 24px rgba(168, 85, 247, 0.55); }
.logo-mark svg { width: 20px; height: 20px; }
header nav { display: flex; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; font-weight: 600; border-radius: 12px; padding: 13px 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s; cursor: pointer; border: 0; font-size: 15.5px; font-family: inherit; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #7c3aed, #c026d3); box-shadow: 0 10px 40px rgba(168, 85, 247, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 50px rgba(192, 38, 211, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost { color: var(--fg); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--glass-line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn:disabled { opacity: 0.65; cursor: progress; }
header .btn { padding: 8px 15px; font-size: 14px; }
.block { width: 100%; }

.auth { min-height: calc(100vh - 68px - 70px); display: grid; place-items: center; padding: 24px 0 40px; }
.card { width: min(460px, 100%); padding: 34px; border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4); }
.card h1 { font-size: 30px; line-height: 1.1; margin: 0 0 6px; }
.card .sub { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 500; color: #dcd7ea; margin-bottom: 6px; }
.field > span a { font-weight: 500; font-size: 13px; }
.input { position: relative; }
input[type='text'], input[type='email'], input[type='password'] {
  width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(7, 6, 13, 0.55); color: var(--fg);
  font: inherit; font-size: 15px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus { border-color: rgba(167, 139, 250, 0.8); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22); }
input[aria-invalid='true'] { border-color: rgba(248, 113, 113, 0.8); }
.input input { padding-right: 66px; }
.reveal-btn { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.08); color: var(--muted); border: 0;
  border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.reveal-btn:hover { color: var(--fg); }
.hint { font-size: 12.5px; color: var(--err); margin-top: 6px; }

.strength { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 2px 0 6px; }
.strength::after { content: ''; display: block; height: 100%; width: var(--pct, 0%); border-radius: inherit; transition: width 0.25s, background 0.25s; background: #f87171; }
.strength[data-level='fair']::after { background: #fbbf24; }
.strength[data-level='good']::after { background: #34d399; }
.strength[data-level='great']::after { background: linear-gradient(90deg, #34d399, #22d3ee); }
.strength-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-bottom: 4px; }
#rules { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12.5px; color: var(--faint); }
#rules li { display: flex; gap: 6px; align-items: baseline; }
#rules li::before { content: '○'; color: var(--faint); }
#rules li.ok { color: #bbf7d0; }
#rules li.ok::before { content: '✓'; color: var(--ok); font-weight: 700; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); margin: 4px 0 18px; }
.check input { width: 17px; height: 17px; margin-top: 3px; accent-color: #8b5cf6; flex: none; }
.message { border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; outline: none; }
.message.error { background: rgba(127, 29, 29, 0.45); border: 1px solid rgba(248, 113, 113, 0.45); color: #fee2e2; }
.message.success { background: rgba(6, 78, 59, 0.5); border: 1px solid rgba(52, 211, 153, 0.45); color: #d1fae5; }
.message.info { background: rgba(30, 58, 138, 0.45); border: 1px solid rgba(96, 165, 250, 0.45); color: #dbeafe; }
.switch { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; font-size: 12px; color: var(--faint); }

/* Legal pages */
.doc { width: min(780px, 100%); margin: 30px auto 60px; padding: 40px; border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.doc h1 { font-size: 36px; margin: 0 0 4px; }
.doc h2 { font-size: 21px; margin: 30px 0 8px; }
.doc p, .doc li { color: #dcd7ea; font-size: 15.5px; }
.doc .updated { color: var(--faint); font-size: 14px; margin-bottom: 24px; }

footer { padding: 20px 0 30px; color: var(--faint); font-size: 13px; text-align: center; }
footer a { color: var(--muted); }

@media (max-width: 560px) {
  .card { padding: 24px; border-radius: 20px; }
  #rules { grid-template-columns: 1fr; }
  .doc { padding: 24px; }
  header nav .btn-ghost { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #scene { transition: none; }
}

/* Edge adds its own password-reveal eye; the pages have their own Show button. */
input::-ms-reveal,
input::-ms-clear {
  display: none;
}

/* Invite and contact pages */
[hidden] { display: none !important; }
.invite-box { display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: rgba(7, 6, 13, 0.45); border: 1px solid var(--glass-line); margin-bottom: 18px; }
.invite-box div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.invite-box .k { color: var(--faint); }
.invite-box b { text-align: right; overflow-wrap: anywhere; }
.stack { display: grid; gap: 10px; }
.stack + .btn, .btn + .stack, #switch { margin-top: 10px; }
select.select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(7, 6, 13, 0.55); color: var(--fg);
  font: inherit; font-size: 15px; outline: none;
}
textarea { resize: vertical; min-height: 120px; }
select.select:focus, textarea:focus { border-color: rgba(167, 139, 250, 0.8); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
