* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0f172a;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}
.container {
  background: white;
  padding: 32px 28px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 440px;
  position: relative;
}
.lang-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: background 0.2s;
  user-select: none;
}
.lang-toggle:hover {
  background: #e2e8f0;
}
.lang-toggle svg {
  width: 16px;
  height: 16px;
}

/* Brand Header */
.brand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  margin-top: 20px;
}
.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #7d3ac1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.3px;
}

.brand-logo {
  width: 120px;
  height: auto;
  display: block;
}

body[dir="rtl"] .brand-header {
  direction: ltr;
}

/* Hero Placeholder */
.hero-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  background: repeating-linear-gradient(
    135deg,
    #fce7f3,
    #fce7f3 10px,
    #fdf2f8 10px,
    #fdf2f8 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-align: center;
  margin-bottom: 24px;
}

/* Typography */
h1 {
  font-size: 25px;
  margin-bottom: 8px;
  color: #111;
  line-height: 1.25;
  letter-spacing: -0.3px;
  font-weight: 800;
}
.subtitle {
  color: #6b7280;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

/* Benefits */
.benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.benefit-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf2f8;
  border-radius: 100px;
  padding: 11px 14px;
}
.benefit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ec4899;
  flex-shrink: 0;
}
.benefit-text {
  font-size: 13px;
  color: #1f2937;
  font-weight: 600;
}

/* Language Link in Footer */
.lang-link {
  color: #7d3ac1;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}
.lang-link:hover {
  color: #6b2fa8;
}

/* Footer Note */
.footer-note {
  margin-top: 16px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

/* CTA Button */
.cta-button {
  display: block;
  width: 100%;
  padding: 15px;
  background: #7d3ac1;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.cta-button:hover {
  background: #6b2fa8;
}

/* Back Button */
.back-button {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.back-button:hover {
  background: #e2e8f0;
}

/* Signup Header */
.signup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  margin-top: 20px;
}
.signup-title {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.back-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.back-circle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.back-circle svg {
  width: 18px;
  height: 18px;
}

/* Form Elements (signup page) */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
  margin-top: 16px;
}
input, select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 15px;
  transition: border-color 0.2s;
  background: white;
}
input:focus, select:focus {
  outline: none;
  border-color: #7d3ac1;
}
input:invalid:not(:placeholder-shown), select:invalid {
  border-color: #ef4444;
}
select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Phone Input with Prefix */
.phone-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  direction: ltr;
}
body[dir="rtl"] .phone-input-wrap {
  direction: ltr;
}
.phone-input-wrap:focus-within {
  border-color: #7d3ac1;
}
.phone-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: #f8fafc;
  color: #64748b;
  font-size: 15px;
  font-weight: 600;
  border-right: 1px solid #ddd;
  white-space: nowrap;
}
.phone-input-wrap input[type="tel"] {
  border: none;
  border-radius: 0;
  flex: 1;
  background: transparent;
}
.phone-input-wrap input[type="tel"]:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

/* Consent Checkbox */
.consent-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
}
.consent-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #7d3ac1;
  cursor: pointer;
  flex-shrink: 0;
}
.consent-label {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  cursor: pointer;
  font-weight: 500;
}
.label-optional {
  color: #9ca3af;
  font-weight: 400;
}
.cf-turnstile {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
button[type="submit"] {
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  background: #7d3ac1;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
button[type="submit"]:hover:not(:disabled) {
  background: #6b2fa8;
}
button[type="submit"]:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}
.privacy-note {
  margin-top: 16px;
  font-size: 12px;
  color: #888;
  text-align: center;
}
.message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
.message.success {
  background: #dcfce7;
  color: #166534;
  display: block;
}
.message.error {
  background: #fee2e2;
  color: #991b1b;
  display: block;
}
input[type="tel"] {
  direction: ltr;
  text-align: left;
}
body[dir="rtl"] input[type="tel"] {
  direction: ltr;
  text-align: left;
}
body[dir="rtl"] {
  direction: rtl;
  font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body[dir="rtl"] .benefit-pill {
  flex-direction: row;
}
body[dir="rtl"] .benefit-text {
  text-align: right;
}
body[dir="rtl"] .signup-header {
  flex-direction: row-reverse;
}
body[dir="rtl"] .consent-wrap {
  flex-direction: row-reverse;
}
body[dir="rtl"] .consent-wrap input[type="checkbox"] {
  margin-top: 2px;
}

/* Thank-you page */
.thankyou-content {
  text-align: center;
  padding: 20px 0;
}

/* Success Icon */
.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #dcfce7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  color: #15803d;
}
.success-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 3;
}

