:root{
  --bg:#f7f7fb;
  --card:#ffffff;
  --txt:#0f172a;
  --muted:#5b6476;
  --stroke:rgba(15,23,42,.10);
  --brand:#6d28d9;
  --brand2:#16a34a;
  --danger:#dc2626;
  --radius:20px;
  --shadow:0 18px 45px rgba(15,23,42,.10);
  --shadow2:0 10px 22px rgba(15,23,42,.08);
  --blur: blur(14px);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(900px 420px at 10% 5%, rgba(109,40,217,.14), transparent 55%),
    radial-gradient(700px 380px at 90% 10%, rgba(22,163,74,.11), transparent 55%),
    radial-gradient(520px 520px at 55% 92%, rgba(59,130,246,.08), transparent 60%),
    var(--bg);
  color:var(--txt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.lang-ar{font-family:"Tajawal", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;}
body.lang-en{font-family:"Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;}
a{color:inherit;text-decoration:none}
.container{max-width:1180px;margin:0 auto;padding:16px 20px 96px;}
.appbar{
  position:sticky;top:0;z-index:10;
  padding:12px 0 10px;
  background: rgba(247,247,251,.72);
  border-bottom:1px solid rgba(15,23,42,.05);
  backdrop-filter: var(--blur);
}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.right-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.brand{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border:1px solid var(--stroke);
  border-radius:999px;background:rgba(255,255,255,.70);
  box-shadow:var(--shadow2);
}
.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 12px;border:1px solid var(--stroke);
  border-radius:999px;background:rgba(255,255,255,.70);
  box-shadow:var(--shadow2);
}
.ms{font-family:"Material Symbols Rounded"; font-variation-settings:'FILL' 0,'wght' 650,'GRAD' 0,'opsz' 24;}
.pill .ms{font-size:20px;opacity:.9}
.grid{display:grid;gap:14px}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:740px){.grid.cols-2{grid-template-columns:1fr}}
.card{
  border:1px solid var(--stroke);
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.card.soft{box-shadow:var(--shadow2)}
.pad{padding:16px}
.head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.kicker{color:var(--muted);font-size:13px}
.h1{font-size:22px;font-weight:900;margin:6px 0 0}
.h2{font-size:18px;font-weight:800;margin:0}
.p{color:var(--muted);line-height:1.75;margin:10px 0 0}
.small{font-size:13px;color:var(--muted)}
.btns{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:11px 14px;border-radius:16px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.85);
  cursor:pointer;font-weight:800;
  box-shadow:var(--shadow2);
}
.btn.primary{
  background:linear-gradient(90deg, rgba(109,40,217,.95), rgba(59,130,246,.85));
  border-color:rgba(109,40,217,.20);
  color:#fff;
}
.btn.success{
  background:linear-gradient(90deg, rgba(22,163,74,.95), rgba(16,185,129,.85));
  border-color:rgba(22,163,74,.20);
  color:#fff;
}
.btn.ghost{background:transparent; box-shadow:none}
.btn .ms{font-size:20px}
.input{
  width:100%; padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.14);
  background:rgba(255,255,255,.95);
  color:var(--txt);
  outline:none;
  box-shadow:var(--shadow2);
}
label{display:block;margin:12px 0 8px;color:var(--muted);font-size:13px}
.list{display:flex;flex-direction:column;gap:10px}
.item{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px 12px;border-radius:18px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.92);
  box-shadow:var(--shadow2);
}
.item .left{display:flex;gap:10px;align-items:center;min-width:0}
.avatar{
  width:44px;height:44px;border-radius:16px;
  display:grid;place-items:center;
  background:rgba(109,40,217,.10);
  border:1px solid rgba(109,40,217,.18);
}
.avatar .ms{font-size:22px}
.progress{
  height:10px;border-radius:999px;
  background:rgba(15,23,42,.08);
  overflow:hidden;border:1px solid rgba(15,23,42,.10);
}
.progress>div{
  height:100%;
  background:linear-gradient(90deg, rgba(109,40,217,.95), rgba(22,163,74,.85));
  border-radius:999px;
}

