/* ========== Login Page Layout ========== */

body.login-page {
  /* لو حابب شيء خاص بالصفحة */
}

.sub-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.breadcrumbs {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 8px;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.page-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
}

.page-lead {
  color: #b9c2ea;
  max-width: 860px;
  margin: 4px 0 14px;
}

/* ========== Auth Card Layout ========== */

.auth-wrap {
  margin-top: 22px;
  display: grid;
  gap: 20px;
}

@media (min-width: 960px) {
  .auth-wrap {
    grid-template-columns: 1fr .9fr;
    align-items: stretch; /* مهم لتساوي ارتفاع الكروت */
  }
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;

  /* جديد: لجعل الكرت يمتد بطول الصف */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.auth-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-header h2 .icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--gold);
  background: rgba(0,0,0,.25);
}

.auth-body {
  display: grid;
  gap: 10px;
  margin-top: 8px;

  /* جديد: حتى تتمدّد لتملأ ارتفاع الكرت */
  flex: 1;
}

/* ========== Role Toggle (متدرّب / مدرّب) ========== */

.role-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
}

.role-tab {
  border: none;
  background: transparent;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .85rem;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.role-tab.active {
  background: var(--gold);
  color: #090b12;
  font-weight: 700;
}

/* ========== Form Elements ========== */

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label {
  font-size: .9rem;
  font-weight: 600;
}

.form-hint {
  font-size: .82rem;
  color: #9bb0d3;
  margin: 0 0 6px;
}

.auth-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.muted {
  color: #9bb0d3;
  font-size: .9rem;
}

/* البريد عند تسجيل الدخول */
.logged-email {
  font-weight: 700;
  font-size: .98rem;
  margin: 0 0 10px;
}

/* ========== Alert Messages ========== */

.alert-inline {
  margin-top: 6px;
  font-size: .85rem;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  display: none;
  white-space: pre-wrap;
}

/* الكلاس القديم الذي كان عندك */
.alert-inline.show {
  display: block;
}

.alert-inline.ok {
  border-color: #2e7d32;
  background: #0f2a17;
  color: #d9ffdf;
}

.alert-inline.err {
  border-color: #904040;
  background: #2a1111;
  color: #ffd9d9;
}

/* دعم الكلاسات الجديدة التي يستخدمها login.js (success / error) */
.alert-inline.success {
  display: block;
  border-color: #2e7d32;
  background: #0f2a17;
  color: #d9ffdf;
}

.alert-inline.error {
  display: block;
  border-color: #904040;
  background: #2a1111;
  color: #ffd9d9;
}

/* ========== CTA Section ========== */

.cta-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-top: 26px;
  background:
    linear-gradient(0deg, rgba(11,16,32,.45), rgba(11,16,32,.45)),
    url('/img/marketing.png') center/cover no-repeat;
  text-align: center;
}

/* قائمة التوضيح في الكرت الثاني */
.info-list {
  line-height: 1.9;
  padding-left: 18px;
}

/* ========== Buttons Row (حالة المستخدم مسجل دخول) ========== */

.buttons-row {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  width: 100%;
  justify-content: space-between;
}

.buttons-row a {
  flex: 1;
  text-align: center;
  padding: 12px 10px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* زر شفاف خفيف */
.btn-ghost {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 10px 10px;
  border-radius: 999px;
  font-size: .9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost:hover {
  border-style: solid;
  color: var(--text);
}

/* موبايل: جعل الأزرار تتلف وتترتب حلو */
@media (max-width: 640px) {
  .buttons-row {
    flex-wrap: wrap;
  }
  .buttons-row a {
    flex: 1 1 calc(50% - 10px);
  }
  .buttons-row a:last-child {
    flex: 1 1 100%;
  }
}
