:root {
    --bg: #0E0B09; --bg2: #15110D; --panel: #1B1511; --panel2: #211913;
    --line: rgba(214,160,120,.14); --line2: rgba(214,160,120,.24);
    --terra: #C26A3C; --terra-soft: #E0A578; --clay: #94502D; --gold: #C9A571;
    --cream: #F1E6D8; --ivory: #FBF5ED; --muted: #A2917F; --dim: #80715F;
    --ok: #7C9463;
    --ff-display: 'Cormorant Garamond', serif; --ff-ui: 'Jost', sans-serif;
    --ff-ar: 'Aref Ruqaa', serif;
    --rail: 96px;
  }
  * { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
  html { scroll-behavior: smooth; }
  body { margin: 0; background: var(--bg); color: var(--cream); font-family: var(--ff-ui);
    font-weight: 300; line-height: 1.6; overflow-x: hidden; padding-left: var(--rail); }
  a { color: inherit; text-decoration: none; }
  .ic { width: 24px; height: 24px; color: currentColor; flex: none; }
  .disp { font-family: var(--ff-display); font-weight: 500; letter-spacing: -.02em; line-height: 1;
    color: var(--ivory); text-wrap: balance; }
  .disp em { font-style: italic; color: var(--terra-soft); }
  .eyebrow { display: inline-flex; align-items: center; gap: .7em; font-weight: 500; font-size: 12.5px;
    letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
  .grain { position: fixed; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: soft-light; z-index: 1;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMjAnIGhlaWdodD0nMTIwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nLjknIG51bU9jdGF2ZXM9JzInLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0nMTIwJyBoZWlnaHQ9JzEyMCcgZmlsdGVyPSd1cmwoI24pJyBvcGFjaXR5PScuNicvPjwvc3ZnPg=="); }

  .btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--ff-ui); font-weight: 500;
    font-size: 15px; padding: 15px 26px; border-radius: 999px; cursor: pointer; border: 1px solid transparent;
    transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s, background .25s, color .25s; }
  .btn:hover { transform: translateY(-2px); }
  .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
  .btn-primary { color: #1c1109; background: linear-gradient(180deg, var(--terra-soft), var(--terra));
    box-shadow: 0 18px 40px -16px color-mix(in oklab, var(--terra), transparent 30%); }
  .btn-primary:hover { box-shadow: 0 26px 54px -16px color-mix(in oklab, var(--terra), transparent 18%); }
  .btn-ghost { color: var(--cream); background: rgba(255,255,255,.04); border-color: var(--line2); }
  .btn-ghost:hover { background: rgba(255,255,255,.08); }

  /* ═══ LEFT RAIL ═══ */
  .e-rail { position: fixed; top: 0; left: 0; width: var(--rail); height: 100vh; z-index: 90;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 26px 0 24px; border-right: 1px solid var(--line);
    background: color-mix(in oklab, var(--bg), #000 20%); }
  .e-rail .emblem { color: var(--gold); }
  .e-rail-word { writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
    font-family: var(--ff-ui); font-weight: 500; font-size: 11px; letter-spacing: .5em; text-transform: uppercase;
    color: var(--muted); }
  .e-rail-word b { color: var(--terra-soft); font-family: var(--ff-ar); letter-spacing: 0; font-size: 15px; }
  .e-rail-loc { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; letter-spacing: .34em;
    text-transform: uppercase; color: var(--dim); }

  /* ═══ TOP ═══ */
  .e-top { position: fixed; top: 0; left: var(--rail); right: 0; z-index: 80; height: 78px;
    display: flex; align-items: center; gap: 14px; padding: 0 clamp(24px,5vw,60px);
    background: color-mix(in oklab, var(--bg), transparent 8%); backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--line); }
  .e-back { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--cream); opacity: .85; margin-right: auto; }
  .e-back:hover { opacity: 1; color: var(--terra-soft); }
  .e-back svg { width: 18px; height: 18px; }
  .e-top .m-brand { display: none; align-items: center; gap: 10px; }
  .e-top .m-brand .brand-ar { font-family: var(--ff-ar); font-weight: 700; font-size: 20px; color: var(--terra-soft); }
  .lang { font-family: var(--ff-ar); font-size: 17px; color: var(--cream); opacity: .85; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 999px; }

  /* ═══ LAYOUT ═══ */
  .shell { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 60px); }
  .apply { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(30px, 5vw, 80px); align-items: start;
    min-height: 100vh; padding: 128px 0 90px; position: relative; z-index: 2; }

  /* aside */
  .apply-aside { position: sticky; top: 118px; }
  .apply-h1 { font-family: var(--ff-display); font-weight: 500; line-height: .92; letter-spacing: -.02em;
    color: var(--ivory); margin: 22px 0 0; font-size: clamp(46px, 5.4vw, 78px); }
  .apply-h1 em { font-style: italic; color: var(--terra-soft); }
  .apply-lede { margin: 26px 0 0; max-width: 40ch; font-size: 16.5px; color: color-mix(in oklab, var(--cream), transparent 12%); }
  .apply-perks { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-direction: column; gap: 2px; }
  .apply-perks li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
  .apply-perks li:last-child { border-bottom: 1px solid var(--line); }
  .apply-perks .pk-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--terra-soft);
    background: color-mix(in oklab, var(--terra), transparent 84%); border: 1px solid color-mix(in oklab, var(--terra), transparent 58%); }
  .apply-perks .pk-ic svg { width: 16px; height: 16px; }
  .apply-perks b { display: block; font-size: 14.5px; color: var(--ivory); font-weight: 500; }
  .apply-perks span { font-size: 13px; color: var(--muted); }
  .apply-trust { margin-top: 30px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
  .apply-trust svg { width: 18px; height: 18px; color: var(--terra-soft); }

  /* card */
  .form-card { position: relative; background: var(--panel); border: 1px solid var(--line2); border-radius: 26px;
    padding: clamp(26px, 3vw, 44px); box-shadow: 0 50px 110px -50px rgba(0,0,0,.8); }

  /* progress */
  .steps { display: flex; align-items: center; gap: 0; margin-bottom: 34px; }
  .step-dot { display: flex; align-items: center; gap: 12px; flex: none; }
  .step-dot .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    font-family: var(--ff-display); font-weight: 600; font-size: 16px; color: var(--dim);
    border: 1px solid var(--line2); background: var(--bg2); transition: all .3s; }
  .step-dot .lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); transition: color .3s; }
  .step-dot.active .num { color: #1c1109; background: linear-gradient(180deg, var(--terra-soft), var(--terra)); border-color: transparent; }
  .step-dot.active .lbl { color: var(--cream); }
  .step-dot.done .num { color: var(--terra-soft); border-color: var(--terra-soft); background: color-mix(in oklab, var(--terra), transparent 84%); }
  .step-dot.done .lbl { color: var(--muted); }
  .step-line { flex: 1; height: 1px; background: var(--line2); margin: 0 14px; min-width: 20px; }

  .panel-title { font-family: var(--ff-display); font-weight: 600; font-size: 28px; color: var(--ivory); margin: 0 0 4px; }
  .panel-desc { font-size: 14px; color: var(--muted); margin: 0 0 26px; }

  .fpanel { display: none; }
  .fpanel.on { display: block; animation: fadeUp .4s ease; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

  .fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
  .field.full { grid-column: 1 / -1; }
  .field label { font-size: 13px; font-weight: 500; color: var(--cream); letter-spacing: .01em; }
  .field label .req { color: var(--terra-soft); }
  .field input, .field select, .field textarea { font-family: var(--ff-ui); font-size: 15px; font-weight: 300;
    color: var(--ivory); background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px;
    padding: 13px 15px; transition: border-color .25s, box-shadow .25s, background .25s; width: 100%; }
  .field textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
  .field select { appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23E0A578' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
  .field input::placeholder, .field textarea::placeholder { color: var(--dim); }
  .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--terra-soft);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--terra), transparent 82%); background: var(--panel2); }
  .field.err input, .field.err select, .field.err textarea { border-color: #C0533A; }
  .field .msg { font-size: 12px; color: #E08C72; display: none; }
  .field.err .msg { display: block; }
  .field .hint { font-size: 12px; color: var(--dim); }
  .with-prefix { display: flex; align-items: stretch; }
  .with-prefix .pfx { display: grid; place-items: center; padding: 0 14px; font-size: 15px; color: var(--muted);
    background: var(--bg2); border: 1px solid var(--line2); border-right: none; border-radius: 12px 0 0 12px; }
  .with-prefix input { border-radius: 0 12px 12px 0; }

  /* chip select (services) */
  .chips { display: flex; flex-wrap: wrap; gap: 10px; }
  .chip { display: inline-flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 999px; cursor: pointer;
    font-size: 14px; color: var(--cream); background: var(--bg2); border: 1px solid var(--line2); transition: all .2s; user-select: none; }
  .chip svg { width: 17px; height: 17px; color: var(--terra-soft); transition: color .2s; }
  .chip:hover { border-color: color-mix(in oklab, var(--terra), transparent 45%); }
  .chip input { display: none; }
  .chip.sel { background: color-mix(in oklab, var(--terra), transparent 82%); border-color: var(--terra-soft); color: var(--ivory); }
  .chip .tick { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; }
  .chip .tick svg { width: 11px; height: 11px; color: #1c1109; opacity: 0; }
  .chip.sel .tick { background: var(--terra-soft); border-color: transparent; }
  .chip.sel .tick svg { opacity: 1; }

  /* file upload */
  .drop { border: 1px dashed var(--line2); border-radius: 14px; padding: 26px; text-align: center; cursor: pointer;
    transition: border-color .25s, background .25s; background: var(--bg2); }
  .drop:hover, .drop.drag { border-color: var(--terra-soft); background: var(--panel2); }
  .drop svg { width: 28px; height: 28px; color: var(--terra-soft); }
  .drop b { display: block; font-size: 14px; color: var(--ivory); font-weight: 500; margin-top: 8px; }
  .drop span { font-size: 12.5px; color: var(--muted); }
  .drop input { display: none; }
  .file-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
  .file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; }
  .file-row svg { width: 16px; height: 16px; color: var(--terra-soft); }
  .file-row .nm { color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-row .rm { margin-left: auto; color: var(--dim); cursor: pointer; padding: 2px; }
  .file-row .rm:hover { color: #E08C72; }

  /* checkbox */
  .agree { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 13.5px; color: var(--muted); }
  .agree input { display: none; }
  .agree .box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg2); display: grid; place-items: center; margin-top: 1px; transition: all .2s; }
  .agree .box svg { width: 13px; height: 13px; color: #1c1109; opacity: 0; }
  .agree input:checked + .box { background: var(--terra-soft); border-color: transparent; }
  .agree input:checked + .box svg { opacity: 1; }
  .agree a { color: var(--terra-soft); border-bottom: 1px solid var(--line2); }
  .agree a:hover { border-color: var(--terra-soft); }

  .form-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 30px; }
  .form-nav .spacer { margin-left: auto; }

  /* review */
  .review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; }
  .rev-item { padding: 14px 0; border-top: 1px solid var(--line); }
  .rev-item.full { grid-column: 1 / -1; }
  .rev-item .k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
  .rev-item .v { font-size: 15px; color: var(--ivory); margin-top: 4px; word-break: break-word; }

  /* success */
  .success { text-align: center; padding: 20px 10px; }
  .success .seal { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 24px; display: grid; place-items: center;
    background: color-mix(in oklab, var(--ok), transparent 82%); border: 1px solid color-mix(in oklab, var(--ok), transparent 50%); }
  .success .seal svg { width: 42px; height: 42px; color: var(--ok); }
  .success h2 { font-family: var(--ff-display); font-weight: 600; font-size: 34px; color: var(--ivory); margin: 0 0 10px; }
  .success p { font-size: 15px; color: var(--muted); max-width: 40ch; margin: 0 auto 8px; }
  .success .ref { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 12px 20px; border-radius: 12px;
    background: var(--bg2); border: 1px solid var(--line2); font-size: 14px; color: var(--cream); }
  .success .ref b { color: var(--terra-soft); font-family: var(--ff-display); font-weight: 600; letter-spacing: .06em; }
  .success .next { margin-top: 32px; text-align: left; max-width: 420px; margin-left: auto; margin-right: auto; }
  .success .next h4 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
  .success .next li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 10px 0; font-size: 14px; color: var(--muted); list-style: none; }
  .success .next ul { padding: 0; margin: 0; }
  .success .next .n { font-family: var(--ff-display); font-style: italic; color: var(--terra-soft); }

  @media (max-width: 980px) {
    .apply { grid-template-columns: 1fr; gap: 40px; padding-top: 116px; }
    .apply-aside { position: static; }
  }
  @media (max-width: 900px) {
    :root { --rail: 0px; }
    .e-rail { display: none; }
    .e-top { left: 0; }
    .e-top .m-brand { display: flex; }
  }
  @media (max-width: 560px) {
    .fgrid, .review-grid { grid-template-columns: 1fr; }
    .steps .lbl { display: none; }
    .form-card { padding: 22px; }
  }

  /* ═══ FOOTER ═══ */
  .doc-footer { border-top: 1px solid var(--line); background: var(--bg2); padding: 60px 0 36px; position: relative; z-index: 2; margin-top: 80px; }
  .doc-footer .shell { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 60px); }
  .foot-word { display: block; width: clamp(100px, 16vw, 180px); height: auto; margin-bottom: 28px; }
  .foot-word img { display: block; width: 100%; height: auto; }
  .foot-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 22px; border-top: 1px solid var(--line); }
  .foot-bottom span { font-size: 12.5px; color: var(--dim); }
  .foot-links { display: flex; gap: 20px; }
  .foot-links a { font-size: 13.5px; color: var(--muted); transition: color .2s; }
  .foot-links a:hover { color: var(--cream); }
  .foot-social { display: flex; gap: 10px; }
  .foot-social a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line2); color: var(--muted); transition: color .2s, border-color .2s; }
  .foot-social a:hover { color: var(--terra-soft); border-color: var(--terra-soft); }
  .foot-social svg { width: 17px; height: 17px; }
  @media (max-width: 560px) {
    .foot-bottom { flex-direction: column; align-items: flex-start; }
  }

