
  :root {
    --base: #EEF3F9;
    --title: #0F172A;
    --sub: #64748B;
    --accent: #6CB4EE;
    --accent-deep: #3A8FD4;
    --star: #FFB020;
    --fill-a: rgba(255,255,255,.78);
    --fill-b: rgba(255,255,255,.50);
    --border: rgba(255,255,255,.90);
    --shadow: rgba(30,58,95,.08);
    --field: rgba(255,255,255,.70);
    --field-border: rgba(15,23,42,.08);
    --ok: #1F9D6B;
    --err: #D64F4F;
  }
  :root[data-theme=dark] {
    color-scheme: dark;
    --base: #0D1117;
    --title: #F1F5F9;
    --sub: #94A3B8;
    --fill-a: rgba(255,255,255,.10);
    --fill-b: rgba(255,255,255,.04);
    --border: rgba(255,255,255,.12);
    --shadow: rgba(0,0,0,.35);
    --field: rgba(255,255,255,.06);
    --field-border: rgba(255,255,255,.10);
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { margin: 0; }
  body {
    font-family: 'Tajawal', system-ui, sans-serif;
    background: var(--base);
    color: var(--title);
    min-height: 100vh;
    overflow-x: hidden;
  }
  /* بقع الضوء نفس خلفية التطبيق */
  .bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
  .blob { position: absolute; border-radius: 50%; }
  .b1 { width: 130vmax; height: 130vmax; top: -60vmax; inset-inline-end: -45vmax;
        background: radial-gradient(circle, rgba(108,180,238,.24), transparent 65%); }
  .b2 { width: 110vmax; height: 110vmax; top: 20vh; inset-inline-start: -60vmax;
        background: radial-gradient(circle, rgba(139,124,246,.10), transparent 65%); }
  .b3 { width: 110vmax; height: 110vmax; bottom: -50vmax; inset-inline-end: -50vmax;
        background: radial-gradient(circle, rgba(79,209,197,.09), transparent 65%); }
  [data-theme=dark] .b1 { background: radial-gradient(circle, rgba(108,180,238,.18), transparent 65%); }
  [data-theme=dark] .b3 { background: radial-gradient(circle, rgba(79,209,197,.07), transparent 65%); }

  .wrap { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 18px 16px 48px; }
  .glass, .doc, .course, .who { min-width: 0; max-width: 100%; }

  header { display: flex; align-items: center; gap: 12px; margin: 6px 2px 18px; }
  .logo { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
          background: linear-gradient(135deg, var(--fill-a), var(--fill-b)); border: 1px solid var(--border);
          box-shadow: 0 8px 24px var(--shadow); }
  .logo img { height: 30px; }
  .brand { flex: 1; min-width: 0; }
  .brand b { display: block; font-size: 19px; font-weight: 900; }
  .brand span { font-size: 13px; color: var(--sub); }
  .tools { display: flex; gap: 8px; }
  .tools .theme { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; }
  .tools .theme svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .lang, .theme { border: 1px solid var(--border); background: linear-gradient(135deg, var(--fill-a), var(--fill-b));
          color: var(--title); font: 700 13px 'Tajawal'; border-radius: 999px; padding: 8px 14px; cursor: pointer;
          box-shadow: 0 6px 18px var(--shadow); }

  .hero { margin: 4px 2px 18px; }
  .hero h1 { font-size: 27px; line-height: 1.3; font-weight: 900; margin: 0 0 6px; }
  .hero p { margin: 0; color: var(--sub); font-size: 15px; line-height: 1.6; }

  .glass {
    background: linear-gradient(135deg, var(--fill-a), var(--fill-b));
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 10px 30px var(--shadow);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    padding: 18px;
    margin-bottom: 14px;
  }
  .step { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
  .num { width: 26px; height: 26px; border-radius: 9px; background: rgba(108,180,238,.18); color: var(--accent-deep);
         display: grid; place-items: center; font-weight: 900; font-size: 14px; flex: none; }
  .step h2 { margin: 0; font-size: 17px; font-weight: 800; }
  .step small { color: var(--sub); font-size: 12.5px; margin-inline-start: auto; }

  .search { display: flex; gap: 8px; }
  input, textarea {
    width: 100%; font: 500 16px 'Tajawal'; color: var(--title);
    background: var(--field); border: 1px solid var(--field-border); border-radius: 16px;
    padding: 13px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
  }
  input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(108,180,238,.18); }
  input.code { text-transform: uppercase; letter-spacing: .5px; font-weight: 700; direction: ltr; text-align: center; }
  input.code::placeholder { letter-spacing: 0; font-weight: 500; text-transform: none; }
  textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
  ::placeholder { color: var(--sub); opacity: .8; }

  .btn {
    border: 0; cursor: pointer; font: 800 16px 'Tajawal'; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    border-radius: 16px; padding: 13px 20px; box-shadow: 0 10px 24px rgba(58,143,212,.28);
    transition: transform .12s, opacity .15s; white-space: nowrap;
  }
  .btn:active { transform: scale(.97); }
  .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
  .btn.block { width: 100%; padding: 15px; font-size: 17px; }
  .btn.ghost { background: transparent; color: var(--accent-deep); box-shadow: none; border: 1px solid rgba(108,180,238,.45); }

  .course { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px;
            border-radius: 14px; background: rgba(108,180,238,.10); }
  .course b { font-size: 15px; direction: ltr; }
  .course .ct { flex: 1; min-width: 0; }
  .course .ct span { display: block; color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pill { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; color: #fff; flex: none; }

  .doctors { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .doc {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; cursor: pointer;
    font: inherit; color: inherit; padding: 10px; border-radius: 16px;
    background: var(--field); border: 1.5px solid var(--field-border); transition: border-color .15s, background .15s, transform .12s;
  }
  .doc:active { transform: scale(.985); }
  .doc.on { border-color: var(--accent); background: rgba(108,180,238,.12); }
  .avatar { width: 46px; height: 46px; border-radius: 13px; flex: none; object-fit: cover; background: rgba(108,180,238,.15);
            display: grid; place-items: center; color: var(--accent-deep); font-weight: 900; font-size: 17px; }
  .doc .info { flex: 1; min-width: 0; }
  .doc .name { font-weight: 800; font-size: 14.5px; line-height: 1.35; direction: ltr; text-align: start;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  [dir=rtl] .doc .name { text-align: right; }
  .doc .meta { font-size: 12.5px; color: var(--sub); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rate { font-weight: 800; font-size: 13px; color: var(--star); white-space: nowrap; }
  .rate.none { color: var(--sub); font-weight: 500; font-size: 12px; }
  .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field-border); flex: none; display: grid; place-items: center; }
  .doc.on .check { border-color: var(--accent); background: var(--accent); }
  .doc.on .check::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px,-1px); }

  .who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
  .who .t { font-size: 17px; font-weight: 900; line-height: 1.35; }
  .who .s { font-size: 13px; color: var(--sub); direction: ltr; text-align: start; }
  [dir=rtl] .who .s { text-align: right; }

  .stars { display: flex; justify-content: center; gap: 8px; direction: ltr; }
  .star { background: none; border: 0; padding: 2px; cursor: pointer; transition: transform .12s; }
  .star:active { transform: scale(.85); }
  .star svg { width: 44px; height: 44px; display: block; }
  .star path { fill: rgba(100,116,139,.22); transition: fill .15s; }
  .star.on path { fill: var(--star); }
  .rlabel { text-align: center; font-weight: 800; font-size: 14px; height: 22px; margin: 8px 0 14px; color: var(--sub); }
  .rlabel.on { color: var(--star); }

  .counter { text-align: end; font-size: 11.5px; color: var(--sub); margin: 6px 4px 0; }
  .notice { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 14px;
            background: rgba(255,176,32,.10); border: 1px solid rgba(255,176,32,.25); font-size: 12.5px; line-height: 1.6; color: var(--sub); }
  .notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }

  .diff { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .dopt { height: 40px; border-radius: 12px; cursor: pointer; font: 800 15px 'Tajawal'; transition: all .15s; border: 1.5px solid; background: transparent; }
  .dlabels { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin: 8px 2px 14px; }
  .dnow { text-align: center; font-weight: 800; font-size: 13.5px; margin-top: 8px; min-height: 20px; }

  .opt { font-size: 12px; font-weight: 700; color: var(--sub); background: rgba(100,116,139,.12); padding: 3px 8px; border-radius: 999px; margin-inline-start: auto; }

  .msg { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.6; display: none; }
  .msg.show { display: block; }
  .msg.err { background: rgba(214,79,79,.10); color: var(--err); }

  .empty { text-align: center; color: var(--sub); padding: 18px 8px; font-size: 14px; line-height: 1.7; }
  .spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(108,180,238,.25); border-top-color: var(--accent);
             animation: spin .8s linear infinite; margin: 16px auto; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .done { text-align: center; padding: 26px 18px; }
  .done .ic { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; }
  .done h2 { margin: 0 0 8px; font-size: 22px; font-weight: 900; }
  .done p { margin: 0 0 18px; color: var(--sub); line-height: 1.7; font-size: 15px; }

  /* تحميل التطبيق */
  .stores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .store { display: flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none;
           background: #0F172A; color: #fff; border-radius: 15px; padding: 10px 12px; min-height: 54px;
           box-shadow: 0 8px 20px rgba(15,23,42,.18); transition: transform .12s; direction: ltr; }
  .store:active { transform: scale(.97); }
  .store svg { width: 24px; height: 24px; flex: none; fill: #fff; }
  .store small { display: block; font-size: 10.5px; opacity: .8; line-height: 1.1; }
  .store b { display: block; font-size: 15px; line-height: 1.2; font-weight: 800; }
  [data-theme=dark] .store { background: #fff; color: #0F172A; }
  [data-theme=dark] .store svg { fill: #0F172A; }
  .app { margin-top: 30px; text-align: center; padding: 22px 18px; }
  .app .logo { margin: 0 auto 12px; width: 56px; height: 56px; border-radius: 17px; }
  .app .logo img { height: 36px; }
  .app h3 { margin: 0 0 6px; font-size: 19px; font-weight: 900; }
  .app p { margin: 0 0 16px; font-size: 14px; color: var(--sub); line-height: 1.7; }
  #submitWrap { margin: 22px 0 8px; }

  /* معلومات الدكتور الجديد */
  .newdoc { margin-top: 16px; padding: 14px; border-radius: 16px; background: rgba(108,180,238,.08); border: 1px dashed rgba(108,180,238,.45); }
  .newdoc h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
  .newdoc p { margin: 0 0 12px; font-size: 12.5px; color: var(--sub); line-height: 1.6; }
  .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fields .full { grid-column: 1 / -1; }
  .fields input, .fields select { padding: 11px 12px; font-size: 14.5px; border-radius: 13px; }
  select { width: 100%; font: 500 15px 'Tajawal'; color: var(--title); background: var(--field); border: 1px solid var(--field-border);
           border-radius: 16px; padding: 12px 14px; outline: none; 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='%2364748B' stroke-width='2' fill='none'/%3E%3C/svg%3E");
           background-repeat: no-repeat; background-position: left 14px center; }
  [dir=ltr] select { background-position: right 14px center; }
  select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(108,180,238,.18); }
  .fields input[type=email] { direction: ltr; }

  footer { text-align: center; font-size: 12.5px; color: var(--sub); margin: 18px 0 8px; }
  .no-blur .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
  /* Tajawal يترك فراغ تحت الحروف أكبر من فوق — النص يطلع مرتفع شوي داخل
     الأزرار الصغيرة. ننزله بنفس المقدار اللي قسناه (≈ 0.18em) عشان يصير بالنص */
  .lang { padding: 10px 14px 6px; }
  .btn { padding: 15.5px 20px 10.5px; }
  .btn.block { padding: 17.5px 15px 12.5px; }
  .pill { padding: 5px 10px 3px; }
  .opt { padding: 2.6px 8px 3.4px; }
  .dopt { padding: 5.5px 0 0; }
  .store > span { padding-top: 3px; }
  .num { padding-top: 6px; }
  div.avatar { padding-top: 7px; }
  [hidden] { display: none !important; }
  .fade { animation: fade .35s ease both; }
  @keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
