/* =========================
   Wodoh — Modern Glow UI
========================= */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;800&family=Inter:wght@400;600;700;800&display=swap');

:root{
  --bg0:#070A14;
  --bg1:#0B1020;

  --p1:#7C3AED;
  --p2:#22D3EE;
  --p3:#3B82F6;

  --text:#EAF0FF;
  --muted:#AAB7E6;

  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.12);
  --stroke2: rgba(255,255,255,.18);

  --ok:#22C55E;
  --bad:#EF4444;

  --r: 22px;
  --shadow: 0 22px 70px rgba(0,0,0,.55);
  --shadow2: 0 12px 34px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Inter","Cairo",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* Background glow blobs */
.bg-glow{
  position: fixed;
  inset: auto;
  width: 900px;
  height: 900px;
  border-radius: 999px;
  filter: blur(70px);
  opacity: .25;
  z-index: -1;
  pointer-events:none;
}
.g1{ left:-320px; top:-360px; background: radial-gradient(circle, var(--p1), transparent 60%); }
.g2{ right:-360px; top:-260px; background: radial-gradient(circle, var(--p2), transparent 60%); opacity:.22; }
.g3{ left:20%; bottom:-520px; background: radial-gradient(circle, var(--p3), transparent 60%); opacity:.20; }

/* Container */
.container{
  width:min(980px, 92vw);
  margin: 34px auto;
  padding: 18px;
}

/* Buttons */
.btn{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor:pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease, opacity .14s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: var(--stroke2);
}
.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }

.btn-primary{
  border:none;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  box-shadow: 0 18px 55px rgba(124,58,237,.22);
}
.btn-primary:hover{ box-shadow: 0 22px 68px rgba(124,58,237,.30); }
.btn-ghost{ background: rgba(255,255,255,.04); }
.btn-soft{ background: rgba(255,255,255,.05); }
.btn-danger{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.28);
}
.btn-danger:hover{
  background: rgba(239,68,68,.16);
  border-color: rgba(239,68,68,.40);
}
.btn-wide{ padding: 12px 18px; }

/* =========================
   Landing
========================= */
.landing{
  min-height: 100vh;
  display:grid;
  place-items:center;
  padding: 24px;
}
.landing-card{
  width:min(980px, 92vw);
  border-radius: calc(var(--r) + 8px);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative; /* needed for landing logo corner */
}

.badge{ display:none; }

.title{
  margin: 16px 0 8px;
  font-size: 34px;
  font-weight: 1000;
  letter-spacing: .2px;
  text-shadow: 0 2px 18px rgba(124,58,237,.18);
  text-align:center;
}
.subtitle{
  margin: 0 0 16px;
  color: rgba(170,183,230,.95);
  line-height: 1.7;
  font-size: 15px;
  text-align:center;
}
.features{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 14px;
}
.feat{
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.16);
  border-radius: 16px;
  padding: 12px 12px;
  font-weight: 900;
  color: rgba(234,240,255,.94);
  text-align:center;
}
.cta{
  display:flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap:wrap;
  justify-content:center;
}
.note{
  margin-top: 16px;
  text-align: center;
  line-height: 1.6;
}
.note-ar{
  display:block;
  font-weight: 600;
  font-size: 15px;
  color: #e5e7eb;
}
.note-en{
  display:block;
  font-size: 13px;
  color: rgba(203,213,225,.85);
  margin-top: 4px;
  letter-spacing: .3px;
}

/* Landing logo corner */
.landing-logo-corner{
  position: absolute;
  top: 18px;
  width: 170px;
  height: 170px;
  border-radius: 28px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow:
    0 26px 75px rgba(0,0,0,.52),
    0 0 45px rgba(34,211,238,.18),
    inset 0 0 18px rgba(255,255,255,.10);
  z-index: 5;
}
.landing-logo-img{
  width: 82%;
  height: 82%;
  object-fit: contain;
  display:block;
}
html[dir="rtl"] .landing-logo-corner{ right: 18px; left: auto; }
html[dir="ltr"] .landing-logo-corner{ left: 18px; right: auto; }

