/* login-anim.css - motion for the student sign-in page (index.php) only.
   Everything is switched off for phones set to "Reduce motion". */

/* 1. The card rises into place, then each part follows in turn */
@keyframes gauRise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes gauFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.gau-login-card { animation: gauRise .7s cubic-bezier(.2,.7,.2,1) both; }
.gau-anim > * { animation: gauFadeUp .55s cubic-bezier(.2,.7,.2,1) both; }
.gau-anim > *:nth-child(1) { animation-delay: .15s; }
.gau-anim > *:nth-child(2) { animation-delay: .25s; }
.gau-anim > *:nth-child(3) { animation-delay: .32s; }
.gau-anim > *:nth-child(4) { animation-delay: .39s; }
.gau-anim > *:nth-child(5) { animation-delay: .46s; }
.gau-anim > *:nth-child(6) { animation-delay: .53s; }
.gau-anim > *:nth-child(7) { animation-delay: .60s; }
.gau-anim > *:nth-child(n+8) { animation-delay: .67s; }

/* 2. The teal-to-gold strip on top of the card slowly flows */
@keyframes gauFlow { from { background-position: 0% 0; } to { background-position: 200% 0; } }
.gau-login-card::before {
  background: linear-gradient(90deg, rgb(0,128,128), var(--gau-gold), rgb(0,128,128), var(--gau-gold), rgb(0,128,128));
  background-size: 200% 100%;
  animation: gauFlow 6s linear infinite;
}

/* 3. The crest pops in and a soft gold ring pulses around it */
@keyframes gauPop { 0% { opacity: 0; transform: scale(.6) rotate(-12deg); } 70% { transform: scale(1.06) rotate(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes gauRing { 0% { box-shadow: 0 4px 14px rgba(30,50,60,.12), 0 0 0 0 rgba(201,162,39,.45); } 70% { box-shadow: 0 4px 14px rgba(30,50,60,.12), 0 0 0 12px rgba(201,162,39,0); } 100% { box-shadow: 0 4px 14px rgba(30,50,60,.12), 0 0 0 0 rgba(201,162,39,0); } }
.gau-login-crest { animation: gauPop .8s cubic-bezier(.2,.8,.25,1.2) .1s both, gauRing 2.8s ease-out 1.2s 3; }

/* 4. A gold shine passes across "Garissa University" */
@keyframes gauShine { 0%, 55% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.gau-login-uni-name {
  background: linear-gradient(100deg, var(--gau-slate) 40%, var(--gau-gold) 50%, var(--gau-slate) 60%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--gau-slate);
  animation: gauShine 5s ease-in-out .9s infinite;
}

/* 5. "Welcome to Garissa University" with a gold underline that sweeps in */
.gau-login-heading { position: relative; display: block; margin-bottom: 6px; padding-bottom: 8px; font-size: 1.3rem; line-height: 1.25; text-wrap: balance; }
@media (max-width: 380px) { .gau-login-heading { font-size: 1.15rem; } }
.gau-login-heading::after {
  content: ''; position: absolute; left: 50%; bottom: 0; height: 3px; width: 46px; margin-left: -23px; border-radius: 3px;
  background: linear-gradient(90deg, rgb(0,128,128), var(--gau-gold));
  transform: scaleX(0); animation: gauLine .7s cubic-bezier(.2,.7,.2,1) .6s forwards;
}
@keyframes gauLine { to { transform: scaleX(1); } }

/* 6. The line that types itself out */
.gau-type { min-height: 1.5em; margin: 14px 0 16px; text-align: center; font-size: .88rem; font-weight: 600; color: rgb(0,128,128); }
.gau-type i { color: var(--gau-gold-dark); margin-right: 6px; transition: opacity .25s; }
.gau-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--gau-gold); animation: gauBlink 1s steps(1) infinite; }
@keyframes gauBlink { 50% { opacity: 0; } }

/* "Student Portal" and "Secure" pills side by side */
.gau-login-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.gau-login-secure {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(31,122,77,.10); border: 1px solid rgba(31,122,77,.30);
  padding: 4px 12px; border-radius: 30px;
  font-size: .66rem; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; color: var(--gau-green);
}
.gau-login-secure i { font-size: .72rem; }

/* Sign In button: a light sweep when hovered or focused */
.gau-login-form .btn-gau { position: relative; overflow: hidden; }
.gau-login-form .btn-gau::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.gau-login-form .btn-gau:hover::after, .gau-login-form .btn-gau:focus-visible::after { left: 120%; }

@media (prefers-reduced-motion: reduce) {
  .gau-login-card, .gau-anim > *, .gau-login-crest, .gau-login-card::before, .gau-login-uni-name, .gau-caret { animation: none !important; }
  .gau-login-heading::after { animation: none; transform: none; }
  .gau-login-uni-name { -webkit-text-fill-color: currentColor; background: none; }
  .gau-login-form .btn-gau::after { display: none; }
}
