:root {
  --primary-purple: #6d28d9;
  --primary-purple-light: #8b5cf6;
  --primary-purple-dark: #4c1d95;
  --primary-blue: #2563eb;
  --primary-blue-light: #60a5fa;
  --primary-blue-dark: #1e40af;
  
  --gradient-main: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
  --gradient-btn: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #3b82f6 100%);
  --gradient-btn-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
  
  --bg-dark: #0f172a;
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #7c3aed;
  --input-bg: #f8fafc;
}

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

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f1f5f9;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(37, 99, 235, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.12) 0%, transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--text-main);
  position: relative;
  overflow-x: hidden;
}

/* Formas luminosas de fundo com contenção */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
}

.shape-1 {
  width: 380px;
  height: 380px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  top: -80px;
  left: -80px;
}

.shape-2 {
  width: 420px;
  height: 420px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  bottom: -100px;
  right: -100px;
}

/* Login Card Container */
.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: auto;
  animation: fadeInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 45px -15px rgba(79, 70, 229, 0.15),
              0 0 1px 1px rgba(124, 58, 237, 0.05);
  padding: 2.25rem 2rem 1.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
  box-shadow: 0 25px 50px -12px rgba(79, 70, 229, 0.2),
              0 0 0 1px rgba(99, 102, 241, 0.2);
}

/* Brand Header */
.brand-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.brand-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 1rem;
  background: var(--gradient-main);
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
  color: #ffffff;
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
  transition: transform 0.3s ease;
}

.brand-icon-wrapper:hover {
  transform: scale(1.05) rotate(4deg);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0;
}

/* Form Styles */
.form-group-custom {
  margin-bottom: 1.15rem;
  position: relative;
}

.form-label-custom {
  font-size: 0.825rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
  display: block;
}

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

.input-icon-group i.input-icon {
  position: absolute;
  left: 1rem;
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-control-custom {
  width: 100%;
  height: 46px;
  padding: 0.55rem 1rem 0.55rem 2.65rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--input-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 0.75rem;
  outline: none;
  transition: all 0.25s ease;
}

.form-control-custom:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.form-control-custom:focus + i.input-icon {
  color: var(--primary-purple);
}

.password-toggle-btn {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  color: #94a3b8;
  padding: 0.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: 0.5rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle-btn:hover {
  color: var(--primary-purple);
  background-color: rgba(124, 58, 237, 0.08);
}

/* Submit Button */
.btn-login-custom {
  width: 100%;
  height: 48px;
  border-radius: 0.75rem;
  background: var(--gradient-btn);
  border: none;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 8px 18px -4px rgba(99, 102, 241, 0.45);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 1.35rem;
  position: relative;
  overflow: hidden;
}

.btn-login-custom:hover {
  background: var(--gradient-btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 22px -5px rgba(99, 102, 241, 0.55);
}

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

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

/* Spinner inside button */
.btn-spinner {
  display: none;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-login-custom.loading .btn-spinner {
  display: inline-block;
}

.btn-login-custom.loading .btn-text,
.btn-login-custom.loading i.btn-icon {
  display: none;
}

/* Dynamic Alert */
.alert-feedback {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.15rem;
  align-items: center;
  gap: 0.5rem;
  animation: slideInDown 0.3s ease forwards;
}

.alert-feedback.show {
  display: flex;
}

.alert-feedback.alert-danger-custom {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.alert-feedback.alert-success-custom {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

/* Footer / Meta info */
.login-footer {
  text-align: center;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8rem;
  color: #94a3b8;
}

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive adjustments */
@media (max-height: 650px) {
  body {
    overflow-y: auto;
    align-items: flex-start;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.75rem 1.35rem 1.35rem;
    border-radius: 1.15rem;
  }
  
  .brand-title {
    font-size: 1.35rem;
  }
}
