/* Authentication pages - new design copied from authentication-pages-new-design.html */

.aigf-auth-wrapper {
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
}

/* Background ambient blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.2;
  z-index: -1;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  background: var(--primary);
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.blob-2 {
  background: var(--neon);
  width: 250px;
  height: 250px;
  bottom: 10%;
  right: 10%;
  animation-delay: 5s;
}

.blob-3 {
  background: var(--electric-blue);
  width: 200px;
  height: 200px;
  top: 50%;
  right: 20%;
  animation-delay: 10s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(20px, -20px) scale(1.05);
  }
  50% {
    transform: translate(-15px, 15px) scale(0.95);
  }
  75% {
    transform: translate(-10px, -10px) scale(1.02);
  }
}

.aigf-auth-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 0 0 80px rgba(155, 93, 229, 0.15);
  animation: card-appear 0.8s ease-out;
  position: relative;
  overflow: hidden;
}
.aigf-auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  animation: shimmer 6s infinite;
}
@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shimmer {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.brand {
  text-align: center;
  margin-bottom: 32px;
}
.logo {
  width: 70px;
  height: 70px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo i {
  font-size: 28px;
  color: var(--text);
}

.tagline {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 500;
}

.title-section {
  margin-bottom: 28px;
  text-align: center;
}
.title-section h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.title-section p {
  color: var(--text);
  font-size: 14px;
}
.title-section a {
  color: var(--accent1);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}
.title-section a:hover {
  color: var(--neon);
  text-shadow: 0 0 8px rgba(155, 93, 229, 0.5);
}
.title-section a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--neon);
  transition: width 0.3s;
}
.title-section a:hover::after {
  width: 100%;
}

.aigf-form-group {
  margin-bottom: 20px;
  position: relative;
}
.aigf-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.aigf-input-wrapper {
  position: relative;
}
.aigf-form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
}
.aigf-form-input::placeholder {
  color: var(--muted);
}
.aigf-form-input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 2px rgba(155, 93, 229, 0.2),
    0 0 15px rgba(155, 93, 229, 0.3);
  transform: translateY(-1px);
}
.password-toggle,
.aigf-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}

.error-message {
  color: var(--error);
  font-size: 13px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
/* error style defined earlier */

.secondary-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
}
.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.checkbox.checked {
  background: var(--primary1);
  border-color: var(--primary1);
}
.checkbox.checked::after {
  content: "✓";
  color: var(--electric-blue);
  font-size: 12px;
  font-weight: bold;
}
.forgot-password {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s ease;
}
.forgot-password:hover {
  color: var(--neon);
  text-shadow: 0 0 8px rgba(155, 93, 229, 0.5);
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--neon));
  border: none;
  border-radius: 50px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(155, 93, 229, 0.4);
  margin-bottom: 24px;
}
.login-btn:hover {
  transform: scale(1.01);
  box-shadow: 0 0 30px rgba(155, 93, 229, 0.6), 0 0 40px rgba(155, 93, 229, 0.3);
}
.login-btn:active {
  transform: scale(0.98);
}
.login-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}
.login-btn:hover::after {
  left: 100%;
}

/* Loading state: show spinner/text switching */
.login-btn .aigf-btn-loading { display: none; align-items: center; gap: 8px; font-weight:600; font-size:14px; }
.login-btn.loading .aigf-btn-text { display: none !important; }
.login-btn.loading .aigf-btn-loading { display: inline-flex !important; }
.aigf-btn-loading svg, .aigf-btn-loading .aigf-spinner { animation: spin 1s linear infinite; }

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-btn.loading { cursor: progress; }

@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) }}

.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--muted);
  font-size: 13px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--muted), transparent);
}
.divider span {
  padding: 0 12px;
}
.social-login {
  display: flex;
  gap: 16px;
}
.social-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text);
}
.social-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(155, 93, 229, 0.2);
  transform: translateY(-1px);
}
.social-btn i {
  font-size: 18px;
}

