/* ============================================================
   شاشات المصادقة — النسق النوراني الهندسي (Login / Register)
   ============================================================ */

:root {
  --primary-purple: #9B59B6;
  --secondary-purple: #8E44AD;
  --deep-purple: #5B2C6F;
  --light-purple: #E8D5F2;
  --very-light-purple: #F8E8FF;
  --soft-pink: #F8B4D9;
  --gold: #D4AF7A;
  --white: #FFFFFF;
  --text-dark: #2C3E50;
  --text-light: #7D8FA3;
  --font-primary: 'Cairo', sans-serif;
  --font-secondary: 'Amiri', serif;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  --bg-main: #fdfbff;
  --card-bg: rgba(255, 255, 255, 0.82);
  --border-color: rgba(155, 89, 182, 0.18);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- الإطار العام ---------- */
.auth-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vw, 72px) 0;
  font-family: var(--font-primary);
  color: var(--text-dark);
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(248, 180, 217, .20), transparent 62%),
    radial-gradient(760px 520px at 88% 82%, rgba(155, 89, 182, .16), transparent 62%),
    linear-gradient(180deg, #fdfbff 0%, #faf5ff 55%, #fdfbff 100%);
  overflow: hidden;
  isolation: isolate;
}

.auth-section .islamic-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><path d='M30 0l30 30-30 30L0 30z' fill='none' stroke='%238E44AD' stroke-opacity='0.10' stroke-width='1'/><circle cx='30' cy='30' r='4' fill='%23F8B4D9' fill-opacity='0.14'/></svg>");
  background-size: 60px 60px;
  mask-image: radial-gradient(closest-side at 50% 45%, #000 62%, transparent 100%);
}


.auth-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* ---------- الهيكل المزدوج ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: var(--card-bg);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border-color);
  border-radius: 40px;
  box-shadow:
    0 40px 90px -40px rgba(91, 44, 111, .45),
    0 0 0 12px rgba(255, 255, 255, .35);
  overflow: hidden;
}

/* ---------- اللوحة النورانية ---------- */
.auth-aside {
  position: relative;
  padding: clamp(34px, 4vw, 54px) clamp(26px, 3.4vw, 44px);
  color: #fff;
  background:
    radial-gradient(520px 300px at 70% 8%, rgba(248, 180, 217, .35), transparent 60%),
    linear-gradient(150deg, var(--deep-purple) 0%, var(--secondary-purple) 52%, var(--primary-purple) 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.auth-aside::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44'><path d='M22 0l22 22-22 22L0 22z' fill='none' stroke='%23ffffff' stroke-opacity='0.16'/></svg>");
  background-size: 44px 44px;
  animation: authDrift 26s linear infinite;
}

@keyframes authDrift {
  to {
    background-position: 44px 44px
  }
}

.auth-aside .aside-lamp {
  position: absolute;
  top: -120px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), rgba(248, 180, 217, .25) 42%, transparent 70%);
  filter: blur(12px);
  animation: lampGlow 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes lampGlow {
  from {
    opacity: .45;
    transform: translateX(-50%) scale(1)
  }

  to {
    opacity: .85;
    transform: translateX(-50%) scale(1.12)
  }
}

.aside-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.aside-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .3px;
}

.aside-brand .brand-star {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, .6));
  animation: starSpin 18s linear infinite;
}

@keyframes starSpin {
  to {
    transform: rotate(360deg)
  }
}

.aside-title {
  font-family: var(--font-secondary);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 900;
  line-height: 1.45;
  margin: 26px 0 18px;
}

.aside-title span {
  background: linear-gradient(90deg, #fff, var(--soft-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aside-ayah {
  font-family: var(--font-secondary);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 2.1;
  padding: 16px 20px;
  margin: 0;
  border-radius: 20px 20px 6px 6px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.aside-ayah-ref {
  display: block;
  margin-top: 8px;
  font-size: .8rem;
  opacity: .75;
}

.aside-points {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.aside-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .95rem;
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  transition: transform .35s var(--ease), background .35s var(--ease);
}

.aside-points li:hover {
  transform: translateX(-6px);
  background: rgba(255, 255, 255, .18);
}

.aside-points i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, .18);
  font-size: .85rem;
}

/* خطوات التسجيل */
.aside-steps {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: s;
}

.aside-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .95rem;
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  opacity: .72;
}

.aside-steps li span {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: .9rem;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
}

.aside-steps li.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, .2);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .6);
}

.aside-steps li.is-active span {
  background: #fff;
  color: var(--secondary-purple);
}

.aside-arch {
  position: absolute;
  bottom: -70px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 120px 120px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), transparent);
}

/* ---------- بطاقة النموذج ---------- */
.auth-panel {
  position: relative;
  background: rgba(255, 255, 255, .96);
  display: flex;
  align-items: center;
}

.auth-panel::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(155, 89, 182, .25), transparent);
}

