:root {
  --bg-deep: #070b14;
  --bg-card: rgba(15, 23, 42, 0.88);
  --bg-input: rgba(2, 6, 23, 0.54);
  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-btn: #0ea5e9;
  --border: rgba(255, 255, 255, 0.15);
  --text: #f8fafc;
  --text-muted: #94a3b8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.6;
}

/* خلفية متدرجة */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(14, 165, 233, 0.18), transparent),
    radial-gradient(ellipse 50% 40% at 100% 50%, rgba(56, 189, 248, 0.08), transparent),
    radial-gradient(ellipse 40% 30% at 0% 80%, rgba(14, 165, 233, 0.06), transparent),
    var(--bg-deep);
  pointer-events: none;
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2338bdf8' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

/* الهيدر */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
}

.logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
}

.lang-switch {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.lang-switch:hover {
  color: var(--accent-light);
}

.lang-switch.active {
  background: rgba(14, 165, 233, 0.25);
  color: var(--accent-light);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

/* المحتوى */
main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.25;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  min-width: 120px;
}

.stat strong {
  display: block;
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
}

.stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* بطاقة الشراء */
.purchase-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.purchase-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  text-align: center;
}

.price-tag {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--accent-light);
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.lang-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-input);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.lang-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lang-option:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.18);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.lang-option:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.app-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.app-input::placeholder {
  color: var(--text-muted);
}

.app-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

.app-input.vin-input {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.45);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.status-box {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}

.status-box.visible {
  display: block;
}

.status-box.loading {
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(14, 165, 233, 0.1);
  color: var(--accent-light);
}

.status-box.error {
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

.status-box.success {
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(125, 211, 252, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

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

/* ميزات */
.features {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.feature {
  padding: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--accent-light);
}

.feature p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* واتساب */
.whatsapp-float {
  position: fixed;
  z-index: 100;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  background: #20bd5a;
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}

.whatsapp-icon {
  width: 1.75rem;
  height: 1.75rem;
}

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 0.6rem 0.85rem;
    gap: 0.55rem;
  }

  .logo-link {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.5rem;
  }

  .logo-img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .logo-text {
    font-size: 0.88rem;
    line-height: 1.15;
  }

  .logo-sub {
    font-size: 0.68rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 11rem;
  }

  .header-right {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
    gap: 0.45rem;
  }

  .lang-switcher {
    flex: 1 1 auto;
    justify-content: center;
    max-width: 100%;
  }

  .lang-switch {
    padding: 0.32rem 0.55rem;
    font-size: 0.7rem;
  }

  .badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    padding: 0.28rem 0.55rem;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .purchase-card {
    padding: 1.5rem 1.25rem;
  }

  .logo-sub {
    display: none;
  }

  .badge {
    display: none;
  }

  .header-right {
    justify-content: stretch;
  }

  .lang-switcher {
    width: 100%;
  }

  .lang-switch {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.35rem;
  }
}
