@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #09090b;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-soft: #71717a;
  --violet: #a855f7;
  --violet-glow: rgba(168, 85, 247, 0.15);
  --cyan: #22d3ee;
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(24, 24, 27, 0.6);
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", system-ui, sans-serif;
  --success: #22d3ee;
  --error: #f87171;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(168, 85, 247, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(34, 211, 238, 0.06), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
}

.back-link {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-link:hover { color: var(--violet); }

.form-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 50%, rgba(168,85,247,0.05) 100%);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 22px 78px rgba(0, 0, 0, 0.5);
}

.form-logo {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.form-logo .brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
}

.form-logo .brand-name .white { color: var(--text); }
.form-logo .brand-name .violet { color: var(--violet); }

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.75rem;
}

.form-card h1 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, #a855f7, #22d3ee, #d946ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-card .subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.45rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(9, 9, 11, 0.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-glow);
}

.form-group select option { background: #18181b; color: var(--text); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

.divider-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.25rem;
}

.plan-options { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1rem; }
.plan-option { position: relative; cursor: pointer; }
.plan-option input { display: none; }

.plan-option .plan-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.25s;
}

.plan-option input:checked + .plan-card {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.1);
}

.plan-option .plan-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, 0.35);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-option input:checked + .plan-card .plan-radio {
  border-color: var(--violet);
}

.plan-option input:checked + .plan-card .plan-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet);
}

.plan-option .plan-name { font-weight: 600; font-size: 0.9rem; }
.plan-option .plan-desc { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.15rem; }
.plan-option .plan-price {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--violet);
  text-align: right;
  flex-shrink: 0;
}

.plan-option .plan-price small { font-size: 0.68rem; color: var(--text-soft); display: block; }

.submit-btn {
  width: 100%;
  padding: 0.95rem 1.5rem;
  background: linear-gradient(135deg, #a855f7, #d946ef);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.3);
}

.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.result-msg {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
  line-height: 1.6;
}

.result-msg.success {
  display: block;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--success);
}

.result-msg.error {
  display: block;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--error);
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

.google-section { text-align: center; margin-bottom: 1.25rem; }
.google-section .g_id_signin { display: flex; justify-content: center; }

.or-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.or-divider span {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.signed-in-bar {
  display: none;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.signed-in-bar .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--violet);
}

.signed-in-bar .user-name { font-weight: 600; font-size: 0.9rem; }
.signed-in-bar .user-email { font-size: 0.75rem; color: var(--text-muted); }

.signed-in-bar .signout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
}

.demo-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.demo-benefit {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.demo-benefit .check { color: var(--cyan); font-weight: 700; flex-shrink: 0; }

@media (max-width: 600px) {
  body { padding: 1rem; }
  .form-card { padding: 1.75rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .demo-benefits { grid-template-columns: 1fr; }
}