/* Shared animated styles for login.html and adminlogin.html */
:root {
  --navy: #0f2a5c;
  --navy-dark: #081a3d;
  --blue: #1f5fae;
  --gold: #d4a333;
  --gold-light: #f0c75e;
  --primary-color: #0f2a5c;
  --secondary-color: #1f5fae;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;   /* same typography as the application pages */
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--blue) 100%);
  background-size: 200% 200%;
  animation: gradientShift 14s ease infinite;
  overflow-x: hidden;
}

[dir="rtl"] body {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', sans-serif;
}

/* ========== Background shapes ========== */
.bg-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: floatBlob 18s ease-in-out infinite;
}

.blob.b1 {
  width: 380px;
  height: 380px;
  background: var(--blue);
  top: -120px;
  left: -100px;
}

.blob.b2 {
  width: 320px;
  height: 320px;
  background: var(--gold);
  bottom: -100px;
  right: 5%;
  opacity: 0.25;
  animation-delay: -6s;
}

.blob.b3 {
  width: 240px;
  height: 240px;
  background: #3b82c4;
  top: 40%;
  left: 60%;
  animation-delay: -12s;
}

/* ========== Top bar: university seal + language switch ========== */
.uni-seal {
  position: absolute;
  top: 15px;
  inset-inline-start: 20px;
  z-index: 10;
  animation: fadeDown 0.8s var(--ease) both;
}

.uni-seal img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: white;
  padding: 2px;
  box-shadow: 0 0 0 3px rgba(212, 163, 51, 0.6), 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.6s var(--ease);
}

.uni-seal:hover img {
  transform: rotate(360deg);
}

.lang-switch {
  position: absolute;
  top: 22px;
  inset-inline-end: 20px;
  z-index: 10;
  animation: fadeDown 0.8s var(--ease) both;
}

div.lang-switch {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

div.lang-switch:hover {
  background: white;
  color: var(--navy);
  transform: translateY(-2px);
}

.lang-switch .form-select {
  background-color: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

/* ========== Card ========== */
.container-fluid {
  position: relative;
  z-index: 1;
}

.auth-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  margin: 5rem auto 2rem;
  padding: 2.25rem 2rem 2rem;
  background: white;
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  animation: cardIn 0.9s var(--ease) both;
}

.auth-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--navy), var(--gold), var(--navy));
  background-size: 200% auto;
  transform-origin: left;
  animation: lineIn 0.9s var(--ease) 0.5s both, shine 4s linear 1.4s infinite;
}

[dir="rtl"] .auth-container {
  text-align: right;
}

[dir="rtl"] .text-end {
  text-align: left !important;
}

[dir="rtl"] .auth-container::before {
  transform-origin: right;
}

.auth-container.shake {
  animation: shake 0.5s ease;
}

/* ========== Logo ========== */
.logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo img {
  max-width: 150px;
  height: auto;
  animation: float 6s ease-in-out 1s infinite;
}

.logo h2 {
  color: var(--navy);
  font-weight: 700;
}

/* ========== Staggered entrance ========== */
.stagger {
  animation: fadeUp 0.8s var(--ease) var(--d, 0s) both;
}

/* ========== Inputs ========== */
.form-label {
  font-weight: 500;
  color: #4a5568;
  transition: color 0.3s ease;
}

.mb-3:focus-within > .form-label {
  color: var(--blue);
}

.form-control {
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--ease);
}

.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.25rem rgba(31, 95, 174, 0.2);
  transform: translateY(-1px);
}

.input-group > .form-control {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.input-group > .btn {
  border-start-start-radius: 0;
  border-end-start-radius: 0;
  border-start-end-radius: 10px;
  border-end-end-radius: 10px;
}

#togglePassword i {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

#togglePassword:active i {
  transform: scale(0.8);
}

.auth-container a {
  color: var(--blue);
  position: relative;
  transition: color 0.3s ease;
}

.auth-container a:hover {
  color: var(--navy);
}

/* ========== Login button ========== */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  border: none;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn-primary::after {
  /* light sweep on hover */
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s var(--ease);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(31, 95, 174, 0.4);
}

.btn-primary:hover::after {
  left: 125%;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  opacity: 0.8;
}

/* ========== Keyframes ========== */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 30px) scale(1.1); }
  66% { transform: translate(-30px, 20px) scale(0.95); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
}

@keyframes lineIn {
  from { transform: scaleX(0); }
}

@keyframes shine {
  to { background-position: 200% center; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* ========== Responsive ========== */
@media (max-width: 576px) {
  .auth-container {
    margin: 5.5rem 0.75rem 1.5rem;
    padding: 1.75rem 1.4rem;
  }

  .uni-seal img {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
