/* ============================================================
   ChargeShare — Dark Premium Theme
   Luxury Yet Simple · Mobile-First · RTL
   ============================================================ */

/* 1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Palette — dark charcoal/gray */
  --color-bg:           #121214;
  --color-surface:      #1C1C1E;
  --color-card:         #2C2C2E;
  --color-border:       rgba(255,255,255,0.08);
  --color-border-focus: rgba(74,222,128,0.5);

  /* Text */
  --color-text:         #F5F5F7;
  --color-text-secondary: rgba(255,255,255,0.75);
  --color-muted:        rgba(255,255,255,0.55);

  /* Accent — electric green */
  --color-accent:       #4ADE80;
  --color-accent-hover: #22C55E;
  --color-accent-glow:  rgba(74,222,128,0.15);

  /* Semantic */
  --color-error:        #EF4444;
  --color-whatsapp:     #25D366;

  /* Typography */
  --font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  2.75rem;
  --text-5xl:  3.5rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-pill: 100px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px var(--color-accent-glow);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* 3. LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.section {
  padding-block: var(--sp-16) var(--sp-20);
}

/* 4. SKIP LINK
   ============================================================ */
.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 9999;
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: translateY(0);
}

/* 5. NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  background: rgba(18,18,20,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--sp-3);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.navbar__logo svg {
  color: var(--color-accent);
}

.navbar__cta {
  font-size: var(--text-sm);
}

/* 6. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: all var(--transition-base);
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-sm  { padding: 12px 22px; font-size: var(--text-sm); }
.btn-lg  { padding: 16px 32px; font-size: var(--text-lg); }
.btn-full { width: 100%; }

.btn-accent {
  background: var(--color-accent);
  color: var(--color-bg);
  box-shadow: var(--shadow-glow);
}
.btn-accent:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 0 40px rgba(74,222,128,0.25);
  transform: translateY(-1px);
}

.btn-accent:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid rgba(255,255,255,0.2);
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: scale(0.97);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 28px;
  background: var(--color-whatsapp);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-pill);
  font-size: var(--text-base);
  transition: all var(--transition-base);
}
.btn-whatsapp:hover {
  background: #1EB854;
  transform: translateY(-1px);
}

.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-text { display: none; }

/* 7. HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  padding-bottom: var(--sp-12);
  background: var(--color-bg);
  overflow: hidden;
}

/* Background image layer */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('hero.png') center center / cover no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

/* Subtle radial glow */
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(74,222,128,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
}

/* Badge */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-8);
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,0.4); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}

/* Title */
.hero__title {
  font-size: var(--text-4xl);
  font-weight: 900;
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--sp-10);
}

/* Actions */
.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: stretch;
  max-width: 340px;
  margin-inline: auto;
  margin-bottom: var(--sp-12);
}

/* Trust stats */
.hero__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero__stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-accent);
}

.hero__stat-label {
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;
}

.hero__stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.1);
}

/* 8. FORM SECTION
   ============================================================ */
.form-section {
  background: var(--color-surface);
}

.form-wrap {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-10) var(--sp-6);
  max-width: 500px;
  margin-inline: auto;
  border: 1px solid var(--color-border);
}

.form__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--sp-2);
}

.form__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: var(--sp-8);
}

/* Path pills */
.path-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
  background: rgba(255,255,255,0.04);
  padding: var(--sp-1);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.path-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-2);
  border-radius: calc(var(--radius-md) - 4px);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-muted);
  transition: all var(--transition-fast);
  min-height: 48px;
  touch-action: manipulation;
}

.path-pill:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.path-pill.is-active {
  background: var(--color-accent);
  color: var(--color-bg);
  box-shadow: var(--shadow-sm);
}

.path-pill:not(.is-active):hover {
  color: var(--color-text-secondary);
  background: rgba(255,255,255,0.04);
}

/* Form fields */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-2);
}

.form-control {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--color-text);
  background: rgba(255,255,255,0.04);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 50px;
  direction: rtl;
}

.form-control::placeholder {
  color: var(--color-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-control {
  touch-action: manipulation;
}

.form-control.is-invalid {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.form-error {
  display: none;
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--sp-1);
  font-weight: 500;
}

.form-error.visible { display: block; }

/* Submit area */
.form-privacy {
  font-size: var(--text-xs);
  color: var(--color-muted);
  text-align: center;
  margin-top: var(--sp-3);
  line-height: 1.5;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0,0,0,0.2);
  border-top-color: var(--color-bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Success state */
.form-success {
  display: none;
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
}

.form-success.visible {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-accent-glow);
  border: 2px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.success-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
}

.success-body {
  color: var(--color-text-secondary);
  line-height: 1.7;
  max-width: 360px;
}

/* 9. HOW IT WORKS
   ============================================================ */
.how-section {
  background: var(--color-bg);
}

.section__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--sp-10);
}

.steps {
  display: grid;
  gap: var(--sp-6);
}

.step {
  text-align: center;
  padding: var(--sp-6);
}

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent-glow);
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-size: var(--text-xl);
  font-weight: 800;
  margin-bottom: var(--sp-4);
}

.step__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-2);
}

.step__body {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* 10. FOOTER
   ============================================================ */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: var(--sp-8);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  color: var(--color-text);
}

.footer__logo svg {
  color: var(--color-accent);
}

.footer__copy {
  font-size: var(--text-xs);
  color: var(--color-muted);
}

/* 11. SCROLL-IN ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 12. UTILITIES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 640px) {
  .hero__title {
    font-size: var(--text-5xl);
  }

  .hero__actions {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    max-width: none;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .form-wrap {
    padding: var(--sp-12) var(--sp-10);
  }
}

/* Location group slide animation */
#location-group {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  max-height: 0;
  opacity: 0;
}

#location-group.is-visible {
  display: block;
  max-height: 120px;
  opacity: 1;
}

/* Required field indicator */
.required {
  color: var(--color-error);
  margin-inline-start: 2px;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html { scroll-behavior: auto; }

  .hero__badge-dot { animation: none; }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
