/* صفحات المصادقة — تصميم مستقل يتماشى مع ألوان الموقع (main.css) */

.page-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* الفوتر فوق طبقة auth-decor */
.page-auth > .site-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.page-auth > .auth-main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
}

.auth-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 55% at 100% 0%, hsl(146 46% 33% / 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 100%, hsl(38 79% 56% / 0.12) 0%, transparent 50%),
    var(--bg);
}

.auth-decor::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image: radial-gradient(circle at center, hsl(38 20% 70% / 0.35) 0.5px, transparent 0.5px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 0%, transparent 75%);
}

/* .auth-main — القواعد الإضافية في الكتلة أعلاه (.page-auth > .auth-main) */
.auth-main {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

/* شعار + الاسم داخل الصفحة (بدل الهيدر) — يمتد فوق الأعمدة */
.auth-inline-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--fg);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.2;
  width: fit-content;
  max-width: 100%;
  transition: opacity 0.2s, color 0.2s;
}

.auth-inline-brand:hover {
  opacity: 0.88;
  color: var(--primary);
}

.auth-inline-brand img {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
}

.auth-inline-brand span {
  letter-spacing: -0.02em;
}

/* شعار داخل العمود التعريفي (سطح المكتب) */
.auth-brand--aside {
  margin-bottom: 0.65rem;
}

/* شعار فوق البطاقة — يظهر عندما يُخفى العمود الجانبي */
.auth-brand--mobiletop {
  display: flex;
  margin-bottom: 1.15rem;
}

@media (min-width: 960px) {
  .auth-brand--mobiletop {
    display: none;
  }
}

.auth-grid {
  display: grid;
  gap: 2.5rem;
  width: 100%;
  align-items: start;
}

@media (min-width: 960px) {
  .auth-grid {
    grid-template-columns: 1fr minmax(380px, 440px);
    gap: 3.5rem;
    align-items: center;
  }
}

/* العمود التعريفي — يظهر من الشاشات المتوسطة */
.auth-aside {
  display: none;
}

@media (min-width: 960px) {
  .auth-aside {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
  }
}

.auth-aside__tag {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
}

.auth-aside__title {
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--fg);
  margin: 0;
}

.auth-aside__lead {
  font-size: 1.05rem;
  color: var(--muted-fg);
  line-height: 1.75;
  margin: 0;
  max-width: 28rem;
}

.auth-aside__chips {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.auth-aside__chips li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg);
}

.auth-aside__chips li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  flex-shrink: 0;
  box-shadow: 0 0 0 3px hsl(146 46% 33% / 0.15);
}

/* لوحة النموذج */
.auth-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow:
    0 4px 6px hsl(134 33% 15% / 0.04),
    0 24px 48px hsl(134 33% 15% / 0.08);
  overflow: hidden;
}

.auth-panel__stripe {
  height: 5px;
  background: linear-gradient(90deg, #166534 0%, #2d7a4f 55%, #15803d 100%);
}

.auth-panel__body {
  padding: 2rem 1.85rem 2.25rem;
}

@media (max-width: 480px) {
  .auth-panel__body {
    padding: 1.65rem 1.35rem 1.85rem;
  }
}

.auth-panel__head {
  margin-bottom: 1.65rem;
}

.auth-panel__head h1 {
  font-size: clamp(1.35rem, 3.5vw, 1.6rem);
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 0.4rem;
  line-height: 1.25;
}

.auth-panel__head p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted-fg);
  line-height: 1.6;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted-fg);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.2s;
}

.auth-back:hover {
  color: var(--primary);
}

/* حقول */
.field {
  margin-bottom: 1.2rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 0.45rem;
  letter-spacing: 0.02em;
}

.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  min-height: 3.05rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--fg);
  background: hsl(38 27% 98%);
  border: 2px solid var(--border);
  border-radius: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input:hover {
  border-color: hsl(38 20% 75%);
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px hsl(146 46% 33% / 0.12);
}

.field input::placeholder {
  color: var(--muted-fg);
  opacity: 0.75;
}

.field--pass {
  position: relative;
}

.field--pass input {
  /* الحقل dir=ltr فيصل inline-end = يمين الحقل (مساحة للأيقونة) */
  padding-inline-end: 3rem;
}

.field__toggle {
  position: absolute;
  left: auto;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--muted-fg);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.field__toggle:hover {
  color: var(--fg);
  background: hsl(38 27% 94%);
}

.field__hint {
  display: block;
  text-align: end;
  margin-top: 0.4rem;
}

.field__hint a {
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.field__hint a:hover {
  text-decoration: underline;
}

/* أزرار الإرسال */
.btn-auth {
  width: 100%;
  margin-top: 0.5rem;
  min-height: 3.15rem;
  font-size: 1.02rem;
  font-weight: 800;
  border-radius: 0.85rem;
}

.btn-auth:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
}

.btn-auth--ghost {
  background: hsl(38 27% 96%);
  color: var(--fg);
  border: 2px solid var(--border);
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.2s, border-color 0.2s;
}

.btn-auth--ghost:hover:not(:disabled) {
  filter: brightness(0.98);
  border-color: hsl(38 20% 72%);
}

.btn-spinner {
  width: 1.15rem;
  height: 1.15rem;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
  display: none;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-auth.loading .btn-spinner {
  display: block;
}

.btn-auth.loading .btn-auth__label {
  display: none;
}

.btn-auth__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.alert-error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  background: hsl(0 75% 97%);
  border: 1px solid hsl(0 55% 88%);
  color: hsl(0 45% 32%);
  display: none;
}

.alert-ok {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  background: hsl(146 35% 94%);
  border: 1px solid hsl(146 30% 78%);
  color: hsl(146 40% 22%);
  display: none;
}

/* مسار الخطوات — استعادة المرور */
.step-track {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0 0 1.75rem;
  position: relative;
}

.step-track::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-item {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.step-item__num {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  background: var(--muted);
  color: var(--muted-fg);
  border: 2px solid var(--border);
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.2s;
}

.step-item.active .step-item__num {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 16px hsl(146 46% 33% / 0.35);
}

.step-item.done .step-item__num {
  background: hsl(146 40% 92%);
  color: var(--primary);
  border-color: hsl(146 46% 33% / 0.45);
}

.step-item__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted-fg);
  line-height: 1.3;
  max-width: 5.5rem;
}

.step-item.active .step-item__label {
  color: var(--fg);
}

/* نجاح الإرسال */
.success-block {
  text-align: center;
  padding: 0.25rem 0 1.25rem;
}

.success-block__icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: hsl(146 40% 93%);
  border: 2px solid hsl(146 46% 33% / 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: auth-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes auth-pop {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.success-block__title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--fg);
  margin: 0 0 0.5rem;
}

.success-block__text {
  font-size: 0.92rem;
  color: var(--muted-fg);
  line-height: 1.75;
  margin: 0;
}

.success-block__text strong {
  color: var(--primary);
  font-weight: 800;
}

.success-block__fine {
  font-size: 0.8rem;
  color: var(--muted-fg);
  margin: 1rem 0 0;
  opacity: 0.9;
}

.link-muted {
  display: block;
  text-align: center;
  margin-top: 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted-fg);
  text-decoration: none;
}

.link-muted strong {
  color: var(--primary);
  font-weight: 800;
}

.link-muted:hover strong {
  text-decoration: underline;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}
