/* Smartcrew · Ember — الأرقام من Smartcrew Ember Studio كما هي، بالدور لا بالعين */
:root {
  --paper: #F7F4EE;       /* الخلفية */
  --glow: #F1D9CA;        /* التوهّج السفلي */
  --card: #FFFFFF;
  --ink: #1A1915;
  --graphite: #5E5B53;    /* النص الثانوي */
  --mute: #7A766B;        /* التسميات */
  --line: #E7E3D8;
  --dot: #E6D4C8;         /* المسارات والخطوط الخافتة */
  --strong: #B0553A;      /* الأزرار والخطّ القوي (نصّ أبيض 4.6:1) */
  --ember: #CC6B49;       /* الشيفرون، الكتلة، النقطة النشطة */
  --soft: #D27A58;
  --muted: #B38A76;
  --deep: #9C4A2E;
  --tint: #FAEEE7;        /* Ember 50 */
  --tint-2: #F2D7C9;      /* Ember 200 */
  --error: #B42318;
  --error-bg: #FEF3F2;
  --clay-shadow: 0 14px 30px -18px rgba(126, 58, 37, .55);
  --card-shadow: 0 10px 28px -16px rgba(176, 85, 58, .32);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* أعلام الدول على Windows (لا يعرض أعلام الإيموجي بنفسه) */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Readex Pro", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse 80% 45% at 50% 100%, var(--glow) 0%, rgba(247, 244, 238, 0) 100%) fixed, var(--paper);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--tint-2); }

/* ── الإطار الثابت ── */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--dot); z-index: 5; }
.progress span { display: block; height: 100%; width: 0; background: var(--ember); transition: width .5s var(--ease); }

.brand { position: fixed; top: 28px; inset-inline-start: 32px; width: 42px; z-index: 4; transition: opacity .3s; }
.on-welcome .brand { opacity: 0; pointer-events: none; }

/* ── المراحل: سؤال واحد على الشاشة ── */
.flow { position: relative; z-index: 1; height: var(--app-h, 100dvh); }
.trap { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; inset-inline-start: -9999px; }

.step {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  width: min(768px, 100%); margin-inline: auto; padding: 88px 24px 88px;
  overflow-y: auto; scrollbar-width: none;
  opacity: 0; visibility: hidden; transform: translateY(56px);
  transition: opacity .4s var(--ease), transform .5s var(--ease), visibility 0s .5s;
}
/* في الوسط عمودياً دائماً. فاصلان مرنان بدل justify-content: center،
   لأنّ الأخير يقصّ أعلى المحتوى حين يطول عن الشاشة */
.step::before, .step::after { content: ""; flex: 1 1 0; }
.step.is-before { transform: translateY(-56px); }
.step.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .4s var(--ease) .08s, transform .5s var(--ease) .08s, visibility 0s;
}

.kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; white-space: nowrap; }
.kicker .lbl { font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; letter-spacing: 1.8px; color: var(--strong); direction: ltr; unicode-bidi: isolate; }
.kicker .dash { width: 22px; height: 1.5px; background: var(--dot); }
.kicker .ar { font-size: 14px; font-weight: 600; color: var(--strong); }

/* ── الغلاف: في الوسط، الشعاران فوق، و«Claude for Companies» بشعار Claude ── */
.step[data-step="welcome"] { align-items: center; text-align: center; }
.step[data-step="welcome"] .lead { margin-inline: auto; }
.step[data-step="welcome"] .when { align-self: center; }
.step[data-step="welcome"] .actions { justify-content: center; }
.step[data-step="welcome"] .audience { text-wrap: balance; }
.step[data-step="welcome"] .audience::before { display: none; }

.lockup { height: 60px; margin-bottom: clamp(28px, 5vh, 48px); }

/* كتلة ember واحدة: «Claude for Companies» صغيرة في أعلاها، والعنوان العربي تحتها */
.hero {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px; max-width: 100%;
  padding: 16px clamp(20px, 3vw, 34px) 20px; border-radius: 18px;
  background: var(--ember); color: #fff; box-shadow: var(--clay-shadow);
}
.hero-en {
  display: inline-flex; align-items: center; gap: .35em;
  font-family: "Hanken Grotesk", sans-serif; font-weight: 600; font-size: clamp(15px, 1.6vw, 19px);
  letter-spacing: -.01em; opacity: .92; unicode-bidi: isolate; white-space: nowrap;
}
/* الشعار أبيض داخل الكتلة، كما في عرض الورشة على الخلفيات الداكنة */
.hero-logo { height: 1.1em; filter: brightness(0) invert(1); transform: translateY(.04em); }
.hero-ar { margin: 0; font-weight: 700; font-size: clamp(30px, 4.4vw, 50px); line-height: 1.4; white-space: nowrap; }

.title { margin: 0; font-weight: 700; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.3; letter-spacing: -.5px; }
.title [data-greet] { color: var(--ember); }

