/* ============================= */
/* RESET */
/* ============================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================= */
/* CUSTOM PROPERTIES */
/* ============================= */
:root {
  --navy:    #061529;
  --deep:    #0a1e3c;
  --blue:    #0d3d75;
  --bright:  #1565c0;
  --crimson: #b30000;
  --red:     #e53935;
  --white:   #ffffff;
  --glass:   rgba(255, 255, 255, 0.07);
  --border:  rgba(255, 255, 255, 0.18);
}

/* ============================= */
/* ANIMATED STAR PARTICLES      */
/* ============================= */
@keyframes twinkle {
  0%, 100% { opacity: 0.1; transform: scale(0.8); }
  50%       { opacity: 0.9; transform: scale(1.3); }
}

/* ============================= */
/* BODY - DEEP COSMOS GRADIENT   */
/* ============================= */
body {
  font-family: 'Times New Roman', Times, serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at 20% 40%, #1a0a3e 0%, transparent 60%),
              radial-gradient(ellipse at 80% 60%, #3d0000 0%, transparent 60%),
              radial-gradient(ellipse at 50% 20%, #0d3d75 0%, transparent 50%),
              linear-gradient(135deg, #060f20 0%, #0a1e3c 50%, #0d0a20 100%);
  background-attachment: fixed;
  overflow: hidden;
  position: relative;
}

/* ===== Moving Aurora Layers ===== */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  border-radius: 50%;
  animation: aurora 18s ease-in-out infinite alternate;
  pointer-events: none;
}

body::before {
  background: conic-gradient(
    from 0deg at 30% 40%,
    transparent 0deg,
    rgba(13, 61, 117, 0.25) 60deg,
    transparent 120deg,
    rgba(179, 0, 0, 0.15) 200deg,
    transparent 280deg
  );
  animation-duration: 18s;
}

body::after {
  background: conic-gradient(
    from 180deg at 70% 60%,
    transparent 0deg,
    rgba(21, 101, 192, 0.2) 80deg,
    transparent 160deg,
    rgba(229, 57, 53, 0.1) 240deg,
    transparent 320deg
  );
  animation-duration: 24s;
  animation-direction: alternate-reverse;
}

@keyframes aurora {
  0%   { transform: rotate(0deg) scale(1); }
  33%  { transform: rotate(60deg) scale(1.1); }
  66%  { transform: rotate(120deg) scale(0.95); }
  100% { transform: rotate(180deg) scale(1.05); }
}

/* ===== Floating Orbs ===== */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  animation: orbDrift linear infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0d3d75, transparent 70%);
  top: -150px; left: -100px;
  animation-duration: 25s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #b30000, transparent 70%);
  bottom: -100px; right: -80px;
  animation-duration: 30s;
  animation-delay: -8s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #1565c0, transparent 70%);
  top: 50%; left: 60%;
  animation-duration: 20s;
  animation-delay: -15s;
}

@keyframes orbDrift {
  0%   { transform: translate(0,   0)   scale(1); }
  25%  { transform: translate(40px,-30px) scale(1.08); }
  50%  { transform: translate(20px, 50px) scale(0.95); }
  75%  { transform: translate(-30px,20px) scale(1.05); }
  100% { transform: translate(0,   0)   scale(1); }
}

/* ===== Star Field ===== */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars span {
  position: absolute;
  width: 2px; height: 2px;
  background: #ffffff;
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}

/* Generate 40 stars with CSS */
.stars span:nth-child(1)  { top:  5%; left: 12%; animation-duration: 2.1s; animation-delay: 0.0s; }
.stars span:nth-child(2)  { top: 18%; left: 75%; animation-duration: 3.4s; animation-delay: 0.3s; }
.stars span:nth-child(3)  { top: 32%; left: 30%; animation-duration: 2.8s; animation-delay: 0.7s; }
.stars span:nth-child(4)  { top: 48%; left: 88%; animation-duration: 1.9s; animation-delay: 1.2s; }
.stars span:nth-child(5)  { top: 62%; left:  5%; animation-duration: 3.1s; animation-delay: 0.5s; }
.stars span:nth-child(6)  { top: 78%; left: 50%; animation-duration: 2.4s; animation-delay: 0.9s; }
.stars span:nth-child(7)  { top: 90%; left: 20%; animation-duration: 1.7s; animation-delay: 1.5s; }
.stars span:nth-child(8)  { top: 10%; left: 45%; animation-duration: 3.6s; animation-delay: 0.2s; }
.stars span:nth-child(9)  { top: 25%; left: 62%; animation-duration: 2.2s; animation-delay: 1.8s; }
.stars span:nth-child(10) { top: 55%; left: 38%; animation-duration: 2.9s; animation-delay: 0.6s; }
.stars span:nth-child(11) { top:  3%; left: 90%; animation-duration: 3.3s; animation-delay: 1.1s; }
.stars span:nth-child(12) { top: 70%; left: 70%; animation-duration: 2.0s; animation-delay: 0.4s; }
.stars span:nth-child(13) { top: 42%; left: 15%; animation-duration: 2.7s; animation-delay: 2.0s; }
.stars span:nth-child(14) { top: 85%; left: 82%; animation-duration: 1.8s; animation-delay: 0.8s; }
.stars span:nth-child(15) { top: 15%; left: 28%; animation-duration: 3.0s; animation-delay: 1.4s; }
.stars span:nth-child(16) { top: 58%; left: 55%; animation-duration: 2.5s; animation-delay: 0.1s; width:3px; height:3px; }
.stars span:nth-child(17) { top: 38%; left: 95%; animation-duration: 2.3s; animation-delay: 1.7s; }
.stars span:nth-child(18) { top: 72%; left: 10%; animation-duration: 3.5s; animation-delay: 0.6s; }
.stars span:nth-child(19) { top: 22%; left: 48%; animation-duration: 1.6s; animation-delay: 1.0s; width:3px; height:3px; }
.stars span:nth-child(20) { top: 92%; left: 65%; animation-duration: 2.8s; animation-delay: 1.3s; }

