:root {
  --bg: #0a0a12;
  --surface: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.09);
  --text1: #f2f2f7;
  --text2: #a8a8b8;
  --text3: #6c6c80;
  --accent: #6d5dfc;
  --accent2: #46c3ff;
  --danger: #ff5d73;
  --ok: #3ddc97;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html[dir='rtl'] body {
  --font-display: 'IBM Plex Sans Arabic', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', sans-serif;
}

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text1);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* ---- background decoration ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 75%);
  pointer-events: none;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  pointer-events: none;
}
.glow-1 { width: 480px; height: 480px; top: -140px; inset-inline-start: -100px; background: var(--accent); }
.glow-2 { width: 420px; height: 420px; bottom: -160px; inset-inline-end: -80px; background: var(--accent2); }

/* ---- layout ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 48px);
  position: relative;
  z-index: 1;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wordmark .dot { color: var(--accent); }

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  height: 28px;
  width: auto;
}

.lang-toggle {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text2);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lang-toggle:hover { color: var(--text1); border-color: var(--accent); }

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12.5px;
  color: var(--text2);
  margin-bottom: 28px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); }
}

.title {
  font-family: var(--font-display);
  font-size: clamp(38px, 7vw, 68px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(92deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  max-width: 560px;
  color: var(--text2);
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.75;
  margin-bottom: 40px;
}

/* ---- waitlist form ---- */
.waitlist {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 680px;
}

.waitlist input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text1);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#name-input {
  flex: 0 0 160px;
}
.waitlist input::placeholder { color: var(--text3); }
.waitlist input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.18);
}
.waitlist input.invalid { border-color: var(--danger); }

.waitlist button {
  background: linear-gradient(92deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 14px;
  padding: 15px 26px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 8px 28px rgba(109, 93, 252, 0.35);
}
.waitlist button:hover { transform: translateY(-1px); }
.waitlist button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.form-message {
  min-height: 22px;
  margin-top: 14px;
  font-size: 13.5px;
}
.form-message.ok { color: var(--ok); }
.form-message.error { color: var(--danger); }

/* ---- step-2 survey ---- */
.hidden { display: none !important; }

.survey {
  width: 100%;
  max-width: 560px;
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px clamp(18px, 4vw, 32px);
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: survey-in 0.45s ease both;
}
@keyframes survey-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.survey-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
}
.survey-head p { color: var(--text3); font-size: 13px; margin-top: 4px; }

.survey-field {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: none;
}
.field-label-wrapper,
.survey-field > span,
.survey-field > legend {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text2);
  padding: 0;
  margin-bottom: 6px;
  display: block;
}
.required {
  color: var(--danger);
  margin-inline-start: 3px;
}
.other-text-input {
  width: 100%;
}
.mt-2 {
  margin-top: 8px !important;
}

.survey-field input,
.survey-field select,
.survey-field textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text1);
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.survey-field input:focus,
.survey-field select:focus,
.survey-field textarea:focus { border-color: var(--accent); }
.survey-field select { appearance: auto; }
.survey-field option { background: #14141f; color: var(--text1); }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--text1); }
.chip.selected {
  background: linear-gradient(92deg, rgba(109, 93, 252, 0.25), rgba(70, 195, 255, 0.25));
  border-color: var(--accent);
  color: var(--text1);
}

.survey-actions { display: flex; gap: 10px; justify-content: flex-end; }

.btn-primary {
  background: linear-gradient(92deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text3);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-ghost:hover { color: var(--text1); border-color: var(--text3); }

/* ---- features ---- */
.features {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 64px;
  width: 100%;
  max-width: 760px;
}

.features li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: start;
  transition: border-color 0.25s, transform 0.25s;
}
.features li:hover { border-color: rgba(109, 93, 252, 0.5); transform: translateY(-3px); }

.feature-icon { color: var(--accent2); font-size: 18px; }
.features strong { font-size: 15px; }
.features span:not(.feature-icon) { color: var(--text2); font-size: 13px; line-height: 1.6; }

.footer {
  text-align: center;
  padding: 26px 20px;
  color: var(--text3);
  font-size: 12.5px;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .waitlist { flex-direction: column; }
  #name-input { flex: none; width: 100%; }
  .features { grid-template-columns: 1fr; }
}

/* ---- modal survey overlay ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade-in 0.3s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: rgba(20, 20, 35, 0.85);
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 36px 28px 28px;
  animation: pop-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text3);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
}
.modal-close-btn:hover {
  color: var(--text1);
  transform: rotate(90deg);
}

/* Custom scrollbar for modal content */
.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

/* Remove default margin-top from survey since it's now in a modal */
.survey {
  margin-top: 0 !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  width: 100% !important;
}