/* Landing big brand */
.brand-inline{
  display:block;
  font-size:56px;
  font-weight:800;
  letter-spacing:1px;
  color:#fff;
  margin-bottom:4px;
}
.brand-inline-en{
  display:block;
  font-size:28px;
  font-weight:600;
  opacity:.85;
  margin-bottom:18px;
  color:#cfd8ff;
}

/* =========================
   Header (App)
========================= */
.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;

  padding:16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-bottom: 14px;

  position: relative;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
html[dir="rtl"] .brand{ padding-right: 96px; padding-left: 0; }
html[dir="ltr"] .brand{ padding-left: 96px; padding-right: 0; }

.brand-text{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.brand-lines{
  display:flex;
  flex-direction:column;
  line-height: 1.05;
}
.brand-ar{
  font-family:"Cairo",system-ui,sans-serif;
  font-weight:900;
  font-size:30px;
  color: rgba(234,240,255,.98);
  text-shadow: 0 0 18px rgba(124,58,237,.25);
}
.brand-en{
  font-family:"Inter",system-ui,sans-serif;
  font-weight:800;
  font-size:14px;
  color: rgba(170,183,230,.92);
  letter-spacing:.6px;
}
.brand-desc{
  display:flex;
  flex-direction:column;
  gap:2px;
  max-width:560px;
}
.desc-ar{
  direction: rtl;
  unicode-bidi: plaintext;
  font-family:"Cairo",system-ui,sans-serif;
  font-size:13px;
  color: rgba(170,183,230,.95);
  line-height:1.5;
}
.desc-en{
  direction:ltr;
  unicode-bidi: plaintext;
  font-family:"Inter",system-ui,sans-serif;
  font-size:12px;
  color: rgba(170,183,230,.78);
  line-height:1.45;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.header-logo-corner{
  position:absolute;
  top:14px;
  width: 84px;
  height: 84px;
  border-radius: 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 22px rgba(0,0,0,.25);
  z-index: 5;
  pointer-events:none;
}
html[dir="rtl"] .header-logo-corner{ right: 14px; left: auto; }
html[dir="ltr"] .header-logo-corner{ left: 14px; right: auto; }

.header-logo-img{
  width: 78%;
  height: 78%;
  object-fit: contain;
  display:block;
}

/* =========================
   Panel
========================= */
.panel{
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  box-shadow: var(--shadow2);
  padding: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.label{
  display:block;
  font-weight: 1000;
  margin-bottom: 8px;
  color: rgba(234,240,255,.95);
}

/* Textarea */
textarea{
  width:100%;
  min-height: 160px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  outline:none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
textarea::placeholder{ color: rgba(170,183,230,.78); }
textarea:focus{
  border-color: rgba(34,211,238,.45);
  background: rgba(255,255,255,.06);
  box-shadow: 0 0 0 4px rgba(34,211,238,.12), 0 12px 34px rgba(0,0,0,.40);
}

/* Uploader */
.uploader{
  margin-top: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,.22);
  background: rgba(255,255,255,.03);
  padding: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.uploader.dragover{
  border-color: rgba(34,211,238,.60);
  background: rgba(34,211,238,.08);
}
.uploader-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}
.uploader-title{ font-weight: 1000; color: rgba(255,255,255,.92); }
.uploader-body{ display:flex; flex-direction:column; gap:10px; }
.uploader-hint{ font-size: 13px; color: rgba(170,183,230,.90); }
.file-preview{
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.22);
  padding: 10px 12px;
}
.file-name{ font-weight: 1000; }
.file-meta{ font-size: 12px; color: rgba(170,183,230,.82); margin-top:2px; }

/* Controls */
.controls{ display:flex; justify-content:flex-end; margin-top: 14px; }

/* Output */
.output{ margin-top: 16px; display:grid; gap:14px; }
.card{
  border-radius: var(--r);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  box-shadow: var(--shadow2);
  padding: 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  margin-bottom: 24px;
}
.card h3{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 1000;
  display:flex;
  gap:8px;
  align-items:center;
}
.card ul{ margin:0; padding-inline-start: 18px; line-height:1.9; }
.card li{ margin:6px 0; color: rgba(234,240,255,.94); }

/* Toast */
.toast{
  position: fixed;
  bottom: 18px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(10,12,24,.92);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 999;
  font-weight: 900;
}

/* Footer */
.footer{
  margin-top: 22px;
  text-align:center;
  color: rgba(170,183,230,.78);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 640px){
  .title{ font-size: 26px; }
  .features{ grid-template-columns: 1fr; }
  .header{ flex-direction: column; align-items: stretch; }
  .header-actions{ justify-content:flex-end; width:100%; flex-wrap:wrap; }
  .controls{ justify-content: stretch; }
  .btn-wide{ width:100%; }
  .brand-desc{ max-width: 100%; }

  .landing-logo-corner{
    width: 120px;
    height: 120px;
    border-radius: 22px;
    top: 14px;
  }
  html[dir="rtl"] .landing-logo-corner{ right: 14px; left: auto; }
  html[dir="ltr"] .landing-logo-corner{ left: 14px; right: auto; }

  .header-logo-corner{
    width: 70px;
    height: 70px;
    border-radius: 16px;
    top: 12px;
  }
  html[dir="rtl"] .header-logo-corner{ right: 12px; left: auto; }
  html[dir="ltr"] .header-logo-corner{ left: 12px; right: auto; }

  html[dir="rtl"] .brand{ padding-right: 82px; }
  html[dir="ltr"] .brand{ padding-left: 82px; }
}

/* =========================
   QUIZ DESIGN
========================= */
.q {
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.q > div:first-child {
  font-weight: 900;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 14px;
  color: #F8FAFF;
}
.q .options, .q { display: grid; gap: 10px; }
.q button[data-opt]{
  width: 100%;
  text-align: right;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: #EAF0FF;
  font-weight: 700;
  transition: all .15s ease;
}

/* hover محايد */
.q button[data-opt]:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

.q button.correct{
  background: rgba(34,197,94,0.20);
  border-color: rgba(34,197,94,0.5);
  color: #ECFDF5;
}
.q button.wrong{
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.45);
  color: #FEF2F2;
}
.q button:disabled{
  cursor: not-allowed;
  opacity: .85;
}

/* Generate button loading state */
#generateBtn.is-loading{
  filter: brightness(0.8);
  opacity: .92;
  cursor: wait;
  transform: translateY(1px);
}
#generateBtn{
  transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}

