/* =====================================================
   LOGIN PAGE - Premium Styles
   ===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #1E293B;
  -webkit-font-smoothing: antialiased;
}

/* ============ PAGE BACKGROUND ============ */

.login-page {
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(135deg, #0a1e3f 0%, #0B347F 25%, #1a5490 50%, #0B347F 75%, #0a1e3f 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 20px;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============ PARTICLES ============ */

.particles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

/* ============ FLYING PLANES ============ */

.plane {
  position: fixed;
  font-size: 30px;
  color: rgba(255, 255, 255, 0.08);
  animation: flyAcross linear infinite;
  z-index: 1;
  pointer-events: none;
}

.plane:nth-of-type(1) { top: 20%; animation-duration: 25s; animation-delay: 0s; }
.plane:nth-of-type(2) { top: 60%; animation-duration: 35s; animation-delay: 5s; font-size: 40px; }
.plane:nth-of-type(3) { top: 80%; animation-duration: 30s; animation-delay: 12s; font-size: 25px; }

@keyframes flyAcross {
  0% { transform: translateX(-200px) translateY(0) rotate(15deg); }
  50% { transform: translateX(50vw) translateY(-30px) rotate(15deg); }
  100% { transform: translateX(110vw) translateY(0) rotate(15deg); }
}

/* ============ GLOWING ORBS ============ */

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 20s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

.orb1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(78, 143, 232, 0.6), transparent);
  top: -100px; left: -100px;
}

.orb2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent);
  bottom: -150px; right: -100px;
  animation-delay: 5s;
}

.orb3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.3), transparent);
  top: 50%; left: 60%;
  animation-delay: 10s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -50px) scale(1.1); }
  66% { transform: translate(-50px, 50px) scale(0.9); }
}

/* ============ LOGIN CONTAINER ============ */

.loginContainer {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  animation: cardEntry 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntry {
  0% { opacity: 0; transform: translateY(40px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.loginCard {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 45px 40px;
  border-radius: 28px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.35),
    0 0 100px rgba(78, 143, 232, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.loginCard::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shine 4s infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* ============ LOGO ============ */

.logoWrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.logoCircle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0B347F, #4E8FE8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: white;
  box-shadow:
    0 15px 35px rgba(11, 52, 127, 0.35),
    inset 0 -5px 15px rgba(0, 0, 0, 0.15),
    inset 0 5px 15px rgba(255, 255, 255, 0.2);
  animation: logoPulse 3s ease-in-out infinite;
  position: relative;
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    box-shadow: 0 15px 35px rgba(11, 52, 127, 0.35), inset 0 -5px 15px rgba(0, 0, 0, 0.15);
  }
  50% {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 20px 45px rgba(11, 52, 127, 0.5), inset 0 -5px 15px rgba(0, 0, 0, 0.15);
  }
}

.logoRing {
  position: absolute;
  top: -8px; left: -8px; right: -8px; bottom: -8px;
  border: 2px dashed rgba(11, 52, 127, 0.3);
  border-radius: 50%;
  animation: rotateRing 20s linear infinite;
}

@keyframes rotateRing {
  to { transform: rotate(360deg); }
}

.logoRing::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  background: #4E8FE8;
  border-radius: 50%;
  box-shadow: 0 0 15px #4E8FE8;
}

/* ============ TITLES ============ */

.title {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #0B347F, #4E8FE8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
  margin-bottom: 6px;
  animation: titleFade 1s ease 0.3s both;
}

@keyframes titleFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.subtitle {
  font-size: 12px;
  color: #64748b;
  letter-spacing: 4px;
  font-weight: 700;
  margin-bottom: 8px;
  animation: titleFade 1s ease 0.5s both;
}

.welcome {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 30px;
  animation: titleFade 1s ease 0.7s both;
}

.welcomeLine {
  display: inline-block;
  position: relative;
  padding: 0 45px;
}

.welcomeLine::before,
.welcomeLine::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #94a3b8);
}

.welcomeLine::before { right: 100%; margin-right: 10px; }
.welcomeLine::after { left: 100%; margin-left: 10px; background: linear-gradient(90deg, #94a3b8, transparent); }

/* ============ INPUTS ============ */

.inputGroup {
  position: relative;
  margin-bottom: 18px;
  animation: titleFade 0.6s ease both;
}

.inputGroup:nth-of-type(1) { animation-delay: 0.9s; }
.inputGroup:nth-of-type(2) { animation-delay: 1.1s; }

.inputGroup input {
  width: 100%;
  padding: 16px 48px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: rgba(248, 250, 252, 0.8);
  font-weight: 500;
  color: #1e293b;
  font-family: inherit;
}

.inputGroup input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.inputGroup input:focus {
  outline: none;
  border-color: #4E8FE8;
  background: white;
  box-shadow:
    0 0 0 4px rgba(78, 143, 232, 0.1),
    0 8px 20px rgba(78, 143, 232, 0.15);
  transform: translateY(-2px);
}

.inputIcon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #94a3b8;
  transition: all 0.3s ease;
  pointer-events: none;
}

.inputGroup input:focus ~ .inputIcon {
  color: #4E8FE8;
  transform: translateY(-50%) scale(1.1);
}

.eyeIcon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  padding: 5px;
}

.eyeIcon:hover {
  color: #0B347F;
  transform: translateY(-50%) scale(1.1);
}

/* ============ REMEMBER ============ */

.rememberRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  font-size: 13px;
  color: #64748b;
  animation: titleFade 1s ease 1.3s both;
  flex-wrap: wrap;
  gap: 10px;
}

