/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-image: url("../img/space_background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #0f0a1e; /* Fallback dark purple */
}

/* Dark Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Main Container */
.login-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Logo Section */
.logo-section {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  height: 4rem;
  width: auto;
  margin-bottom: 1rem;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.brand-subtitle {
  color: #d1d5db;
  font-size: 1rem;
}

/* Glass Card */
.login-card {
  width: 100%;
  max-width: 28rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Alert Messages */
.alert {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fef3c7;
}

.alert-success {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}

.alert-info {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #bfdbfe;
}

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

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  color: #ffffff;
  font-size: 1rem;
  transition: all 0.2s ease;
  outline: none;
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form Options Row */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.remember-me {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  margin-right: 0.5rem;
  cursor: pointer;
  accent-color: #7c3aed;
}

.remember-me span {
  font-size: 0.875rem;
  color: #d1d5db;
}

.forgot-password {
  font-size: 0.875rem;
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password:hover {
  color: #c4b5fd;
}

/* Primary Button */
.btn-primary {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #7c3aed;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #6d28d9;
  box-shadow: 0 20px 25px -5px rgba(124, 58, 237, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.divider-text {
  padding: 0 1rem;
  font-size: 0.875rem;
  color: #9ca3af;
  background: transparent;
}

/* Social Buttons */
.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-social {
  width: 100%;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-google:hover {
  background: #f3f4f6;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.btn-social-default {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-social-default:hover {
  background: rgba(255, 255, 255, 0.2);
}

.social-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.social-icon-placeholder {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Sign Up Link */
.signup-link {
  margin-top: 1.5rem;
  text-align: center;
  color: #d1d5db;
  font-size: 0.875rem;
}

.signup-link a {
  color: #a78bfa;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.signup-link a:hover {
  color: #c4b5fd;
}

/* Footer */
.footer {
  text-align: center;
  color: #9ca3af;
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

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

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

  .forgot-password {
    align-self: flex-start;
  }
}

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

.login-card {
  animation: fadeIn 0.3s ease-out;
}

/* ========================================
   Additional Styles for New Templates
   ======================================== */

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

.page-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.2);
  border-radius: 50%;
  color: #a78bfa;
}

.page-icon-info {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.page-icon-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.page-icon-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.page-icon-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.page-description {
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Form Actions */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Secondary Button */
.btn-secondary {
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  color: #a78bfa;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid rgba(167, 139, 250, 0.5);
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(167, 139, 250, 0.1);
  border-color: #a78bfa;
}

/* Button with Icon */
.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-icon {
  flex-shrink: 0;
}

/* Password Requirements */
.password-requirements {
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.5rem;
  margin-top: -0.5rem;
}

.requirements-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.requirements-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.requirements-list li {
  font-size: 0.875rem;
  color: #bfdbfe;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.requirements-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #60a5fa;
}

/* Back Link */
.back-link {
  text-align: center;
  margin-top: 1.5rem;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #a78bfa;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link a:hover {
  color: #c4b5fd;
}

/* Info Box */
.info-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.info-box-icon {
  flex-shrink: 0;
  color: #60a5fa;
}

.info-box-content {
  flex: 1;
}

.info-box-content p {
  font-size: 0.875rem;
  color: #bfdbfe;
  margin: 0;
}

/* OTP Input */
.otp-input {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5rem;
  padding: 1rem;
}

.otp-input::placeholder {
  letter-spacing: 0.25rem;
  opacity: 0.5;
}

/* Form Hint */
.form-hint {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.5rem;
}

/* Alternative Options */
.alternative-options {
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.alternative-text {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.alternative-link {
  color: #a78bfa;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.alternative-link:hover {
  color: #c4b5fd;
}

/* TOTP Setup Styles */
.login-card-wide {
  max-width: 36rem;
}

.totp-setup {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.totp-step {
  display: flex;
  gap: 1rem;
}

.step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7c3aed;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 50%;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.step-description {
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.qr-code-container {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: #ffffff;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.qr-code {
  width: 180px;
  height: 180px;
}

.manual-setup {
  text-align: center;
}

.manual-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.secret-key {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.375rem;
  font-family: "SF Mono", Monaco, "Inconsolata", "Fira Mono", "Droid Sans Mono",
    monospace;
  font-size: 0.75rem;
  color: #e5e7eb;
  word-break: break-all;
}

/* Form Row for Registration */
.form-row {
  display: flex;
  gap: 1rem;
}

.form-group-half {
  flex: 1;
  min-width: 0;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .login-card-wide {
    max-width: 100%;
  }

  .totp-step {
    flex-direction: column;
  }

  .step-number {
    margin-bottom: 0.5rem;
  }

  .qr-code {
    width: 150px;
    height: 150px;
  }

  .form-row {
    flex-direction: column;
    gap: 1.25rem;
  }

  .page-icon {
    width: 3rem;
    height: 3rem;
  }

  .page-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* Pulse Animation for Verification */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.page-icon-info {
  animation: pulse 2s ease-in-out infinite;
}