/* Password strength */
.aigf-password-strength {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.aigf-password-strength.weak {
  color: var(--error);
}
.aigf-password-strength.medium {
  color: var(--warning);
}
.aigf-password-strength.strong {
  color: var(--success);
}

/* Email validation */
.aigf-email-validation {
  margin-top: 8px;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.3s ease;
}
.aigf-email-validation.success {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.aigf-email-validation.error {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Verification form */
.aigf-verification-form {
  animation: slideIn 0.3s ease;
}
.aigf-verification-form h3 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}
.aigf-verification-form p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.aigf-verification-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 16px;
}
.aigf-verification-actions .aigf-link {
  background: none;
  border: none;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: color 0.3s ease;
}
.aigf-verification-actions .aigf-link:hover {
  color: var(--primary-hover);
}
.aigf-verification-actions .aigf-link:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: var(--accent1);
}

.security-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.security-message i {
  color: var(--electric-blue);
}

/* Responsive block defined again later; removed duplicate. */

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(20px, -20px) scale(1.05);
  }
  50% {
    transform: translate(-15px, 15px) scale(0.95);
  }
  75% {
    transform: translate(-10px, -10px) scale(1.02);
  }
}

/* Login Card (styles are provided near the top of the file; this duplicate block removed to prevent duplication) */

@keyframes card-appear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* Branding Section */
.brand {
  text-align: center;
  margin-bottom: 32px;
}

@keyframes ripple {
  0%,
  100% {
    transform: scale(1);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}

.brand h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-light1);
  letter-spacing: 0.5px;
}

.tagline {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  font-weight: 500;
}

/* Title Section */
.title-section {
  margin-bottom: 28px;
  text-align: center;
}

.title-section h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-light1);
}

.title-section p {
  color: var(--text);
  font-size: 14px;
}

.title-section a {
  color: var(--accent1);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.title-section a:hover {
  color: var(--neon);
  text-shadow: 0 0 8px rgba(155, 93, 229, 0.5);
}

.title-section a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--neon);
  transition: width 0.3s ease;
}

.title-section a:hover::after {
  width: 100%;
}

/* Form Styling (prefixed to avoid CSS collisions) */
/* Form fields prefixed earlier in the file. Duplicate rules removed. */

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.password-toggle:hover {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(179, 136, 255, 0.5);
}

/* Error State */
.error-message {
  color: var(--error);
  font-size: 13px;
  margin-top: 6px;
  align-items: center;
  gap: 6px;
}

.error-message i {
  font-size: 14px;
}

.error .aigf-form-input {
  border-color: var(--error);
  background: var(--error-bg);
}

/* Secondary Actions */
  /* no-op; responsive auth card spacing handled in the earlier block */
.secondary-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 14px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.checkbox.checked {
  background: var(--primary1);
  border-color: var(--primary1);
}

.checkbox.checked::after {
  content: "✓";
  color: var(--electric-blue);
  font-size: 12px;
  font-weight: bold;
}

.forgot-password {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s ease;
}

.forgot-password:hover {
  color: var(--neon);
  text-shadow: 0 0 8px rgba(155, 93, 229, 0.5);
}

/* Login Button */
.login-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--neon));
  border: none;
  border-radius: 50px;
  color: var(--text-light1);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(155, 93, 229, 0.4);
  margin-bottom: 24px;
}

.login-btn:hover {
  transform: scale(1.01);
  box-shadow: 0 0 30px rgba(155, 93, 229, 0.6), 0 0 40px rgba(155, 93, 229, 0.3);
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
  );
  transition: left 0.5s;
}

.login-btn:hover::after {
  left: 100%;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--muted), transparent);
}

.divider span {
  padding: 0 12px;
}

/* Social Login */
.social-login {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.social-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
}

.social-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(155, 93, 229, 0.2);
  transform: translateY(-1px);
}

.social-btn i {
  font-size: 18px;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent1);
}

