/* TIBS Login Page - High-Tech Design */
:root {
  /* TIBS Brand Colors */
  --tibs-primary: #120899;
  --tibs-blue: #3862f9;
  --tibs-cyan: #03b3db;
  --tibs-teal: #3bedcb;

  /* UI Colors */
  --bg-dark: #050714;
  --bg-card: rgba(18, 8, 153, 0.15);
  --card-border: rgba(59, 237, 203, 0.2);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.1);
  --input-focus: rgba(59, 237, 203, 0.5);
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: #ef4444;
  --error-text: #fca5a5;

  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

/* Animated Background */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Gradient Orbs */
.gradient-orbs {
  position: absolute;
  inset: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--tibs-primary) 0%, transparent 70%);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--tibs-blue) 0%, transparent 70%);
  bottom: -150px;
  right: -150px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--tibs-cyan) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(50px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-30px, 50px) scale(0.95);
  }
  75% {
    transform: translate(-50px, -20px) scale(1.02);
  }
}

/* Floating Particles */
.particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  background: var(--tibs-teal);
  border-radius: 50%;
  opacity: 0.3;
  animation: particle-float 20s linear infinite;
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Grid Overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 98, 249, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 98, 249, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 30s linear infinite;
}

@keyframes grid-move {
  0% {
    transform: perspective(500px) rotateX(60deg) translateY(0);
  }
  100% {
    transform: perspective(500px) rotateX(60deg) translateY(50px);
  }
}

/* Login Container */
.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glassmorphism Card */
.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  padding: 2.5rem;
  box-shadow:
    0 0 0 1px rgba(59, 237, 203, 0.1),
    0 20px 50px -10px rgba(0, 0, 0, 0.5),
    0 0 100px -50px var(--tibs-cyan);
}

/* Logo */
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  margin-bottom: 1rem;
}

.logo-img {
  height: 50px;
  width: auto;
  filter: drop-shadow(0 0 20px rgba(59, 237, 203, 0.3));
  animation: logo-glow 3s ease-in-out infinite;
}

@keyframes logo-glow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(59, 237, 203, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(59, 237, 203, 0.5));
  }
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Error Message */
.error-message {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.error-message::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--error-border);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
  outline: none;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--tibs-teal);
  box-shadow: 0 0 0 3px rgba(59, 237, 203, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.form-group input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--tibs-teal);
}

/* Toggle Password */
.toggle-password {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: var(--tibs-teal);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

/* Form Row */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--tibs-teal);
  cursor: pointer;
}

.checkbox-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Forgot Link */
.forgot-link {
  font-size: 0.875rem;
  color: var(--tibs-teal);
  text-decoration: none;
  transition: all 0.2s ease;
}

.forgot-link:hover {
  color: var(--tibs-cyan);
  text-decoration: underline;
}

/* Submit Button */
.btn-login {
  position: relative;
  background: linear-gradient(135deg, var(--tibs-blue) 0%, var(--tibs-cyan) 100%);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--tibs-cyan) 0%, var(--tibs-teal) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-login:hover::before {
  opacity: 1;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(59, 237, 203, 0.5);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-text,
.btn-loading,
.btn-arrow {
  position: relative;
  z-index: 1;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.btn-login:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-loading .spinner {
  width: 18px;
  height: 18px;
}

/* Footer */
.login-footer {
  margin-top: 2rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--input-border);
}

.login-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Tech Badge */
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--tibs-teal);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pulse {
  width: 8px;
  height: 8px;
  background: var(--tibs-teal);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 237, 203, 0.5);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 237, 203, 0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .orb-1 {
    width: 300px;
    height: 300px;
  }

  .orb-2 {
    width: 250px;
    height: 250px;
  }

  .orb-3 {
    width: 200px;
    height: 200px;
  }
}

/* Select Styling */
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-group select option {
  background: var(--bg-dark);
  color: var(--text-primary);
}