/* OVERRIDES: تمنع أي أزرق بالأسئلة */
.q button[data-opt]{
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}
.q button[data-opt]:focus,
.q button[data-opt]:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}
.q button[data-opt]:active{ transform: translateY(0px); }

/* More button */
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #EAF0FF;
  font-family: "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}
.more-btn .plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C3AED, #22D3EE);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: bold;
}
.more-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.25),
    rgba(34, 211, 238, 0.25)
  );
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.more-btn:active { transform: scale(0.96); }

/* FORCE instant feedback */
.q button[data-opt].wrong,
.q .opt.wrong{
  background: rgba(239,68,68,.16) !important;
  border-color: rgba(239,68,68,.55) !important;
  color: #FEF2F2 !important;
}
.q button[data-opt].correct,
.q .opt.correct{
  background: rgba(34,197,94,.18) !important;
  border-color: rgba(34,197,94,.55) !important;
  color: #ECFDF5 !important;
}
.q button[data-opt].wrong:hover,
.q .opt.wrong:hover,
.q button[data-opt].correct:hover,
.q .opt.correct:hover{ transform: none !important; }

/* =========================
   Pro Auth Modal
========================= */
.modal-card.auth-pro{
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(11,16,32,.96), rgba(11,16,32,.90));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 26px 80px rgba(0,0,0,.55);
}