/* Security Message */
.security-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.security-message i {
  color: var(--electric-blue);
}

/* Responsive Design */
@media (max-width: 480px) 
{
  .aigf-auth-card {
    padding: 28px 24px;
    border-radius: 20px;
  }

  .secondary-actions {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .social-login {
    flex-direction: column;
  }
}

/* ===== EMAIL VERIFICATION SECTION ===== */
.aigf-verification-section {
  animation: fade-in 0.5s ease-out;
}

.aigf-verification-section .title-section {
  margin-bottom: 24px;
  text-align: center;
}

.aigf-verification-section .title-section h2 {
  color: var(--text);
  margin-bottom: 8px;
}

.aigf-verification-section .title-section p {
  color: var(--muted);
  margin-bottom: 4px;
}

.aigf-verification-section .title-section strong {
  color: var(--accent1);
}

.aigf-code-help {
  margin-top: 4px;
}

.aigf-code-help small {
  color: var(--muted);
  font-size: 12px;
}

.aigf-verification-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 16px;
}

.aigf-verification-actions .aigf-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent1);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.aigf-verification-actions .aigf-link:hover {
  color: var(--electric-blue);
  background: rgba(52, 152, 219, 0.1);
}

.aigf-verification-actions .aigf-link i {
  font-size: 12px;
}

/* Verification code input specific styling */
#verification_code {
  text-align: center;
  letter-spacing: 2px;
  font-size: 18px;
  font-weight: 600;
}

/* Animation for fade in */
@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide register form when verification is shown */
.aigf-auth-card.verification-mode #registerForm {
  display: none;
}

.aigf-auth-card.verification-mode #auth-footer .divider {
  display: none;
}

.aigf-auth-card.verification-mode #auth-footer p:last-child {
  display: none;
}

/* Responsive verification section */
@media (max-width: 480px) {
  .aigf-verification-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .aigf-verification-actions .aigf-link {
    justify-content: center;
    width: 100%;
  }
}

/* ===== OAUTH AUTHENTICATION STYLES ===== */
.aigf-oauth-section {
  margin-bottom: 24px;
}

.aigf-oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 8px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.aigf-oauth-btn:hover {
  border-color: var(--accent1);
  background: rgba(52, 152, 219, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aigf-oauth-btn:active {
  transform: translateY(0);
}

.aigf-oauth-btn.aigf-oauth-google {
  border-color: #4285f4;
}

.aigf-oauth-btn.aigf-oauth-google:hover {
  background: rgba(66, 133, 244, 0.05);
  border-color: #4285f4;
}

.aigf-oauth-btn .oauth-icon {
  flex-shrink: 0;
}

.aigf-oauth-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.aigf-oauth-btn.loading .oauth-icon {
  animation: spin 1s linear infinite;
}

.oauth-divider {
  position: relative;
  text-align: center;
  margin: 20px 0;
}

.oauth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-border);
}

.oauth-divider span {
  background: var(--glass-bg);
  padding: 0 16px;
  color: var(--muted);
  font-size: 14px;
  position: relative;
}

/* OAuth Error Messages */
.aigf-oauth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  color: #ef4444;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInDown 0.3s ease-out;
}

.aigf-oauth-error svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* OAuth Success Messages */
.aigf-oauth-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  color: #22c55e;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInDown 0.3s ease-out;
}

.aigf-oauth-success svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* OAuth Processing Messages */
.aigf-oauth-processing {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  color: #3b82f6;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInDown 0.3s ease-out;
}

.oauth-spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.oauth-spinner svg {
  width: 100%;
  height: 100%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* OAuth responsive styles */
@media (max-width: 480px) {
  .aigf-oauth-btn {
    font-size: 13px;
    padding: 10px 12px;
    gap: 8px;
  }
  
  .oauth-divider {
    margin: 16px 0;
  }
  
  .oauth-divider span {
    padding: 0 12px;
    font-size: 13px;
  }
}