.auth-panel-inner {
  width: 100%;
  padding: clamp(30px, 3.6vw, 52px) clamp(24px, 3.4vw, 54px);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--secondary-purple);
  background: linear-gradient(135deg, var(--very-light-purple), #fff);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 20px -14px rgba(155, 89, 182, .7);
}

.auth-title {
  font-family: var(--font-secondary);
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  font-weight: 900;
  margin: 14px 0 6px;
  color: var(--deep-purple);
}

.text-gradient {
  background: linear-gradient(120deg, var(--primary-purple), var(--soft-pink) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-sub {
  color: var(--text-light);
  font-size: .95rem;
  margin: 0;
}

.mail-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--very-light-purple);
  color: var(--secondary-purple);
  font-size: .85rem;
  border: 1px solid var(--border-color);
}

/* الفاصل الزخرفي */
.emblem-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 4px;
}

.emblem-divider .divider-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(155, 89, 182, .32), transparent);
}

.emblem-divider .emblem-frame {
  width: 30px;
  height: 30px;
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 14px;
}

.emblem-divider .emblem-star {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

.emblem-divider .emblem-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--soft-pink) 0%, transparent 70%);
  animation: pulseHalo 3s infinite alternate;
}

@keyframes pulseHalo {
  0% {
    transform: scale(1);
    opacity: .3
  }

  100% {
    transform: scale(1.6);
    opacity: .65
  }
}

/* ---------- الحقول العائمة ---------- */
.auth-form {
  margin-top: 22px;
}

.field-grid {
  display: flex;
  flex-direction: column;
}

.field {
  position: relative;
  margin-bottom: 24px;
  text-align: right;
  direction: rtl;
}

.field input {
  box-sizing: border-box;
  width: 100%;
  padding: 1.05rem 1.4rem;
  font-size: 1rem;
  font-family: var(--font-primary);
  color: var(--text-dark);
  background: rgba(248, 232, 255, .35);
  border: 1px solid rgba(155, 89, 182, .18);
  border-radius: 18px;
  transition: border-color .35s var(--ease), background .35s var(--ease), box-shadow .35s var(--ease);
}

.field--pass input {
  padding-inline-start: 3.5rem;
}

.field label {
  position: absolute;
  inset-inline-start: auto;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-weight: 600;
  font-size: .98rem;
  pointer-events: none;
  transition: all .35s var(--ease);
}

.field .field-line {
  position: absolute;
  bottom: 0;
  right: 50%;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--soft-pink), var(--primary-purple));
  transition: width .4s var(--ease), right .4s var(--ease);
}

.field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 4px rgba(155, 89, 182, .12), 0 18px 34px -22px rgba(91, 44, 111, .7);
}

.field input:focus~.field-line {
  width: 88%;
  right: 6%;
}

.field input:focus~label,
.field input:not(:placeholder-shown)~label {
  top: -2px;
  font-size: .78rem;
  font-weight: 800;
  color: var(--secondary-purple);
  background: #fff;
  padding: 0 6px;
  transform: translateY(-50%);
}

.pass-toggle {
  position: absolute;
  inset-inline-start: .85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--secondary-purple);
  background: rgba(155, 89, 182, .10);
  transition: background .3s var(--ease), transform .3s var(--ease);
}

.pass-toggle:hover {
  background: rgba(155, 89, 182, .2);
  transform: translateY(-50%) scale(1.08);
}

.pass-toggle.is-on {
  background: var(--primary-purple);
  color: #fff;
}

/* صف التذكر / نسيت */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 22px;
  font-size: .88rem;
  flex-wrap: wrap;
}

.soft-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: var(--text-light);
  font-weight: 600;
}

.soft-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.soft-box {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-color);
  background: var(--very-light-purple);
  color: transparent;
  font-size: .7rem;
  transition: all .3s var(--ease);
}

.soft-check input:checked+.soft-box {
  background: linear-gradient(135deg, var(--secondary-purple), var(--primary-purple));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px -10px rgba(155, 89, 182, .9);
}

.soft-check input:focus-visible+.soft-box {
  box-shadow: 0 0 0 3px rgba(155, 89, 182, .25);
}

.link-soft {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  transition: color .3s;
}

.link-soft:hover {
  color: var(--primary-purple);
}

.link-strong {
  color: var(--primary-purple);
  font-weight: 800;
  text-decoration: none;
  position: relative;
}

.link-strong::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--soft-pink), var(--primary-purple));
  transition: width .35s var(--ease);
}

.link-strong:hover::after {
  width: 100%;
}

/* ---------- مؤشر قوة كلمة المرور ---------- */
.pass-meter {
  margin: -14px 0 24px;
  padding: 0 4px;
}

.pass-meter-bar {
  display: block;
  height: 8px;
  border-radius: 10px;
  background: rgba(155, 89, 182, .10);
  overflow: hidden;
}

.pass-meter-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 10px;
  transition: width .4s var(--ease), background .4s var(--ease);
  background: linear-gradient(90deg, var(--soft-pink), var(--primary-purple));
}

