/* arrested.cloud — signup. Anonymous access, fully static. Shares the same
   dark-theme token scheme as welcome/style.css for visual continuity across
   the anonymous-facing pages. */

:root {
  --bg: #0b0d13;
  --surface: #151926;
  --border: #262c3f;
  --border-soft: #1e2334;
  --text: #eef0f6;
  --text-muted: #8991ab;
  --text-dim: #5c6480;

  --accent: #4f6ef7;
  --accent-hover: #3d5ce6;

  --green: #4ade80;
  --red: #f87171;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-lg: 0 30px 90px -25px rgba(0, 0, 0, 0.7);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(79, 110, 247, 0.18), transparent),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

a { color: inherit; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 48px 20px;
}

/* ── Brand ─────────────────────────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  box-shadow: 0 4px 14px -4px rgba(79, 110, 247, 0.7);
  flex-shrink: 0;
}

.brand-dot { color: var(--text-muted); font-weight: 500; }

/* ── Card ──────────────────────────────────────────────────────────────── */

.card {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
}

.card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.card .sub {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ── Form fields ───────────────────────────────────────────────────────── */

.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { margin-bottom: 18px; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-dim); }

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input { padding-right: 42px; }

.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 4px;
  display: flex;
  transition: color 0.15s ease;
}
.toggle-password:hover { color: var(--text-muted); }
.toggle-password svg { width: 18px; height: 18px; }

/* ── Password + requirements side-by-side ─────────────────────────────── */

.password-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
  gap: 28px;
  align-items: start;
  margin-bottom: 6px;
}

.password-fields .field:last-child { margin-bottom: 0; }

.requirements {
  list-style: none;
  margin: 30px 0 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.requirement,
.match-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  transition: color 0.2s ease;
}

.requirement[data-met="true"],
.match-check[data-met="true"] {
  color: var(--text);
}

.check-icon {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--red);
  background: rgba(248, 113, 113, 0.14);
  transition: color 0.2s ease, background 0.2s ease;
}

.check-icon::before { content: '\2715'; } /* ✕ */

[data-met="true"] .check-icon {
  color: var(--green);
  background: rgba(74, 222, 128, 0.14);
}

[data-met="true"] .check-icon::before { content: '\2713'; } /* ✓ */

.match-check {
  margin-top: 8px;
  font-size: 0.78rem;
}

@media (max-width: 560px) {
  .password-grid { grid-template-columns: 1fr; }
  .name-row { grid-template-columns: 1fr; }
  .requirements { margin-top: 12px; }
  .card { padding: 28px 22px; }
}

/* ── Error / submit ────────────────────────────────────────────────────── */

.error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  padding: 10px 12px;
  margin: 4px 0 18px;
}

#submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #7c5cf0);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  padding: 13px;
  cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(79, 110, 247, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

#submit-btn:not(:disabled):hover { transform: translateY(-1px); }

#submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.alt-action {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.alt-action a { color: var(--accent); text-decoration: none; font-weight: 600; }
.alt-action a:hover { text-decoration: underline; }

/* ── Success view ──────────────────────────────────────────────────────── */

#signup-success-view {
  text-align: center;
  padding: 12px 4px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.14);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-icon svg { width: 28px; height: 28px; }

#signup-success-view h1 { margin-bottom: 10px; }

.btn-back {
  display: inline-block;
  margin-top: 22px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.btn-back:hover { text-decoration: underline; }