/* Bottom nav - improved mobile UI */
.bnav{
  position:fixed;left:0;right:0;bottom:0;z-index:30;
  padding:8px 10px calc(10px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, rgba(247,247,251,0), rgba(247,247,251,.82) 40%, rgba(247,247,251,.97));
  backdrop-filter: blur(18px);
}
.bnav .wrap{
  max-width:560px;
  margin:0 auto;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.92);
  border-radius:22px;
  box-shadow:0 14px 40px rgba(15,23,42,.14);
  padding:8px;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:6px;
}
.navbtn{
  min-height:58px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:8px 4px;
  border-radius:16px;
  color:rgba(15,23,42,.56);
  transition:all .18s ease;
}
.navbtn .ms{
  font-size:22px;
  line-height:1;
}
.navbtn span:last-child{
  font-size:10px;
  font-weight:800;
  line-height:1.1;
}
.navbtn.active{
  background:linear-gradient(180deg, rgba(109,40,217,.14), rgba(109,40,217,.09));
  border:1px solid rgba(109,40,217,.18);
  color:rgba(15,23,42,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.navbtn:hover{
  color:rgba(15,23,42,.9);
}

@media (max-width: 420px){
  .container{padding:14px 14px 94px;}
  .bnav .wrap{max-width:100%;}
  .navbtn{min-height:56px;border-radius:15px;}
  .navbtn .ms{font-size:21px;}
  .navbtn span:last-child{font-size:9.5px;}
}

@media (min-width: 741px){
  .bnav .wrap{
    max-width:720px;
  }
}

/* Splash */

.splash{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;}
.splash-card{
  width:min(520px,92vw);
  border-radius:28px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.86);
  box-shadow:0 30px 80px rgba(15,23,42,.18);
  padding:26px 22px;
  text-align:center;
}
.logoMark{
  width:78px;height:78px;margin:0 auto 14px;
  border-radius:22px;display:grid;place-items:center;
  background:linear-gradient(135deg, rgba(109,40,217,.95), rgba(59,130,246,.85));
  color:#fff;box-shadow:0 18px 40px rgba(109,40,217,.22);
}
.logoMark .ms{font-size:34px}
.splash-title{font-size:26px;font-weight:950;margin:8px 0 0}
.splash-sub{color:var(--muted);line-height:1.75;margin:10px 0 0}
.spinner{
  margin:18px auto 2px;width:30px;height:30px;border-radius:999px;
  border:3px solid rgba(15,23,42,.12);
  border-top-color:rgba(109,40,217,.85);
  animation:spin 900ms linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
/* Onboarding */
.onb{min-height:calc(100vh - 80px);display:flex;align-items:center}
.carousel{position:relative;overflow:hidden;border-radius:28px}
.slides{display:flex;transition:transform 260ms ease}
.slide{min-width:100%;padding:22px 18px}
.slide .illus{
  height:180px;border-radius:22px;border:1px dashed rgba(15,23,42,.14);
  background:
    radial-gradient(340px 180px at 20% 30%, rgba(109,40,217,.16), transparent 60%),
    radial-gradient(300px 180px at 80% 20%, rgba(22,163,74,.12), transparent 60%),
    rgba(255,255,255,.85);
  display:grid;place-items:center;margin-bottom:14px;
}
.dots{display:flex;gap:8px;justify-content:center;padding:12px 0}
.dot{width:8px;height:8px;border-radius:999px;background:rgba(15,23,42,.18)}
.dot.active{background:rgba(109,40,217,.75);width:22px}
/* Tabs */
.tabs{
  display:flex;gap:8px;flex-wrap:wrap;padding:10px;
  border-radius:18px;border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.86);box-shadow:var(--shadow2);
}
.tab{
  flex:1;min-width:120px;
  display:flex;gap:8px;align-items:center;justify-content:center;
  padding:10px 12px;border-radius:14px;
  border:1px solid transparent;
  color:rgba(15,23,42,.70);font-weight:900;
  background:transparent;
}
.tab.active{
  background:rgba(109,40,217,.12);
  border-color:rgba(109,40,217,.18);
  color:rgba(15,23,42,.92);
}
/* Skeleton */
.skeleton{position:relative;overflow:hidden;background:rgba(15,23,42,.06);border-radius:12px}
.skeleton::after{
  content:"";position:absolute;inset:0;transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation:shimmer 1100ms infinite;
}
@keyframes shimmer{to{transform:translateX(100%)}}
.sk-line{height:12px;margin:10px 0}
.sk-title{height:16px;margin:10px 0;width:65%}


/* Standalone auth/language screens */
body.auth-screen{
  min-height:100vh;
  background:
    radial-gradient(700px 320px at 15% 12%, rgba(109,40,217,.12), transparent 58%),
    radial-gradient(640px 300px at 85% 15%, rgba(59,130,246,.10), transparent 58%),
    linear-gradient(180deg, #f7f7fb 0%, #eff3f8 100%);
}

body.auth-screen .appbar,
body.auth-screen .bnav{
  display:none !important;
}

.lang-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 18px;
}

.lang-card{
  width:min(420px, 100%);
  background:rgba(255,255,255,.92);
  border:1px solid rgba(15,23,42,.08);
  border-radius:32px;
  box-shadow:0 30px 70px rgba(15,23,42,.12);
  padding:30px 22px 24px;
  text-align:center;
}

.lang-logo{
  width:84px;
  height:84px;
  margin:0 auto 18px;
  border-radius:26px;
  display:grid;
  place-items:center;
  color:#fff;
  background:linear-gradient(135deg, rgba(109,40,217,.96), rgba(59,130,246,.9));
  box-shadow:0 18px 40px rgba(109,40,217,.22);
}

.lang-logo .ms{
  font-size:36px;
}

.lang-title{
  font-size:30px;
  font-weight:900;
  line-height:1.2;
  margin-bottom:10px;
  color:#0f172a;
}

.lang-sub{
  font-size:15px;
  line-height:1.9;
  color:#667085;
  max-width:320px;
  margin:0 auto 24px;
}

.lang-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.lang-btn{
  width:100%;
  min-height:56px;
  border:none;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 8px 20px rgba(15,23,42,.06);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-size:18px;
  font-weight:800;
  color:#0f172a;
  cursor:pointer;
  transition:all .18s ease;
}

.lang-btn .ms{
  font-size:20px;
}

.lang-btn.active{
  color:#fff;
  border-color:transparent;
  background:linear-gradient(135deg, rgba(109,40,217,.98), rgba(59,130,246,.92));
  box-shadow:0 14px 28px rgba(109,40,217,.22);
}

.lang-btn:hover{
  transform:translateY(-1px);
}

@media (max-width: 420px){
  .lang-card{
    padding:26px 18px 20px;
    border-radius:28px;
  }
  .lang-title{
    font-size:27px;
  }
  .lang-sub{
    font-size:14px;
  }
  .lang-btn{
    min-height:54px;
    font-size:17px;
  }
}


/* Modern auth sheets */
.sheet-screen{
  min-height:100vh;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:0;
  background:
    radial-gradient(700px 320px at 15% 10%, rgba(109,40,217,.14), transparent 58%),
    radial-gradient(640px 300px at 85% 12%, rgba(59,130,246,.11), transparent 58%),
    linear-gradient(180deg, #f6f7fb 0%, #eef2f8 100%);
}
.sheet-wrap{
  width:min(540px, 100%);
  min-height:88vh;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(15,23,42,.06);
  border-bottom:none;
  border-top-left-radius:34px;
  border-top-right-radius:34px;
  box-shadow:0 -8px 50px rgba(15,23,42,.08), 0 -30px 80px rgba(15,23,42,.08);
  padding:16px 18px 28px;
  animation: sheetUp .42s cubic-bezier(.2,.8,.2,1);
}
@keyframes sheetUp{
  from{transform:translateY(42px); opacity:.45;}
  to{transform:translateY(0); opacity:1;}
}
.sheet-handle{
  width:54px;
  height:6px;
  border-radius:999px;
  background:rgba(15,23,42,.12);
  margin:2px auto 16px;
}
.auth-head{
  text-align:center;
  margin-bottom:16px;
}
.auth-badge{
  width:74px;height:74px;
  margin:0 auto 14px;
  border-radius:24px;
  display:grid;place-items:center;
  color:#fff;
  background:linear-gradient(135deg, rgba(109,40,217,.96), rgba(59,130,246,.9));
  box-shadow:0 18px 40px rgba(109,40,217,.2);
}
.auth-badge .ms{font-size:34px}
.auth-title{
  font-size:31px;
  font-weight:900;
  line-height:1.2;
  margin:0 0 8px;
  color:#0f172a;
}
.auth-sub{
  color:#667085;
  font-size:14px;
  line-height:1.9;
  margin:0 auto;
  max-width:360px;
}
.auth-box{
  margin-top:16px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(15,23,42,.06);
  border-radius:26px;
  box-shadow:0 12px 28px rgba(15,23,42,.05);
  padding:16px;
}
.field-grid{
  display:grid;
  grid-template-columns:1fr 1.5fr;
  gap:10px;
}
.field-grid.equal{
  grid-template-columns:1fr 1fr;
}
.input.modern,
select.input.modern,
textarea.input.modern{
  min-height:54px;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(15,23,42,.09);
  box-shadow:0 8px 18px rgba(15,23,42,.04);
  padding:14px 14px;
}
.auth-actions{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:16px;
}
.auth-primary{
  min-height:56px;
  border-radius:18px;
  font-size:16px;
}
.auth-secondary-link{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  font-size:14px;
  font-weight:800;
  color:#475467;
  margin-top:6px;
}
.demo-chip{
  margin-top:14px;
  border:1px dashed rgba(15,23,42,.1);
  background:rgba(247,247,251,.9);
  border-radius:18px;
  padding:12px 14px;
}
@media (max-width: 480px){
  .sheet-wrap{
    min-height:90vh;
    border-top-left-radius:28px;
    border-top-right-radius:28px;
    padding:14px 14px 24px;
  }
  .auth-title{font-size:28px}
  .field-grid,
  .field-grid.equal{
    grid-template-columns:1fr;
  }
}


/* Header navigation for desktop */
.header-nav{
  display:none;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.header-nav .hnav-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.78);
  box-shadow:var(--shadow2);
  color:rgba(15,23,42,.74);
  font-weight:800;
  font-size:14px;
  transition:all .18s ease;
}
.header-nav .hnav-btn .ms{
  font-size:20px;
  line-height:1;
}
.header-nav .hnav-btn.active{
  background:linear-gradient(135deg, rgba(109,40,217,.12), rgba(59,130,246,.10));
  border-color:rgba(109,40,217,.16);
  color:rgba(15,23,42,.96);
}
.header-nav .hnav-btn:hover{
  color:rgba(15,23,42,.95);
  transform:translateY(-1px);
}

/* Desktop layout */
@media (min-width: 992px){
  .container{
    max-width:1240px;
    padding-left:24px;
    padding-right:24px;
  }
  .appbar .row{
    gap:16px;
  }
  .brand{
    min-width:160px;
    justify-content:center;
  }
  .right-tools{
    margin-inline-start:auto;
  }
  .header-nav{
    display:flex;
  }
  .bnav{
    display:none !important;
  }
}

@media (min-width: 1200px){
  .container{
    max-width:1320px;
  }
}

body.auth-screen .header-nav{
  display:none !important;
}
