/* ═══════════════════════════════════════════════════════════
   ETC Waitlist — ETC Design System By Rafat
   ═══════════════════════════════════════════════════════════ */

:root {
  --primary: #e91e8c;
  --primary-hover: #db2777;
  --primary-light: #fdf2f8;
  --primary-ring: rgba(233, 30, 140, 0.12);
  --secondary: #7c3aed;
  --secondary-deep: #6b21a8;

  --success: #10b981;
  --success-light: #d1fae5;
  --success-fg: #065f46;
  --destructive: #ef4444;
  --destructive-light: #fee2e2;
  --destructive-fg: #991b1b;

  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --disabled-bg: #e2e8f0;
  --disabled-text: #94a3b8;

  --brand-gradient: linear-gradient(135deg, #e91e8c 0%, #6b21a8 100%);
  --ai-gradient: linear-gradient(135deg, #c084fc, #7c3aed);

  --font: "IBM Plex Sans Arabic", sans-serif;
  --radius-btn: 8px;
  --radius-input: 10px;
  --radius-card: 14px;
  --radius-lg: 16px;

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.16);
  --shadow-cta: 0 4px 14px rgba(233, 30, 140, 0.3);

  --container: 720px;
  --space: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input {
  font: inherit;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(233, 30, 140, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 30%, rgba(124, 58, 237, 0.06), transparent 50%),
    var(--bg);
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

/* ── Header (داخل الـ Hero) ── */
.site-header {
  position: relative;
  z-index: 2;
  padding: 20px 0 8px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  animation: brandPop 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-logo {
  width: min(168px, 46vw);
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.22));
  transition: transform 0.25s ease, filter 0.25s ease;
}

.brand:hover .brand-logo {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.28));
}

.brand-tagline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand-gradient);
  color: #fff;
  padding: 0 0 64px;
  min-height: min(58vh, 460px);
  display: flex;
  flex-direction: column;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.14), transparent 35%),
    radial-gradient(circle at 85% 70%, rgba(192, 132, 252, 0.25), transparent 40%);
}

.hero-atmosphere::before {
  content: "";
  position: absolute;
  inset-inline: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.hero-atmosphere::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  top: -80px;
  left: -60px;
  animation: drift 14s ease-in-out infinite alternate;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 0 8px;
  animation: fadeInUp 0.7s ease 0.08s both;
}

.hero h1 {
  font-size: clamp(1.65rem, 4.8vw, 2.15rem);
  font-weight: 700;
  line-height: 1.35;
  max-width: 18ch;
  margin: 0 auto 14px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero-sub {
  font-size: clamp(0.95rem, 2.4vw, 1.05rem);
  line-height: 1.75;
  opacity: 0.92;
  max-width: 36ch;
  margin: 0 auto 22px;
  font-weight: 400;
}

.hero-cta-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  animation: fadeInUp 0.9s ease 0.15s both;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a6ce39;
  box-shadow: 0 0 0 0 rgba(166, 206, 57, 0.55);
  animation: pulse 1.8s ease-out infinite;
}

/* ── Form section ── */
.form-section {
  padding: 32px 0 64px;
  margin-top: -28px;
}

.form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 28px 20px;
  animation: fadeInUp 0.75s ease 0.1s both;
}

@media (min-width: 640px) {
  .form-panel {
    padding: 36px 32px;
  }
}

.form-intro {
  margin-bottom: 24px;
  border-right: 3px solid var(--primary);
  padding-right: 14px;
}

.form-intro h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
}

.form-intro p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Fields ── */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.required {
  color: var(--primary);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.country-search {
  width: 100%;
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  background: var(--surface);
  color: #1e293b;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder,
.country-search::placeholder {
  color: var(--text-muted);
}

.field input:hover {
  border-color: #94a3b8;
}

.field input:focus,
.country-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ── Account type picker ── */
.account-picker {
  position: relative;
}

.account-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-input);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: right;
}

.account-trigger:hover {
  border-color: #94a3b8;
}