.auth-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}
.auth-title{
  font-weight:1000;
  font-size:18px;
  margin:0;
}
.auth-subtitle{
  margin:6px 0 0;
  font-size:13px;
  color: rgba(170,183,230,.85);
  line-height: 1.6;
}

.auth-close{
  width:38px;
  height:38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(234,240,255,.92);
  cursor:pointer;
}
.auth-close:hover{ background: rgba(255,255,255,.08); }

.auth-form{
  display:grid;
  gap:12px;
  margin-top: 10px;
}

.field{ display:grid; gap:8px; }
.field-label{
  font-weight:900;
  color: rgba(234,240,255,.92);
  font-size: 13px;
}
.field-control{ position: relative; }

.field input{
  width:100%;
  padding: 12px 44px 12px 14px; /* LTR */
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(234,240,255,.95);
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
html[dir="rtl"] .field input{ padding: 12px 14px 12px 44px; }

.field input:focus{
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 0 0 4px rgba(255,255,255,.06);
  background: rgba(255,255,255,.06);
}

.icon-btn{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width:34px;
  height:34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(234,240,255,.88);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
html[dir="ltr"] .icon-btn{ right: 8px; }
html[dir="rtl"] .icon-btn{ left: 8px; }

.icon-btn:hover{ background: rgba(255,255,255,.08); }
.icon-btn:focus{ outline:none; box-shadow:none; }

.auth-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size: 13px;
  color: rgba(170,183,230,.9);
  user-select:none;
}
.check input{ width: 16px; height: 16px; }

.link-btn{
  background: none;
  border: none;
  color: rgba(234,240,255,.9);
  cursor:pointer;
  font-weight: 800;
  font-size: 13px;
  padding: 0;
  opacity: .9;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover{ opacity: 1; }

.auth-alert{
  display:none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  font-size: 13px;
  line-height: 1.6;
}
.auth-alert.err{
  display:block;
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.10);
}
.auth-alert.ok{
  display:block;
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.10);
}

.auth-actions{
  display:flex;
  gap:10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.auth-actions .btn{ flex:1; }
.auth-actions .btn-secondary{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
}

.auth-divider{
  margin: 10px 0 0;
  height: 1px;
  background: rgba(255,255,255,.10);
}

.logout-area{
  margin-top: 10px;
  display:none;
}
.logout-area.show{ display:block; }

/* Name fields in 2 columns when signup */
.auth-names{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 520px){
  .auth-names{ grid-template-columns: 1fr; }
}
.auth-form .field{ margin-bottom: 10px; }

/* =========================
   ✅ FIXED: Modal Center + Tabs
========================= */

/* overlay */
.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none;               /* JS يفتحها flex */
  align-items: center;
  justify-content: center;

  padding: 18px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal[style*="display: flex"]{
  display: flex !important;
}

.modal .modal-card{
  width: min(560px, 92vw);
  max-height: min(78vh, 720px);
  overflow: auto;

  border-radius: 22px;
  margin: 0 !important;
}

/* Tabs (Login / Signup) - generic */
.auth-tabs{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
}
.auth-tabs button{
  flex: 1;
  max-width: 160px;
  padding: 10px 14px;
  border-radius: 14px;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  color: #EAF0FF;

  font-weight: 900;
  cursor: pointer;
  transition: all .2s ease;

  position: relative;
  top: auto;
  left: auto;
  right: auto;
}
.auth-tabs button:hover{
  background: rgba(255,255,255,.10);
}
.auth-tabs button.active{
  background: linear-gradient(135deg, var(--p1), var(--p2));
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(124,58,237,.35);
}
html[dir="rtl"] .auth-tabs{ flex-direction: row-reverse; }

/* =========================
   Account modal — better tabs/buttons (FINAL)
========================= */
#accountModal .modal-card{
  max-width: 520px;
}