.rememberRow label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.rememberRow label:hover { color: #0B347F; }

.rememberRow input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #0B347F;
}

.forgotLink {
  color: #4E8FE8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.forgotLink:hover { color: #0B347F; }

/* ============ LOGIN BUTTON ============ */

.loginBtn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #0B347F, #1F5ED6, #4E8FE8);
  background-size: 200% 200%;
  color: white;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(11, 52, 127, 0.3);
  position: relative;
  overflow: hidden;
  animation: titleFade 1s ease 1.5s both;
  font-family: inherit;
}

.loginBtn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(11, 52, 127, 0.45);
  background-position: 100% 50%;
}

.loginBtn:active:not(:disabled) { transform: translateY(-1px); }

.loginBtn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loginBtn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.loginBtn:hover::before { left: 100%; }

/* ============ ERROR ============ */

.error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 15px;
  font-weight: 600;
  min-height: 20px;
}

/* ============ FOOTER ============ */

.powered {
  margin-top: 25px;
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 1px;
  animation: titleFade 1s ease 1.7s both;
}

.powered strong { color: #0B347F; font-weight: 700; }

/* ============ LOADING SPINNER ============ */

.loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
  .loginContainer { max-width: 400px; }
  .loginCard { padding: 40px 32px; border-radius: 24px; }
}

@media (max-width: 480px) {
  .login-page { padding: 15px; padding-top: 30px; align-items: flex-start; }
  .loginContainer { max-width: 100%; }
  .loginCard { padding: 35px 25px; border-radius: 22px; }
  .title { font-size: 24px; letter-spacing: 1.5px; }
  .subtitle { font-size: 11px; letter-spacing: 3px; }
  .logoCircle { width: 75px; height: 75px; font-size: 34px; }
  .welcome { margin-bottom: 25px; }
  .inputGroup input { padding: 14px 44px; font-size: 14px; }
  .inputIcon, .eyeIcon { font-size: 16px; }
  .loginBtn { padding: 15px; font-size: 14px; }
  .rememberRow { font-size: 12px; }
  .plane, .orb3 { display: none; }
  .orb1 { width: 250px; height: 250px; }
  .orb2 { width: 300px; height: 300px; }
}

@media (max-width: 360px) {
  .loginCard { padding: 28px 20px; }
  .title { font-size: 20px; }
  .logoCircle { width: 65px; height: 65px; font-size: 30px; }
  .inputGroup input { padding: 12px 40px; font-size: 13px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .login-page { align-items: flex-start; padding-top: 20px; padding-bottom: 20px; }
  .logoCircle { width: 60px; height: 60px; font-size: 28px; }
  .logoWrapper { margin-bottom: 10px; }
  .title { font-size: 22px; }
  .welcome { margin-bottom: 15px; }
  .inputGroup { margin-bottom: 12px; }
  .rememberRow { margin-bottom: 15px; }
}