/* Ported from the prototype's auth.css — kept in the 'legacy' cascade layer so Tailwind utilities can override it. */
@layer legacy {
/* =========================================================
   الأترجة — تسجيل الدخول / إنشاء حساب
   ---------------------------------------------------------
   From skeleton-waitlist.framer.website: one large rounded
   container on a soft blurred ground; a tall image card on one
   side carrying a WebGL liquid effect (the pointer leaves ripples
   that bend the picture), the form on the other side with thin
   corner curves. Here: RTL, warm cream and sage, a Qur'an-study
   scene in natural light, the brand's gold for the fine lines.
   ========================================================= */

.auth-page{
  --a-bg:     #F4EEE2;
  --a-card:   #FBF8F1;
  --a-ink:    var(--u-forest);
  --a-sub:    #5A6963;
  --a-muted:  #87938D;
  --a-line:   rgba(18,60,53,.12);
  --a-field:  #FFFDF8;
  --a-err:    #A8452E;
  --a-out:    cubic-bezier(.2,.7,.2,1);
  min-height:100vh;
  margin:0;
  color:var(--a-ink);
  background:var(--a-bg);
}
.auth-page *{ box-sizing:border-box; }
svg:where(:has(> use[href^="#i-"])){ width:1em; height:1em; flex:none; }
.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---- the page ground: the same photograph, blurred and veiled ---- */
.a-ground{ position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none; background:#B79E74; }
.a-ground img{
  position:absolute; inset:-60px;
  width:calc(100% + 120px); height:calc(100% + 120px);
  object-fit:cover;
  filter:blur(36px) saturate(1.15);
  transform:scale(1.08);
  animation:a-breathe 26s ease-in-out infinite alternate;
}
/* a warm veil keeps the container and the copy calm on top */
.a-ground::after{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(248,243,231,.35), rgba(248,243,231,.12) 70%),
    rgba(244,236,220,.22);
}
@keyframes a-breathe{ to{ transform:scale(1.16) translate(-1.5%, 1%); } }

/* ---- page frame ---- */
.a-shell{
  min-height:100vh;
  display:flex; flex-direction:column;
  max-width:1240px;
  margin:0 auto;
  padding:22px 28px 26px;
}
.a-top{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.a-top .brand{ color:var(--a-ink); }
.a-top .brand-mark{ width:38px; height:38px; border-radius:11px; }
.a-top .brand-text{ font-size:21px; color:var(--a-ink); }
.a-back{
  display:inline-flex; align-items:center; gap:8px;
  height:40px; padding:0 14px;
  border-radius:99px;
  font-size:14.5px; font-weight:500;
  color:var(--a-sub);
  background:rgba(255,253,248,.82);
  border:1px solid rgba(255,255,255,.7);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  transition:color .25s var(--ease), border-color .25s var(--ease);
}
.a-back svg{ width:16px; height:16px; transform:scaleX(-1); }
.a-back:hover{ color:var(--a-ink); border-color:rgba(176,143,62,.45); }

/* ---- the container ---- */
.a-box{
  position:relative;
  flex:1;
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, .92fr);   /* RTL: form on the right */
  gap:12px;
  padding:12px;
  border-radius:32px;
  background:rgba(251,248,241,.86);
  -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,.9);
  box-shadow:0 1px 0 rgba(255,255,255,.9) inset, 0 40px 80px -50px rgba(18,60,53,.45);
  overflow:hidden;
  animation:a-in .9s var(--a-out) both;
}
@keyframes a-in{ from{ opacity:0; transform:translateY(16px) scale(.99); } }

/* the homepage thread (about.css .thread): a gold line with a wavering,
   hand-drawn edge from the turbulence filter; it draws itself in */