/* ============================= */
/* LOGIN BOX                     */
/* ============================= */
.box {
  width: 460px;
  max-width: 94%;
  padding: 55px 50px 50px;
  border-radius: 28px;
  background: rgba(8, 20, 45, 0.55);
  backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.13);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 30px 80px rgba(0,0,0,0.8),
    0 0 120px rgba(13, 61, 117, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.1);
  text-align: center;
  position: relative;
  z-index: 10;
  animation: cardEntrance 0.9s cubic-bezier(0.22, 1, 0.36, 1) both,
             cardFloat 7s ease-in-out 1s infinite;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

/* ===== Glowing Animated Border Ring ===== */
.box::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 30px;
  background: conic-gradient(
    from var(--angle, 0deg),
    #ffffff,
    #1565c0,
    #b30000,
    #0d3d75,
    #e53935,
    #ffffff
  );
  z-index: -1;
  opacity: 0;
  animation: borderSpin 4s linear infinite, borderFadeIn 1.2s ease 0.8s forwards;
  filter: blur(4px);
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes borderSpin {
  to { --angle: 360deg; }
}

@keyframes borderFadeIn {
  to { opacity: 0.7; }
}

/* ===== Inner shimmer overlay ===== */
.box::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.06) 0%,
    transparent 50%,
    rgba(255,255,255,0.02) 100%
  );
  pointer-events: none;
}

/* Hover - lift with glow */
.box:hover {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 40px 100px rgba(0,0,0,0.9),
    0 0 200px rgba(13, 61, 117, 0.4),
    0 0 80px  rgba(179, 0, 0, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.15);
  transition: box-shadow 0.5s ease;
}

/* ============================= */
/* COLLEGE BRAND                 */
/* ============================= */
.college-brand {
  margin-bottom: 28px;
  animation: brandSlideIn 0.8s cubic-bezier(0.22,1,0.36,1) 0.3s both;
}

@keyframes brandSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  width: 100px;
  filter: drop-shadow(0 0 20px rgba(21, 101, 192, 0.7))
          drop-shadow(0 0 50px rgba(179, 0, 0, 0.3));
  animation: logoPulse 3s ease-in-out infinite;
  transition: 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(21,101,192,0.7)) drop-shadow(0 0 50px rgba(179,0,0,0.3)); }
  50%       { filter: drop-shadow(0 0 35px rgba(21,101,192,1))   drop-shadow(0 0 80px rgba(179,0,0,0.6)); }
}

.logo:hover {
  transform: rotate(-8deg) scale(1.15);
  filter: drop-shadow(0 0 40px rgba(229,57,53,0.9));
}