.account-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.account-trigger .chevron {
  margin-right: auto;
  margin-left: 0;
}

.account-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.account-trigger-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.account-trigger-text.is-placeholder {
  font-weight: 500;
  color: var(--text-muted);
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 50;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  animation: fadeInUp 0.18s ease;
}

.account-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: right;
  color: #0f172a;
  transition: background 0.15s ease, color 0.15s ease;
}

.account-option-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.account-option-label {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.account-option:hover,
.account-option:focus-visible {
  background: var(--primary-light);
  outline: none;
}

.account-option:hover .account-option-label,
.account-option:focus-visible .account-option-label {
  color: var(--primary-hover);
}

.account-option:hover .account-option-dot,
.account-option:focus-visible .account-option-dot {
  background: var(--primary);
}

.account-option[aria-selected="true"] {
  background: var(--primary-light);
}

.account-option[aria-selected="true"] .account-option-label {
  color: var(--primary);
  font-weight: 700;
}

.account-option[aria-selected="true"] .account-option-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.18);
}

.field.has-error input,
.field.has-error .account-trigger,
.field.has-error .country-trigger {
  border-color: var(--destructive);
}

.field.has-error input:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
  font-size: 12px;
  color: var(--destructive);
  margin-top: 4px;
  min-height: 1.2em;
}

/* ── Phone row + country picker ── */
.phone-row {
  display: grid;
  grid-template-columns: minmax(118px, 140px) 1fr;
  gap: 8px;
  direction: ltr; /* رمز الدولة على اليسار، الرقم على اليمين */
}

.country-picker {
  position: relative;
}

.country-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-input);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

.country-trigger:hover {
  border-color: #94a3b8;
}

.country-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.country-trigger .flag {
  font-size: 18px;
  line-height: 1;
}

.country-trigger .dial-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  direction: ltr;
  unicode-bidi: isolate;
}

.chevron {
  margin-left: auto;
  width: 0;
  height: 0;
  border-inline: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  transition: transform 0.2s ease;
}

.country-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(300px, 85vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  z-index: 50;
  overflow: hidden;
  animation: fadeInUp 0.18s ease;
}

.country-search {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none !important;
}

.country-list {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}

.country-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: right;
  color: var(--text);
  transition: background 0.15s ease;
}

.country-option:hover,
.country-option:focus-visible,
.country-option[aria-selected="true"] {
  background: var(--primary-light);
  outline: none;
}

.country-option .name {
  flex: 1;
  font-size: 14px;
}

.country-option .code {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  direction: ltr;
  unicode-bidi: isolate;
}

.phone-row input[type="tel"] {
  min-width: 0;
}

/* ── Submit ── */
.btn-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 52px;
}

.btn-submit:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-cta);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-submit.is-loading .btn-text {
  display: none;
}

.btn-submit.is-loading .btn-loading {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.form-status {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  min-height: 1.2em;
}

.form-status.is-error {
  color: var(--destructive-fg);
  background: var(--destructive-light);
  border-right: 4px solid var(--destructive);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: right;
}

.privacy-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}

/* ── Success ── */
.success-state {
  text-align: center;
  padding: 28px 12px 12px;
  animation: fadeInUp 0.45s ease;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.08);
}

.success-state h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--success-fg);
  margin-bottom: 8px;
}

.success-state p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 34ch;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Perks / marketing ── */
.perks {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.perks h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--ai-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.perks-lead {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.perks ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perks li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  line-height: 1.55;
}

.perk-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--success-light);
  position: relative;
}

.perk-mark::after {
  content: "";
  position: absolute;
  inset: 6px 5px 7px 6px;
  border: solid var(--success);
  border-width: 0 0 2.5px 2.5px;
  transform: rotate(-45deg);
}

/* ── Footer ── */
.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes brandPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(166, 206, 57, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(166, 206, 57, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(166, 206, 57, 0);
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(24px, 18px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* LTR islands for Latin/numeric fields */
input[dir="ltr"],
.dial-code,
.country-option .code {
  text-align: left;
}
