:root {
  --bg: #0e0b14;
  --card: #17131f;
  --card-edge: #2a2435;
  --text: #f4f1f9;
  --muted: #a39fb0;
  --accent: #8b5cf6;
  --accent-2: #b794f6;
  --accent-press: #7c46f0;
  --field: #211b2c;
  --field-edge: #352d44;
  --ok: #34d399;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Views (form / success) cross-fade in place */
.view { animation: fade-in 0.32s ease both; }
.view.is-hidden { display: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.brand-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.7);
}
.brand-name {
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 18px;
}

.greeting {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 8px;
  font-weight: 700;
}
#userName, #successName { color: var(--accent-2); }

.lede {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="tel"] {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--field-edge);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 14px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="tel"]::placeholder { color: #6f6a7d; }
input[type="tel"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 22px;
  line-height: 1.4;
}
.checkbox input {
  margin-top: 1px;
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex: none;
}

.btn {
  position: relative;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 15px 16px;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, opacity 0.15s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.985); background: var(--accent-press); }
.btn:disabled { cursor: default; opacity: 0.85; filter: none; }

/* Loading state: hide label, show spinner */
.spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading .spinner {
  display: block;
  position: absolute;
  top: 50%; left: 50%;
  margin: -10px 0 0 -10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footnote {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11px;
  color: #6f6a7d;
}

/* Success */
.success-mark {
  width: 72px; height: 72px;
  margin: 6px 0 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ok);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  animation: pop 0.4s ease both;
}
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
