:root {
  --bg: #0e0117;
  --surface: rgba(255, 255, 255, 0.06);
  --surface2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --border-hover: rgba(255, 255, 255, 0.22);
  --accent: #34025b;
  --accent2: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.18);
  --text: #ffffff;
  --text-sub: #e2e2e2;
  --text-muted: #aaaaaa;
  --success: #2ecc71;
  --error: #e74c3c;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Cairo", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 40px 16px 60px;
  position: relative;
  overflow-x: hidden;
}

/* Background grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Glow orb */
body::after {
  content: "";
  position: fixed;
  top: -200px;
  right: -150px;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(52, 2, 91, 0.35) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.wrapper {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── HEADER ── */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 20px 8px 16px;
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.logo-badge svg {
  color: var(--accent2);
}

.wp-icon {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 20px;
  overflow: hidden;
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.4),
    0 0 0 6px rgba(168, 85, 247, 0.15),
    0 8px 32px rgba(52, 2, 91, 0.5);
}

.wp-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

h1 {
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 10px;
  color: #ffffff;
}

.subtitle {
  color: #cccccc;
  font-size: 15px;
  line-height: 1.7;
}

/* ── CARD ── */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent2);
  margin-bottom: 24px;
}

.section-title span {
  width: 24px;
  height: 24px;
  background: var(--accent-glow);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: "Space Mono", monospace;
  color: var(--accent2);
}

/* ── FIELDS ── */
.field {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 8px;
}

label .req {
  color: var(--accent2);
  margin-right: 3px;
}

input[type="text"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text);
  font-family: "Cairo", sans-serif;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  direction: rtl;
}

/* Phone & URL inputs should be LTR */
input[type="tel"],
input[type="url"] {
  direction: ltr;
  text-align: left;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.char-counter {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: "Space Mono", monospace;
  direction: ltr;
  justify-content: flex-end;
  transition: color 0.2s;
}

.char-counter.limit {
  color: var(--error);
}
textarea {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  resize: vertical;
  min-height: 130px !important;
  height: auto !important;
  line-height: 1.7;
  overflow: auto;
  width: 100% !important;
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaaaaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 40px;
  color-scheme: dark;
}

select option {
  background-color: #1a0530;
  color: #ffffff;
}

/* ── PHONE ROW ── */
.phone-row {
  display: flex;
  gap: 10px;
  direction: ltr;
}

.phone-row select {
  width: 165px;
  flex-shrink: 0;
  font-size: 13px;
  direction: ltr;
  text-align: left;
  background-position: right 14px center;
  padding-right: 36px;
  padding-left: 12px;
}

.phone-row input {
  flex: 1;
  direction: ltr;
  text-align: left;
}

/* ── RADIO GROUP ── */
.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-option {
  flex: 1;
  min-width: 130px;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
  text-align: center;
  margin: 0;
}

.radio-option input[type="radio"]:checked + label {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent2);
  color: #fff;
}

.radio-option label svg {
  transition: color 0.2s;
}

/* ── CONTACT FIELD ── */
.contact-field {
  display: none;
  animation: fadeSlide 0.25s ease;
}

.contact-field.visible {
  display: block;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── SUBMIT ── */
.btn-submit {
  width: 100%;
  padding: 17px;
  background: linear-gradient(135deg, #34025b, #a855f7);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: "Cairo", sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    opacity 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.35);
  letter-spacing: 0.3px;
}

.btn-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.45);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ── RECAPTCHA ── */
.recaptcha-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.recaptcha-wrap .g-recaptcha {
  transform-origin: center;
}

textarea.g-recaptcha-response {
  display: none !important;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 999;
  transition:
    transform 0.35s cubic-bezier(0.22, 0.68, 0, 1.3),
    opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success {
  border-color: var(--success);
  color: var(--success);
}
.toast.error {
  border-color: var(--error);
  color: var(--error);
}

/* ── NOTE ── */
.note {
  background: rgba(168, 85, 247, 0.07);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  display: flex;
  gap: 10px;
}

.note svg {
  flex-shrink: 0;
  color: var(--accent2);
  margin-top: 2px;
}

/* ── SPINNER ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── VALIDATION ── */
.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
  display: none;
}

input.invalid,
textarea.invalid,
select.invalid {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15) !important;
}

/* ── WHATSAPP PREVIEW ── */
.preview-card {
  margin-bottom: 20px;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
}

.preview-label svg {
  color: #25d366;
}

.wa-phone-mockup {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  background: #111b21;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.07);
}

.wa-status-bar {
  background: #111b21;
  padding: 10px 18px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #fff;
  font-family: "Space Mono", monospace;
}

.wa-header {
  background: #202c33;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.wa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-header-info {
  flex: 1;
}

.wa-group-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.wa-group-sub {
  font-size: 11px;
  color: #8696a0;
}

.wa-chat-bg {
  background: #0b141a;
  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='%23ffffff' fill-opacity='0.02'%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");
  min-height: 280px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.wa-msg-bubble {
  background: #202c33;
  border-radius: 0 10px 10px 10px;
  padding: 8px 10px 22px;
  max-width: 90%;
  position: relative;
  direction: rtl;
  text-align: right;
}

.wa-msg-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  right: 100%;
  border: 6px solid transparent;
  border-top-color: #202c33;
  border-right-color: #202c33;
}

.wa-sender {
  font-size: 12px;
  font-weight: 700;
  color: #25d366;
  margin-bottom: 4px;
}

.wa-msg-text {
  font-size: 13px;
  color: #e9edef;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cairo", sans-serif;
}

.wa-msg-text .wa-divider {
  color: #8696a0;
}

.wa-msg-text .wa-warning {
  font-size: 11.5px;
  color: #aaa;
  margin-top: 4px;
  display: block;
}

.wa-time {
  position: absolute;
  bottom: 5px;
  left: 8px;
  font-size: 10px;
  color: #8696a0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.wa-empty {
  font-size: 13px;
  color: #8696a0;
  text-align: center;
  width: 100%;
  margin-top: 40px;
  font-style: italic;
}

@media (max-width: 480px) {
  .card {
    padding: 22px 18px;
  }
  .phone-row {
    flex-direction: column;
  }
  .phone-row select {
    width: 100%;
  }
  .radio-group {
    flex-direction: column;
  }
}

/* ── SUCCESS SCREEN ── */
.success-screen {
  display: none;
  text-align: center;
  padding: 20px 0 40px;
  animation: fadeSlide 0.4s ease;
}

.success-screen.visible {
  display: block;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(46, 204, 113, 0.12);
  border: 2px solid rgba(46, 204, 113, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.success-icon svg {
  color: #2ecc71;
}

.success-title {
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 12px;
}

.success-msg {
  font-size: 15px;
  color: #cccccc;
  line-height: 1.8;
  max-width: 420px;
  margin: 0 auto 32px;
}

.success-msg strong {
  color: #ffffff;
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: 50px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: #2ecc71;
}