/* Core Copy */
.thankyou-content h1 {
  font-size: 26px;
  font-weight: 800;
  color: #111;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}
.thankyou-subtitle {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 28px;
}

/* Referral Card */
.referral-card {
  background: #fce7f3;
  border-radius: 24px;
  padding: 20px;
  text-align: center;
}
.referral-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #7d3ac1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.referral-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.referral-code {
  flex: 1;
  background: white;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-all;
}
.copy-btn {
  padding: 12px 20px;
  background: #7d3ac1;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.copy-btn:hover {
  background: #6b2fa8;
}
.copy-btn.copied {
  background: #15803d;
}

/* Responsive: Small phones */
@media (max-width: 360px) {
  body { padding: 12px; }
  .container {
    padding: 28px 18px;
    border-radius: 12px;
  }
  h1 { font-size: 22px; }
  .signup-title { font-size: 20px; }
  .subtitle { font-size: 13px; margin-bottom: 18px; }
  .brand-header { margin-bottom: 18px; margin-top: 16px; }
  .hero-placeholder { border-radius: 16px; font-size: 12px; }
  .benefit-pill { padding: 10px 12px; }
  .benefit-text { font-size: 12px; }
  .cta-button { padding: 13px; font-size: 14px; }
  button[type="submit"] { padding: 13px; font-size: 15px; }
  .thankyou-content h1 { font-size: 20px; }
}

/* Responsive: Phones (up to 480px) */
@media (max-width: 480px) {
  body { padding: 16px; }
  .container {
    padding: 32px 22px;
    border-radius: 14px;
  }
  h1 { font-size: 23px; }
  .signup-title { font-size: 21px; }
  .subtitle { font-size: 13.5px; }
}

/* Responsive: Tablets and small laptops (481px - 1023px) */
@media (min-width: 481px) and (max-width: 1023px) {
  .container {
    max-width: 480px;
    padding: 44px;
  }
  h1 { font-size: 27px; }
  .signup-title { font-size: 24px; }
  .subtitle { font-size: 15px; }
}

/* Responsive: Large screens (1024px and up) */
@media (min-width: 1024px) {
  .container {
    max-width: 520px;
    padding: 52px;
    border-radius: 20px;
  }
  h1 { font-size: 30px; margin-bottom: 10px; }
  .signup-title { font-size: 26px; }
  .subtitle { font-size: 15.5px; margin-bottom: 24px; }
  .brand-header { margin-bottom: 28px; margin-top: 24px; }
  .hero-placeholder { border-radius: 24px; }
  .benefit-pill { padding: 12px 16px; }
  .benefit-text { font-size: 14px; }
  .cta-button { padding: 16px; font-size: 16px; }
  button[type="submit"] { padding: 16px; font-size: 17px; }
  .thankyou-content h1 { font-size: 28px; }
  .thankyou-content p { font-size: 16px; }
}

/* Responsive: Very large screens (1440px and up) */
@media (min-width: 1440px) {
  .container {
    max-width: 560px;
    padding: 60px;
  }
  h1 { font-size: 32px; }
  .signup-title { font-size: 28px; }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
  body { align-items: flex-start; padding-top: 16px; }
  .container { margin-bottom: 16px; }
  .brand-header { margin-bottom: 16px; margin-top: 12px; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .lang-toggle,
  .back-button,
  button[type="submit"],
  .cta-button,
  .back-home-btn,
  input,
  select {
    transition: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body { background: #0b1220; }
}