.college-name {
  display: block;
  margin-top: 14px;
  font-size: 22px;
  font-weight: bold;
  color: var(--white);
  letter-spacing: 4px;
  text-transform: uppercase;
  position: relative;
  background: linear-gradient(90deg, #ffffff 0%, #90caf9 40%, #ef9a9a 70%, #ffffff 100%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: nameShimmer 5s linear infinite;
}

@keyframes nameShimmer {
  from { background-position: 0% center; }
  to   { background-position: 300% center; }
}

/* Expanding underline on hover */
.college-name::after {
  content: "";
  display: block;
  height: 2px;
  width: 0%;
  margin: 6px auto 0;
  background: linear-gradient(90deg, transparent, #ffffff, #e53935, #1565c0, transparent);
  transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
}

.college-name:hover::after {
  width: 100%;
}

/* ============================= */
/* DECORATIVE DIVIDER            */
/* ============================= */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 24px;
  width: 80%;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.9s forwards;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
}

.divider::after {
  background: linear-gradient(90deg, rgba(255,255,255,0.4), transparent);
}

.divider-dot {
  width: 6px; height: 6px;
  background: #e53935;
  border-radius: 50%;
  box-shadow: 0 0 8px #e53935, 0 0 20px #e53935;
  animation: dotPulse 2s ease infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 8px #e53935, 0 0 20px rgba(229,57,53,0.5); }
  50%       { transform: scale(1.4); box-shadow: 0 0 15px #e53935, 0 0 40px rgba(229,57,53,0.8); }
}

/* ============================= */
/* LOGIN TITLE                   */
/* ============================= */
.box h2 {
  color: rgba(255,255,255,0.85);
  font-size: 17px;
  margin-bottom: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: normal;
  opacity: 0;
  animation: fadeUp 0.6s ease 1.0s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================= */
/* ERROR MESSAGE                 */
/* ============================= */
.error {
  background: rgba(229, 57, 53, 0.15);
  border: 1px solid rgba(229,57,53,0.4);
  border-left: 3px solid #e53935;
  color: #ff8a80;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  animation: errorShake 0.5s ease;
  backdrop-filter: blur(10px);
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

/* ============================= */
/* FORM ANIMATIONS               */
/* ============================= */
form {
  opacity: 0;
  animation: fadeUp 0.7s ease 1.1s forwards;
}

/* ============================= */
/* INPUT - PREMIUM STYLE         */
/* ============================= */
.input-container {
  position: relative;
  margin-bottom: 32px;
}

.input-label {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
  text-align: left;
  transition: color 0.3s;
}

.input-container:focus-within .input-label {
  color: rgba(255,255,255,0.9);
}

.input-wrapper {
  position: relative;
}

/* Glowing background on focus */
.input-wrapper::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(21,101,192,0.3), rgba(229,57,53,0.2));
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 0;
  filter: blur(8px);
}

.input-container:focus-within .input-wrapper::before {
  opacity: 1;
}

.input-container input {
  width: 100%;
  padding: 14px 48px 14px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  font-size: 15px;
  font-family: 'Times New Roman', Times, serif;
  outline: none;
  transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
  position: relative;
  z-index: 1;
}

.input-container input::placeholder {
  color: rgba(255,255,255,0.35);
  font-style: italic;
}

.input-container input:focus {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
  box-shadow:
    0 0 0 3px rgba(21,101,192,0.2),
    0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

/* Animated bottom accent line */
.input-line {
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #1565c0, #e53935);
  border-radius: 0 0 12px 12px;
  transition: width 0.4s cubic-bezier(0.22,1,0.36,1), left 0.4s;
  z-index: 2;
}

.input-container:focus-within .input-line {
  width: 100%;
  left: 0;
}

/* ============================= */
/* PASSWORD TOGGLE ICON          */
/* ============================= */
.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  fill: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.3s;
  z-index: 2;
}

.toggle-password:hover {
  fill: #ffffff;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.7));
  transform: translateY(-50%) scale(1.2);
}

/* ============================= */
/* LOGIN BUTTON                  */
/* ============================= */
.btn-login {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Times New Roman', Times, serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
  margin-top: 8px;

  /* Layered gradient */
  background: linear-gradient(135deg, #0d3d75 0%, #1565c0 35%, #b30000 70%, #e53935 100%);
  background-size: 300% 300%;
  color: #ffffff;
  animation: btnGradient 5s ease infinite;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.5),
    0 0 40px rgba(13,61,117,0.3),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

@keyframes btnGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ripple / shine sweep */
.btn-login::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.btn-login:hover::before {
  left: 150%;
}

/* Particle burst ring on hover */
.btn-login::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1565c0, #e53935, #0d3d75, #e53935);
  background-size: 300% 300%;
  animation: btnGradient 3s ease infinite;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
  filter: blur(10px);
}

.btn-login:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 16px 60px rgba(0,0,0,0.7),
    0 0 80px rgba(21,101,192,0.5),
    0 0 40px rgba(229,57,53,0.3);
}

.btn-login:hover::after {
  opacity: 0.8;
}

.btn-login:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* ============================= */
/* FOOTER LINE                   */
/* ============================= */
.footer-line {
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  animation: fadeUp 0.6s ease 1.4s both;
}

/* ============================= */
/* SCAN LINE EFFECT (subtle)     */
/* ============================= */
.scan-line {
  position: fixed;
  top: -10px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: scanDown 8s linear infinite;
  pointer-events: none;
  z-index: 5;
}

@keyframes scanDown {
  0%   { top: -5px; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100vh; opacity: 0; }
}

/* Autofill dark override */
.input-container input:-webkit-autofill,
.input-container input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(6, 21, 41, 0.9) inset !important;
  -webkit-text-fill-color: #ffffff !important;
}