#accountModal .modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

#accountModal #accountClose{
  width:40px;
  height:40px;
  border-radius:999px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
  color: var(--text);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
#accountModal #accountClose:hover{
  background:rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
  transform: translateY(-1px);
}

/* ✅ Account tabs (matches your HTML: #accountModal .auth-tabs) */
#accountModal .auth-tabs{
  display:flex;
  gap: 0;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  width: 100%;
  justify-content: center;
  margin: 12px 0 18px;
}

#accountModal .auth-tabs button{
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(234,240,255,.86);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
}

#accountModal .auth-tabs button:hover{
  background: rgba(255,255,255,.07);
  transform: translateY(-1px);
}

#accountModal .auth-tabs button.active{
  background: linear-gradient(90deg, rgba(124,58,237,.85), rgba(34,211,238,.60));
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

html[dir="rtl"] #accountModal .auth-tabs{ flex-direction: row-reverse; }

/* ✅ Make auth primary button nicer inside modal */
#accountModal #authSubmit.btn{
  border-radius: 16px;
  height: 46px;
  font-weight: 900;
  letter-spacing: .2px;
}

/* ✅ Inputs inside modal look cleaner */
#accountModal .auth-form .field input{
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
#accountModal .auth-form .field input:focus{
  outline: none;
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 0 0 4px rgba(124,58,237,.18);
}
/* =========================
   Subscribe Modal – Premium UI
========================= */
.modal{
  position: fixed;
  inset: 0;
  display: none;               /* أنت تستعمل openModal => flex */
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(10px);
  z-index: 9999;
}

.modal-card{
  width: min(560px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10,14,30,.72);
  box-shadow: 0 22px 70px rgba(0,0,0,.55);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.modal-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(900px 240px at 10% 0%,
    rgba(124,58,237,.22), transparent 55%),
    radial-gradient(900px 240px at 90% 0%,
    rgba(34,211,238,.18), transparent 55%);
  pointer-events:none;
  filter: blur(0px);
}

.modal-x{
  position: absolute;
  top: 12px;
  inset-inline-start: 12px; /* RTL/LTR friendly */
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.modal-x:hover{
  transform: scale(1.03);
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.18);
}

.sub-head{
  padding: 10px 10px 6px;
  margin-inline-start: 44px; /* space for X button */
}
.sub-title{
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .2px;
  color: rgba(255,255,255,.96);
}
.sub-subtitle{
  margin-top: 6px;
  opacity: .80;
  line-height: 1.6;
}

.sub-plans{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.plan{
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  position: relative;
  overflow: hidden;
}
.plan:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
}
.plan.active{
  border-color: rgba(34,211,238,.45);
  box-shadow: 0 10px 40px rgba(34,211,238,.12);
}
.plan-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.plan-name{
  font-weight: 800;
  color: rgba(255,255,255,.95);
}
.plan-badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  opacity: .95;
}
.plan-badge.best{
  border-color: rgba(124,58,237,.35);
  background: rgba(124,58,237,.14);
}
.plan-price{
  margin-top: 10px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .3px;
}
.plan-price span{
  font-size: 13px;
  opacity: .75;
  font-weight: 700;
  margin-left: 4px;
}
.plan-desc{
  margin-top: 6px;
  font-size: 13px;
  opacity: .80;
}

.sub-pay{
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.sub-pay-title{
  font-weight: 800;
  margin-bottom: 10px;
}
.paypal-box{
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
}

/* PayPal iframe/buttons spacing */
#paypalButtons > div{
  margin: 0 auto;
}

/* Footer text */
.sub-foot{
  margin-top: 10px;
  font-size: 13px;
  opacity: .78;
  line-height: 1.6;
}

/* Mobile */
@media (max-width: 520px){
  .sub-plans{ grid-template-columns: 1fr; }
  .sub-head{ margin-inline-start: 44px; }
}