.a-thread{ position:absolute; z-index:0; overflow:visible; pointer-events:none; }
.a-thread path{
  fill:none;
  stroke:var(--gold);
  stroke-width:24;                             /* drawn at ~1/3 scale: reads as the homepage 7px */
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:url(#a-rough);
  stroke-dasharray:var(--len, 2400);
  stroke-dashoffset:var(--len, 2400);
  animation:a-draw 2.4s var(--ease) .5s forwards;
}
@keyframes a-draw{ to{ stroke-dashoffset:0; } }
/* one strand comes down from the top beside the picture, one turns in the far corner */
.a-thread--top{ top:-30px; left:calc(47% - 10px); width:190px; height:300px; }
.a-thread--bottom{ bottom:-40px; right:-30px; width:220px; height:240px; transform:scale(-1, -1); }

/* =========================================================
   the form side
   ========================================================= */
.a-form-side{
  position:relative; z-index:1;
  display:flex; flex-direction:column; justify-content:center;
  padding:46px 56px 40px;
}
.a-badge{
  align-self:flex-start;
  display:inline-flex; align-items:center; gap:8px;
  margin:0;
  padding:6px 14px;
  border-radius:99px;
  font-size:13.5px; font-weight:600;
  color:var(--gold-deep);
  background:rgba(212,175,90,.13);
  border:1px solid rgba(176,143,62,.22);
}
.a-badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--gold); }
.a-title{ margin:18px 0 0; font-size:clamp(30px, 3vw, 42px); line-height:1.3; font-weight:700; color:var(--a-ink); }
.a-lead{ margin:12px 0 0; max-width:440px; font-size:16px; line-height:1.85; color:var(--a-sub); }

/* social proof: stacked avatars + count (RTL, so it sits on the right) */
.a-joined{ display:flex; align-items:center; gap:12px; margin:18px 0 0; }
.a-joined-avs{ display:flex; }
.a-joined-avs img{ width:34px; height:34px; border-radius:50%; object-fit:cover; border:2px solid var(--a-card); }
.a-joined-avs img + img{ margin-inline-start:-10px; }
.a-joined-txt{ font-size:14px; font-weight:500; color:var(--a-muted); }

.a-form{ margin-top:28px; display:flex; flex-direction:column; gap:16px; }
.a-row2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }

/* fields */
.fld{ display:flex; flex-direction:column; gap:7px; }
.fld > label{ font-size:14px; font-weight:600; color:var(--a-ink); }
.fld-box{ position:relative; }
.fld input, .fld select{
  width:100%;
  height:54px;
  padding:0 16px;
  border:1px solid rgba(18,60,53,.16);
  border-radius:15px;
  background:var(--a-field);
  font:inherit; font-size:15.5px;
  color:var(--a-ink);
  transition:border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  -webkit-appearance:none; appearance:none;
}
.fld select{
  padding-inline-end:44px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2387938D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-size:18px;
  background-position:left 16px center;
}
.fld input::placeholder{ color:#A3ACA7; }
.fld input:hover, .fld select:hover{ border-color:rgba(18,60,53,.28); }
.fld input:focus, .fld select:focus{
  outline:none;
  border-color:var(--u-forest);
  background:#fff;
  box-shadow:0 0 0 4px rgba(18,60,53,.09);
}
.fld input[dir="ltr"]{ text-align:right; }
.fld input[dir="ltr"]::placeholder{ text-align:right; }

/* password: show / hide */
.fld-eye{
  position:absolute; top:50%; left:8px;
  width:40px; height:40px;
  margin-top:-20px;
  display:grid; place-items:center;
  border:0; border-radius:11px;
  background:none;
  color:var(--a-muted);
  cursor:pointer;
  transition:color .2s var(--ease), background .2s var(--ease);
}
.fld-eye:hover{ color:var(--a-ink); background:rgba(18,60,53,.05); }
.fld-eye svg{ width:19px; height:19px; }
.fld-eye .i-off{ display:none; }
.fld-eye[aria-pressed="true"] .i-on{ display:none; }
.fld-eye[aria-pressed="true"] .i-off{ display:block; }
.fld-box.has-eye input{ padding-inline-end:16px; padding-left:54px; }

/* errors: an icon and words, a restrained colour */
.fld-err{
  display:none;
  align-items:center; gap:6px;
  font-size:13px; font-weight:500;
  color:var(--a-err);
}
.fld-err svg{ width:15px; height:15px; }
.fld.is-bad .fld-err{ display:flex; }
.fld.is-bad input, .fld.is-bad select{ border-color:rgba(168,69,46,.55); background:#FFFBF8; }
.fld.is-bad input:focus, .fld.is-bad select:focus{ box-shadow:0 0 0 4px rgba(168,69,46,.1); }
.fld-hint{ font-size:12.5px; color:var(--a-muted); }

/* strength (register) */
.pw-meter{ display:flex; align-items:center; gap:10px; margin-top:2px; }
.pw-bars{ flex:1; display:grid; grid-template-columns:repeat(4, 1fr); gap:5px; }
.pw-bars i{ height:5px; border-radius:99px; background:rgba(18,60,53,.09); transition:background .3s var(--ease); }
.pw-meter[data-s="1"] .pw-bars i:nth-child(-n+1){ background:#C9806B; }
.pw-meter[data-s="2"] .pw-bars i:nth-child(-n+2){ background:#D4AF5A; }
.pw-meter[data-s="3"] .pw-bars i:nth-child(-n+3){ background:#8DB39B; }
.pw-meter[data-s="4"] .pw-bars i{ background:#2F6B4F; }
.pw-meter small{ min-width:52px; font-size:12.5px; font-weight:600; color:var(--a-muted); text-align:left; }

/* utility row (login) */
.a-util{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:-2px; }
.a-check{ display:inline-flex; align-items:center; gap:10px; font-size:14.5px; color:var(--a-sub); cursor:pointer; }
.a-check input{ position:absolute; opacity:0; pointer-events:none; }
.a-check .box{
  width:20px; height:20px;
  display:grid; place-items:center;
  border-radius:6px;
  border:1.5px solid rgba(18,60,53,.28);
  color:transparent;
  transition:background .2s var(--ease), border-color .2s var(--ease);
}
.a-check .box svg{ width:13px; height:13px; }
.a-check input:checked + .box{ background:var(--u-forest); border-color:var(--u-forest); color:var(--gold-light); }
.a-check input:focus-visible + .box{ outline:2px solid var(--gold); outline-offset:2px; }
.a-link{ font-size:14.5px; font-weight:600; color:var(--u-forest); text-decoration:underline; text-decoration-color:rgba(176,143,62,.5); text-underline-offset:4px; }
.a-link:hover{ text-decoration-color:var(--gold-deep); }

/* submit */
.a-submit{
  position:relative;
  display:flex; align-items:center; justify-content:center; gap:10px;
  height:56px;
  margin-top:6px;
  border:0; border-radius:16px;
  font:inherit; font-size:16.5px; font-weight:600;
  color:var(--u-ivory);
  background:var(--u-forest);
  box-shadow:0 18px 32px -20px rgba(18,60,53,.9);
  cursor:pointer;
  transition:background .3s var(--ease), transform .3s var(--ease);
}
.a-submit:hover{ background:#0E322C; }
.a-submit:active{ transform:translateY(1px); }
.a-submit:focus-visible{ outline:2px solid var(--gold); outline-offset:3px; }
.a-submit svg{ width:18px; height:18px; color:var(--gold-light); }
.a-submit .spin{ display:none; width:20px; height:20px; border-radius:50%; border:2px solid rgba(248,243,231,.3); border-top-color:var(--gold-light); animation:a-spin .8s linear infinite; }
.a-submit.is-busy{ cursor:progress; background:#24524A; }
.a-submit.is-busy .lbl, .a-submit.is-busy svg{ visibility:hidden; }
.a-submit.is-busy .spin{ display:block; position:absolute; }
@keyframes a-spin{ to{ transform:rotate(360deg); } }

.a-alt{ margin:18px 0 0; font-size:14.5px; color:var(--a-sub); text-align:center; }
.a-help{ margin:-4px 0 0; display:flex; align-items:flex-start; gap:8px; font-size:13px; line-height:1.7; color:var(--a-muted); }
.a-help svg{ width:16px; height:16px; margin-top:2px; color:var(--gold-deep); }
.a-form-msg{ display:none; align-items:center; gap:8px; padding:12px 14px; border-radius:13px; font-size:14px; color:var(--a-err); background:rgba(168,69,46,.07); }
.a-form-msg.is-on{ display:flex; }
.a-form-msg svg{ width:17px; height:17px; }

/* role selector (register) */
.roles{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:26px 0 0; padding:0; border:0; }
.roles legend{ padding:0; margin-bottom:10px; font-size:14px; font-weight:600; }
.role{ position:relative; cursor:pointer; }
.role input{ position:absolute; opacity:0; pointer-events:none; }
.role-card{
  display:flex; flex-direction:column; gap:6px;
  height:100%;
  padding:16px 16px 16px 44px;
  border-radius:18px;
  border:1.5px solid rgba(18,60,53,.13);
  background:var(--a-field);
  transition:border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.role-card b{ display:flex; align-items:center; gap:9px; font-size:16.5px; font-weight:700; }
.role-card b svg{ width:22px; height:22px; padding:3px; border-radius:8px; color:var(--gold-deep); background:rgba(212,175,90,.14); }
.role-card span{ font-size:13.5px; line-height:1.7; color:var(--a-sub); }
.role-tick{
  position:absolute; top:14px; left:14px;
  width:22px; height:22px;
  display:grid; place-items:center;
  border-radius:50%;
  border:1.5px solid rgba(18,60,53,.22);
  color:transparent;
  transition:all .25s var(--ease);
}
.role-tick svg{ width:13px; height:13px; }
.role:hover .role-card{ border-color:rgba(18,60,53,.28); }
.role input:checked + .role-card{ border-color:#7FA88E; background:#EAF2EC; box-shadow:0 12px 24px -20px rgba(18,60,53,.6); }
.role input:checked ~ .role-tick{ background:var(--u-forest); border-color:var(--u-forest); color:var(--gold-light); }
.role input:focus-visible + .role-card{ outline:2px solid var(--gold); outline-offset:2px; }

/* teacher-only fields */
.for-teacher{ display:none; }
.a-form-side[data-role="teacher"] .for-teacher{ display:flex; }

/* success state */
.a-done{ display:none; flex-direction:column; align-items:flex-start; gap:14px; animation:a-in .7s var(--a-out) both; }
.a-form-side.is-done .a-form-body{ display:none; }
.a-form-side.is-done .a-done{ display:flex; }
.a-done-ico{
  width:64px; height:64px;
  display:grid; place-items:center;
  border-radius:20px;
  color:var(--gold-light);
  background:var(--u-forest);
  box-shadow:0 18px 30px -18px rgba(18,60,53,.9);
}
.a-done-ico svg{ width:30px; height:30px; }
.a-done h2{ margin:8px 0 0; font-size:32px; line-height:1.3; font-weight:700; }
.a-done p{ margin:0; max-width:420px; font-size:16px; line-height:1.85; color:var(--a-sub); }
.a-done .a-submit{ align-self:stretch; margin-top:12px; text-decoration:none; }

/* =========================================================
   the visual side
   ========================================================= */
.a-visual{
  position:relative;
  isolation:isolate;
  min-height:560px;
  border-radius:24px;
  overflow:hidden;
  background:#C9B48A;
}
.a-visual > img, .a-liquid{
  position:absolute; inset:0; z-index:-2;
  width:100%; height:100%;
}
.a-visual > img{ object-fit:cover; object-position:50% 50%; animation:a-zoom 18s ease-out forwards; }
@keyframes a-zoom{ from{ transform:scale(1.08); } to{ transform:scale(1); } }
.a-liquid{ opacity:0; transition:opacity .8s var(--ease); }
.a-visual.has-liquid .a-liquid{ opacity:1; }
.a-visual.has-liquid > img{ visibility:hidden; }

/* a calm forest fade so the words read */
.a-visual::after{
  content:""; position:absolute; inset:0; z-index:-1;
  background:
    linear-gradient(to bottom, rgba(7,31,26,.42) 0%, rgba(7,31,26,0) 26%),
    linear-gradient(to top, rgba(7,31,26,.62) 0%, rgba(7,31,26,0) 46%);
  pointer-events:none;
}
.a-v-top{
  position:absolute; top:28px; right:28px;
  display:flex; flex-direction:column; gap:12px;
  font-size:13px; font-weight:600; letter-spacing:.4px;
  color:rgba(248,243,231,.92);
}
.a-v-top i{ display:block; width:42px; height:1.5px; background:var(--gold-light); opacity:.8; }

.a-quote{
  position:absolute; right:22px; left:22px; bottom:22px;
  padding:18px 20px;
  border-radius:18px;
  color:var(--u-ivory);
  background:rgba(7,31,26,.32);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border:1px solid rgba(248,243,231,.18);
}
.a-quote p{ margin:0; font-size:22px; line-height:1.6; font-weight:600; }
.a-quote small{ display:block; margin-top:6px; font-size:13px; color:rgba(248,243,231,.7); }

/* tiny floating motes */
.a-motes{ position:absolute; inset:0; z-index:0; pointer-events:none; }
.a-motes span{
  position:absolute;
  width:var(--s, 3px); height:var(--s, 3px);
  border-radius:50%;
  background:rgba(255,240,200,.85);
  box-shadow:0 0 8px rgba(255,236,190,.8);
  opacity:0;
  animation:a-mote var(--t, 14s) ease-in-out var(--d, 0s) infinite;
}
@keyframes a-mote{
  0%  { opacity:0; transform:translate(0, 0); }
  20% { opacity:.9; }
  80% { opacity:.6; }
  100%{ opacity:0; transform:translate(var(--dx, -20px), -90px); }
}

/* =========================================================
   responsive
   ========================================================= */
@media (max-width:1080px){
  .a-form-side{ padding:40px 36px 34px; }
}

/* tablet & phone: one column, form first, a shorter calmer visual */
@media (max-width:860px){
  .a-shell{ padding:16px 14px 20px; }
  .a-box{ grid-template-columns:1fr; border-radius:26px; padding:10px; }
  .a-form-side{ padding:30px 18px 24px; }
  .a-visual{ order:2; min-height:240px; }
  .a-quote p{ font-size:18px; }
  .a-thread, .a-motes{ display:none; }
}
@media (max-width:520px){
  .a-row2{ grid-template-columns:1fr; }
  .roles{ grid-template-columns:1fr; }
  .a-back span{ display:none; }
  .a-visual{ min-height:200px; }
  .a-quote{ padding:14px 16px; }
}

@media (prefers-reduced-motion:reduce){
  .a-ground img, .a-motes span, .a-visual > img, .a-box, .a-done{ animation:none; }
  .a-thread path{ animation:none; stroke-dashoffset:0; }
  .a-motes{ display:none; }
}


/* =========================================================
   DEMO ENTRY — three direct links to the dashboards, for the
   review period only. Remove with the block in login.html.
   ========================================================= */
.a-demo{ margin-top:22px; padding:14px; border:1.5px dashed rgba(176,143,62,.45); border-radius:18px; background:rgba(212,175,90,.07); }
.a-demo-h{ display:flex; align-items:center; justify-content:center; gap:8px; margin:0 0 10px; font-size:13.5px; font-weight:700; color:#8A6514; }
.a-demo-h small{ padding:2px 8px; border-radius:99px; background:rgba(212,175,90,.18); font-size:11.5px; font-weight:600; }
.a-demo-btns{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.a-demo-btn{
  display:grid; justify-items:center; gap:1px; padding:10px 6px;
  border:1px solid rgba(18,60,53,.16); border-radius:14px; background:#fff;
  color:#123C35; text-decoration:none; text-align:center;
  transition:background .25s, color .25s, border-color .25s, transform .25s;
}
.a-demo-btn b{ font-size:15px; font-weight:700; }
.a-demo-btn small{ font-size:12px; color:#66736D; transition:color .25s; }
.a-demo-btn:hover, .a-demo-btn:focus-visible{ background:#123C35; border-color:#123C35; color:#F8F5ED; transform:translateY(-2px); outline:none; }
.a-demo-btn:hover small, .a-demo-btn:focus-visible small{ color:rgba(248,245,237,.75); }
@media (max-width:420px){ .a-demo-btns{ grid-template-columns:minmax(0, 1fr); } .a-demo-btn{ grid-auto-flow:column; justify-content:space-between; padding:12px 14px; } }

}
