/* ── QAMS Auth Pages — Cairo University visual identity ───────────────────
   Palette: parchment #EFEACC · burgundy #8A0000 · navy #313168 · sky #9FDCEF
   Type: EB Garamond (display) + Plus Jakarta Sans (utility)
   ─────────────────────────────────────────────────────────────────────────── */

body.auth-body {
  margin: 0;
  min-height: 100vh;
  background: #EFEACC;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* ─── Page shell ─────────────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  min-height: 100vh;
}

/* ─── Left: identity panel ───────────────────────────────────────────────── */
.auth-identity {
  width: 42%;
  flex-shrink: 0;
  background: radial-gradient(ellipse at 50% 44%, #3A3A7A 0%, #1A1A40 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 40px;
  position: relative;
}

.auth-identity-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.auth-crest {
  width: 136px;
  height: 136px;
  object-fit: contain;
  margin-bottom: 30px;
  filter: drop-shadow(0 2px 20px rgba(0, 0, 0, 0.5));
}

.auth-uni-ar {
  display: block;
  font-family: 'EB Garamond', 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.7rem;
  font-weight: 500;
  color: #EFEACC;
  direction: rtl;
  line-height: 1.25;
  margin-bottom: 5px;
}

.auth-uni-en {
  display: block;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: rgba(239, 234, 204, 0.5);
  line-height: 1.25;
  margin-bottom: 24px;
}

.auth-sky-divider {
  width: 40px;
  height: 2px;
  background: #9FDCEF;
  margin: 0 auto 24px;
  border-radius: 1px;
  flex-shrink: 0;
}

.auth-fac-ar {
  display: block;
  font-family: 'EB Garamond', 'Amiri', 'Traditional Arabic', serif;
  font-size: 1.05rem;
  color: rgba(239, 234, 204, 0.82);
  direction: rtl;
  line-height: 1.55;
  margin-bottom: 5px;
}

.auth-fac-en {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(239, 234, 204, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.6;
}

/* ─── Right: form panel ──────────────────────────────────────────────────── */
.auth-form-panel {
  flex: 1;
  background: #EFEACC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 52px;
}

.auth-form-inner {
  width: 100%;
  max-width: 360px;
}

/* Eyebrow label */
.auth-eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #8A0000;
  text-transform: uppercase;
  margin-bottom: 22px;
  display: block;
}

/* Page heading */
.auth-heading {
  font-family: 'EB Garamond', serif;
  font-size: 2.6rem;
  font-weight: 500;
  color: #313168;
  line-height: 1.1;
  margin: 0 0 4px;
}

.auth-heading-ar {
  display: block;
  font-family: 'EB Garamond', 'Amiri', serif;
  font-size: 1.05rem;
  color: rgba(49, 49, 104, 0.42);
  direction: rtl;
  text-align: right;
  margin: 0 0 22px;
}

/* Ruling line under heading */
.auth-rule {
  height: 1px;
  background: linear-gradient(to right, #8A0000 28%, rgba(139, 0, 0, 0.06) 100%);
  margin-bottom: 28px;
}

/* ─── Alert overrides for auth pages ─────────────────────────────────────── */
.auth-form-inner .alert {
  background: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  border-left: 3px solid !important;
  padding: 9px 12px !important;
  font-size: 13px !important;
}
.auth-form-inner .alert-error   { border-color: #8A0000 !important; color: #8A0000 !important; }
.auth-form-inner .alert-success { border-color: #166534 !important; color: #166534 !important; }
.auth-form-inner .alert-info    { border-color: #313168 !important; color: #313168 !important; }
.auth-form-inner .alert-warning { border-color: #92400E !important; color: #92400E !important; }

/* ─── Form fields — paper-form aesthetic ─────────────────────────────────── */
.auth-field {
  margin-bottom: 26px;
}

.auth-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(49, 49, 104, 0.58);
  margin-bottom: 10px;
}

.auth-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(49, 49, 104, 0.28);
  border-radius: 0;
  padding: 7px 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14.5px;
  color: #313168;
  outline: none;
  transition: border-color 0.14s ease;
  -webkit-appearance: none;
}

.auth-input::placeholder {
  color: rgba(49, 49, 104, 0.26);
  font-size: 13px;
}

.auth-input:focus {
  border-bottom-color: #8A0000;
}

/* Password field wrapper — to add show/hide toggle later if needed */
.auth-password-wrap {
  position: relative;
}

/* ─── Submit button ───────────────────────────────────────────────────────── */
.auth-submit {
  display: block;
  width: 100%;
  background: #8A0000;
  color: #EFEACC;
  border: none;
  padding: 12px 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 2px;
  margin-top: 8px;
  transition: background 0.14s, transform 0.08s;
}

.auth-submit:hover        { background: #6B0000; }
.auth-submit:active       { transform: translateY(1px); }
.auth-submit:focus-visible {
  outline: 2px solid #9FDCEF;
  outline-offset: 3px;
}

/* ─── Footer links ───────────────────────────────────────────────────────── */
.auth-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.auth-foot a {
  font-size: 12px;
  color: rgba(49, 49, 104, 0.48);
  text-decoration: none;
  transition: color 0.12s;
}

.auth-foot a:hover { color: #8A0000; text-decoration: underline; }

/* ─── Form hint (reset password) ─────────────────────────────────────────── */
.auth-hint {
  font-size: 11.5px;
  color: rgba(49, 49, 104, 0.45);
  margin-top: 6px;
  line-height: 1.5;
}

/* ─── CAPTCHA ─────────────────────────────────────────────────────────────── */
.auth-captcha-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-captcha-img {
  border: 1px solid rgba(49, 49, 104, 0.18);
  border-radius: 2px;
  display: block;
  height: 55px;
}

.auth-captcha-refresh {
  font-size: 12px;
  color: rgba(49, 49, 104, 0.46);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.12s;
}

.auth-captcha-refresh:hover { color: #8A0000; text-decoration: underline; }

.auth-captcha-error {
  font-size: 12.5px;
  color: #8A0000;
  margin: 0 0 8px;
}

/* ─── Google SSO button ───────────────────────────────────────────────────── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 20px;
  background: transparent;
  border: 1.5px solid rgba(49, 49, 104, 0.28);
  border-radius: 2px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: #313168;
  text-decoration: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}

.btn-google:hover {
  border-color: #8A0000;
  background: rgba(139, 0, 0, 0.04);
  color: #8A0000;
}

.btn-google:focus-visible {
  outline: 2px solid #9FDCEF;
  outline-offset: 3px;
}

.btn-google svg { flex-shrink: 0; }

/* ─── "or" divider between SSO and password form ─────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 20px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(49, 49, 104, 0.15);
}

.auth-divider span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(49, 49, 104, 0.32);
  white-space: nowrap;
}

/* ─── Mobile: stack ───────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .auth-page { flex-direction: column; }

  .auth-identity {
    width: 100%;
    padding: 28px 24px;
    min-height: auto;
  }

  .auth-identity-content {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 16px;
  }

  .auth-crest      { width: 62px; height: 62px; margin-bottom: 0; flex-shrink: 0; }
  .auth-uni-ar     { font-size: 1.25rem; }
  .auth-uni-en     { margin-bottom: 0; }
  .auth-sky-divider { display: none; }
  .auth-fac-ar     { display: none; }
  .auth-fac-en     { display: none; }

  .auth-form-panel { padding: 36px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-input, .auth-submit, .auth-foot a, .auth-captcha-refresh {
    transition: none;
  }
}