.lead { margin: 22px 0 0; font-size: clamp(17px, 2vw, 20px); line-height: 1.85; color: var(--graphite); max-width: 600px; }
.lead:empty, .audience:empty { display: none; }
.audience {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px 0 0;
  font-size: 16.5px; font-weight: 600; color: var(--strong);
}
.audience::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); }

.when {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; align-self: flex-start;
  margin: 28px 0 0; padding: 13px 18px; border-radius: 14px;
  background: var(--card); box-shadow: var(--card-shadow);
  font-size: 16px; font-weight: 500;
}
.when svg { width: 20px; height: 20px; fill: none; stroke: var(--ember); stroke-width: 1.8; stroke-linecap: round; }
.when .sep { color: var(--muted); }
.when .local { flex-basis: 100%; font-size: 13.5px; font-weight: 400; color: var(--mute); padding-inline-start: 30px; }

.fine { margin: 14px 0 0; font-size: 14px; color: var(--mute); }

/* ── السؤال ── */
.q { display: flex; align-items: baseline; gap: 14px; font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; line-height: 1.45; }
.q-num {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-family: "DM Mono", monospace; font-size: 16px; font-weight: 500; color: var(--strong);
  transform: translateY(-3px);
}
.q-num i { font-style: normal; font-family: "Readex Pro", sans-serif; font-size: 15px; }
.help { margin: 10px 0 0; padding-inline-start: 40px; font-size: 16px; color: var(--graphite); line-height: 1.75; max-width: 600px; }

.field {
  width: 100%; margin-top: 30px; padding: 0 0 12px;
  border: 0; border-bottom: 2px solid var(--dot); border-radius: 0;
  background: transparent; outline: none;
  font: 400 clamp(22px, 3vw, 30px)/1.4 "Readex Pro", sans-serif; color: var(--ink);
  caret-color: var(--ember); transition: border-color .2s;
}
.field::placeholder { color: #C9BDB2; }
.field:focus { border-bottom-color: var(--ember); }
.field[dir="ltr"] { text-align: left; }

/* اختيار واحد بشرائح، والنقر ينقل للسؤال التالي */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 120px;
  padding: 12px 22px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 17px; font-weight: 500; color: var(--graphite);
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover span { border-color: var(--tint-2); }
.chip input:checked + span { border-color: var(--ember); background: var(--tint); color: var(--strong); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--tint-2); outline-offset: 2px; }

.field-area { resize: none; line-height: 1.6; font-size: clamp(20px, 2.6vw, 26px); overflow: hidden; }

/* «ليس لدي بريد شركة»: ثانوي وهادئ، يظهر بعد رفض البريد الشخصي فقط */
.alt-btn {
  align-self: flex-start; margin-top: 12px; padding: 10px 16px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  font: 500 15px "Readex Pro", sans-serif; color: var(--strong);
}
.alt-btn:hover { border-color: var(--ember); }
.alt-btn:focus-visible { outline: 3px solid var(--tint-2); outline-offset: 2px; }

/* ── الواتساب: الدولة من قائمة بأعلام وبحث ── */
.phone { position: relative; display: flex; align-items: flex-end; gap: 12px; margin-top: 30px; }
.phone .field { margin-top: 0; font-family: "DM Mono", monospace; letter-spacing: .5px; }
.cc {
  flex: none; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px;
  padding: 8px 10px 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  cursor: pointer; color: var(--ink); transition: border-color .15s;
}
.cc:hover, .cc[aria-expanded="true"] { border-color: var(--ember); }
.cc:focus-visible { outline: 3px solid var(--tint-2); outline-offset: 2px; }
.cc svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.flag { font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 24px; line-height: 1; }
.cc-dial { font: 500 18px "DM Mono", monospace; }

.cc-panel {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 10;
  width: min(380px, 100%); padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 28px 56px -26px rgba(80, 40, 20, .45);
}
.cc-panel[hidden] { display: none; }
.cc-search {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; outline: none;
  font: 400 16px "Readex Pro", sans-serif; color: var(--ink); background: var(--paper);
}
.cc-search:focus { border-color: var(--ember); background: var(--card); }
.cc-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.cc-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 286px; overflow-y: auto; overscroll-behavior: contain; }
.cc-list li {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  font-size: 15.5px;
}
.cc-list li[aria-selected="true"], .cc-list li:hover { background: var(--tint); }
.cc-list .name { flex: 1; min-width: 0; }
.cc-list .en { display: block; font-size: 12.5px; color: var(--mute); direction: ltr; text-align: right; }
.cc-list .dial { font: 500 14px "DM Mono", monospace; color: var(--strong); direction: ltr; unicode-bidi: isolate; }
.cc-list .divider { height: 1px; padding: 0; margin: 6px 4px; background: var(--line); pointer-events: none; }
.cc-list .empty { cursor: default; color: var(--mute); justify-content: center; background: none; }

