@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #080d1a;
  --bg-secondary: #101625;
  --bg-tertiary: #161e31;
  --bg-glass: rgba(16, 22, 37, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #388eff;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent-primary: #388eff;
  --accent-secondary: #6366f1;
  
  --shadow-main: 0 20px 50px rgba(0, 0, 0, 0.4);
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-in-out;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Background animated decorative elements */
.glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  mix-blend-mode: screen;
  pointer-events: none;
}

.glow-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(56, 142, 255, 0.35) 0%, transparent 70%);
  animation: float 25s infinite alternate ease-in-out;
}

.glow-2 {
  bottom: -15%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  animation: float-reverse 30s infinite alternate ease-in-out;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8%, 10%) scale(1.15); }
}

@keyframes float-reverse {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-8%, -10%) scale(1.1); }
}

/* Wrapper */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Brand Section */
.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(56, 142, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent-primary);
  margin-top: 2px;
}

/* Glassmorphic Login Card */
.login-card {
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-main);
  animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}

/* Subtle border glow */
.login-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
}

.card-header {
  margin-bottom: 28px;
  text-align: left;
}

.card-header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.card-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Form Styles */
#auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-fast);
}

.input-wrapper input {
  width: 100%;
  background: rgba(8, 13, 26, 0.4);
  border: 1px solid var(--border-color);
  color: #ffffff;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-normal);
}

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

.input-wrapper input:focus {
  border-color: var(--border-focus);
  background: rgba(8, 13, 26, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 142, 255, 0.15);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
  color: var(--border-focus);
}

/* Submit Button */
.submit-btn {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  border: none;
  color: #ffffff;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  filter: brightness(1.08);
}

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

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Button Loading Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  animation: spin 0.8s linear infinite;
}

.opacity-25 { opacity: 0.25; }
.opacity-75 { opacity: 0.75; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Alert Box */
.alert-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  color: #ef4444;
  font-size: 0.88rem;
  line-height: 1.4;
  animation: shake 0.4s ease-in-out;
}

.alert-box.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
}

/* Footer styling */
.login-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  animation: fadeIn 1s ease both;
  animation-delay: 0.4s;
}

/* Animations definition */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Responsive constraints */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }
  .brand-title {
    font-size: 1.25rem;
  }
}