html[dir="rtl"] {
  --ff-ui: 'Markazi Text', 'Jost', sans-serif;
  --ff-display: 'Markazi Text', 'Cormorant Garamond', serif;
}
html[dir="rtl"] body { padding-left: 0; padding-right: var(--rail); font-weight: 400; }
html[dir="rtl"] .e-rail { left: auto; right: 0; border-right: none; border-left: 1px solid var(--line); }
html[dir="rtl"] .e-top { left: 0; right: var(--rail); flex-direction: row-reverse; }
html[dir="rtl"] .e-back { margin-right: 0; margin-left: auto; }
html[dir="rtl"] .with-prefix { flex-direction: row-reverse; }
html[dir="rtl"] .with-prefix .pfx { border-right: 1px solid var(--line2); border-left: none; border-radius: 0 12px 12px 0; }
html[dir="rtl"] .with-prefix input { border-radius: 12px 0 0 12px; }
@media (max-width: 900px) {
  html[dir="rtl"] body { padding-right: 0; }
  html[dir="rtl"] .e-top { right: 0; left: 0; }
}
html[dir="rtl"] .btn .ic,
html[dir="rtl"] .e-back svg { transform: scaleX(-1); }
html[dir="rtl"] .eyebrow { letter-spacing: .12em; }
html[dir="rtl"] .apply-h1 { letter-spacing: 0; }