.error {
  display: inline-flex; align-items: flex-start; gap: 8px; align-self: flex-start;
  margin: 14px 0 0; padding: 9px 14px; border-radius: 10px; max-width: 600px;
  background: var(--error-bg); color: var(--error); font-size: 15px; line-height: 1.7;
  animation: nudge .35s var(--ease);
}
.error[hidden] { display: none; }
.error::before {
  content: "!"; display: grid; place-items: center; flex: none; width: 18px; height: 18px; margin-top: 4px;
  border-radius: 50%; background: var(--error); color: #fff; font: 500 12px/1 "DM Mono", monospace;
}
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: translateX(-6px); } 60% { transform: translateX(4px); } }

/* ── الأزرار: طين لا زجاج ── */
.actions { display: flex; align-items: center; gap: 16px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 30px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--strong); color: #fff; font: 600 18px "Readex Pro", sans-serif; text-decoration: none;
  box-shadow: var(--clay-shadow), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: background .2s, transform .15s;
}
.btn:hover { background: var(--deep); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--tint-2); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .85; }
.btn[aria-busy="true"] svg { display: none; }
.btn[aria-busy="true"]::after {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-tg { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--card-shadow); }
.btn-tg:hover { background: var(--card); border-color: var(--ember); }
.btn-tg .tg-icon { width: 22px; height: 22px; fill: #229ED9; stroke: none; }
.countdown { position: absolute; inset: auto 0 0 0; height: 3px; background: var(--ember); transform-origin: right; transform: scaleX(0); }
.countdown.run { animation: count var(--count, 6s) linear forwards; }
@keyframes count { to { transform: scaleX(1); } }

.hint { font-size: 13.5px; color: var(--mute); }
kbd { font: 500 12.5px "DM Mono", monospace; color: var(--graphite); direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ── شاشة النهاية ── */
.done-icon { width: 128px; margin-bottom: 18px; filter: drop-shadow(0 18px 18px rgba(176, 85, 58, .18)); }
.is-active .done-icon { animation: pop .6s var(--ease) .15s both; }
@keyframes pop { from { transform: translateY(14px) scale(.85); opacity: 0; } }
.email-chip {
  display: inline-block; margin: 14px 0 0; padding: 8px 14px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
  font: 500 15px "DM Mono", monospace; color: var(--ink); word-break: break-all;
}
.tg { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.link-btn { align-self: flex-start; margin-top: 22px; padding: 0; border: 0; background: none; cursor: pointer; font: 400 13.5px "Readex Pro", sans-serif; color: var(--mute); }
.link-btn:hover { color: var(--graphite); }

/* ── أسهم التنقّل ── */
.pager {
  position: fixed; bottom: 28px; inset-inline-end: 32px; z-index: 4;
  display: flex; gap: 2px; border-radius: 12px; overflow: hidden; box-shadow: var(--clay-shadow);
  transition: opacity .3s, transform .3s;
}
.pager[hidden] { display: flex; opacity: 0; transform: translateY(12px); pointer-events: none; }
.pager button { width: 42px; height: 38px; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--strong); }
.pager button:hover { background: var(--deep); }
.pager svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── الجوال: السؤال يبدأ من الأعلى كي لا يغطّيه الكيبورد ── */
@media (max-width: 640px) {
  .brand { top: 22px; inset-inline-start: 20px; width: 36px; }
  .step { padding: 76px 20px 72px; }
  .step[data-step="welcome"] { padding-block: 40px 56px; }
  .lockup { height: 48px; }
  .hero { padding: 14px 18px 16px; }
  .hero-en { font-size: 14px; }
  .hero-ar { font-size: min(32px, 8.4vw); white-space: normal; text-wrap: balance; }
  .chips { flex-direction: column; }
  .chip span { width: 100%; }
  .help { padding-inline-start: 0; }
  .q { gap: 10px; }
  .hint { display: none; }
  .actions .btn, .tg .btn { flex: 1; width: 100%; }
  .kicker { gap: 10px; }
  .kicker .lbl { font-size: 11px; letter-spacing: 1.4px; }
  .when { display: grid; grid-template-columns: 20px 1fr; column-gap: 10px; row-gap: 2px; align-self: stretch; text-align: right; }
  .when svg { grid-row: span 3; align-self: start; margin-top: 3px; }
  .when .sep { display: none; }
  .when .local { padding: 4px 0 0; }
  .cc-panel { width: 100%; }
  .done-icon { width: 104px; }
  .pager { bottom: 18px; inset-inline-end: 20px; }
}
@media (max-height: 560px) { .step { padding-block: 64px 24px; } }

@media (prefers-reduced-motion: reduce) {
  .step, .step.is-active { transition: opacity .2s; transform: none; }
  .done-icon, .error { animation: none; }
}