.pass-meter[data-level="1"] .pass-meter-bar i {
  background: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}

.pass-meter[data-level="2"] .pass-meter-bar i {
  background: #f39c12;
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.4);
}

.pass-meter[data-level="3"] .pass-meter-bar i {
  background: var(--primary-purple);
  box-shadow: 0 0 10px rgba(155, 89, 182, 0.4);
}

.pass-meter[data-level="4"] .pass-meter-bar i {
  background: #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
}

.pass-meter-text {
  display: block;
  margin-top: 8px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-light);
}

/* ---------- كود التحقق ---------- */
.otp-wrap {
  position: relative;
  text-align: center;
  margin-bottom: 22px;
}

.otp-label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--secondary-purple);
  font-size: .9rem;
}

.otp-input {
  width: 100%;
  max-width: 340px;
  padding: 18px 10px;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: clamp(8px, 3vw, 16px);
  text-align: center;
  direction: ltr;
  color: var(--deep-purple);
  font-family: var(--font-primary);
  background: linear-gradient(180deg, #fff, var(--very-light-purple));
  border: 2px solid var(--border-color);
  border-radius: 22px;
  box-shadow: 0 20px 40px -28px rgba(91, 44, 111, .8);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}

.otp-input:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 5px rgba(155, 89, 182, .14);
}

.otp-glow {
  position: absolute;
  inset: auto 0 -14px 0;
  height: 26px;
  margin: 0 auto;
  max-width: 280px;
  background: radial-gradient(ellipse at center, rgba(155, 89, 182, .35), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.countdown-wrap {
  text-align: center;
  margin-bottom: 22px;
}

.countdown-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--secondary-purple);
  background: var(--very-light-purple);
  border: 1px solid var(--border-color);
}

.countdown-chip.is-expired {
  color: #dc2626;
  background: rgba(220, 38, 38, .08);
  border-color: rgba(220, 38, 38, .2);
}

/* ---------- الزر الأساسي ---------- */
.btn-primary {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 1.05rem 1.5rem;
  border-radius: 999px;
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--deep-purple), var(--secondary-purple) 45%, var(--primary-purple));
  box-shadow: 0 22px 40px -22px rgba(91, 44, 111, .95);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transition: transform .7s var(--ease);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 50px -20px rgba(91, 44, 111, .95);
}

.btn-primary:hover::before {
  transform: translateX(120%);
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-as-link {
  text-decoration: none;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -40% 30%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 180, 217, .55), transparent 70%);
  filter: blur(18px);
  animation: btnPulse 4s ease-in-out infinite;
}

@keyframes btnPulse {

  0%,
  100% {
    opacity: .35
  }

  50% {
    opacity: .8
  }
}

.heart-icon {
  display: inline-flex;
  animation: heartBeat 2.4s ease-in-out infinite;
}

@keyframes heartBeat {

  0%,
  100% {
    transform: scale(1)
  }

  30% {
    transform: scale(1.18)
  }
}

/* ---------- التنبيهات والتذييل ---------- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: .95rem 1.1rem;
  border-radius: 16px;
  margin-bottom: 1.2rem;
  font-size: .92rem;
  font-weight: 600;
  text-align: center;
}

.alert-danger {
  background: rgba(220, 38, 38, .08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, .2);
}

.alert-success {
  background: rgba(22, 163, 74, .08);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, .2);
}

.auth-footer {
  margin-top: 26px;
  text-align: center;
  color: var(--text-light);
  font-size: .92rem;
}

.auth-footer p {
  margin: 0 0 8px;
}

.auth-footer p:last-child {
  margin-bottom: 0;
}

/* ---------- الحركة عند الظهور ---------- */
.fade-in-up {
  animation: fadeInUp .9s var(--ease) both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* ---------- الاستجابة ---------- */
@media (max-width:1024px) {
  .auth-shell {
    grid-template-columns: 1fr;
    border-radius: 34px;
  }

  .auth-aside {
    padding: 38px 26px 46px;
  }

  .aside-arch {
    display: none;
  }

  .auth-panel::before {
    display: none;
  }

  .auth-section .geo-diamond--c {
    display: none;
  }
}

@media (max-width:640px) {
  .auth-section {
    padding: 24px 0;
  }

  .auth-shell {
    border-radius: 28px;
    box-shadow: 0 26px 60px -34px rgba(91, 44, 111, .5), 0 0 0 8px rgba(255, 255, 255, .3);
  }

  .auth-panel-inner {
    padding: 28px 20px 32px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .aside-title {
    font-size: 1.55rem;
  }

  .aside-points li,
  .aside-steps li {
    font-size: .88rem;
  }

  .auth-section .geo-diamond--a {
    width: 130px;
    height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .auth-shell,
  .geo-diamond,
  .aside-lamp,
  .brand-star,
  .emblem-halo,
  .btn-glow::after,
  .heart-icon,
  .auth-aside::before,
  .fade-in-up {
    animation: none !important;
    transition: none !important;
  }
}