:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --accent: #3b82f6;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  --bg-light: #f8fafc;
  --bg-light-secondary: #eff6ff;
  --surface-light: #ffffff;
  --text-light: #1e293b;
  --text-light-secondary: #64748b;
  --border-light: #e2e8f0;

  --bg-dark: #0f172a;
  --bg-dark-secondary: #1e293b;
  --surface-dark: #1e293b;
  --text-dark: #f8fafc;
  --text-dark-secondary: #cbd5e1;
  --border-dark: #334155;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
}

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

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

[data-theme="dark"] body {
  background: var(--bg-dark);
  color: var(--text-dark);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--surface-light);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all var(--transition);
  z-index: 100;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle {
  border-color: var(--border-dark);
  background: var(--surface-dark);
  color: var(--text-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Container */
.auth-wrapper {
  width: 100%;
  max-width: 1000px;
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-light);
  box-shadow: 0 25px 60px rgba(37, 99, 235, 0.15);
  transition: box-shadow var(--transition), background var(--transition);
}

[data-theme="dark"] .auth-container {
  background: var(--surface-dark);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

/* Left Side */
.auth-left {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  background: linear-gradient(135deg, var(--bg-light-secondary), var(--surface-light));
}

[data-theme="dark"] .auth-left {
  background: linear-gradient(135deg, var(--bg-dark-secondary), var(--surface-dark));
}

.auth-left img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.auth-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.7), rgba(37, 99, 235, 0.3));
  z-index: 1;
}

.left-content {
  position: relative;
  z-index: 2;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.left-content h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
  animation: slideUp 0.6s ease-out;
}

.left-content p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 24px;
  opacity: 0.95;
  animation: slideUp 0.6s ease-out 0.1s both;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.6s ease-out 0.2s both;
}

.feature-item {
  font-size: 14px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Right Side */
.auth-right {
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.tab-btn {
  padding: 14px 20px;
  border: 2px solid var(--border-light);
  background: transparent;
  color: var(--text-light-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  font-family: "Poppins", sans-serif;
}

.tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

[data-theme="dark"] .tab-btn {
  border-color: var(--border-dark);
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .tab-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Error Alert */
.error-alert {
  display: none;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  color: var(--error);
  font-size: 14px;
  animation: slideDown 0.3s ease-out;
}

[data-theme="dark"] .error-alert {
  background: rgba(239, 68, 68, 0.15);
}

/* Forms */
.auth-form {
  display: none;
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  color: var(--text-light);
  margin-bottom: 28px;
  font-size: 24px;
  font-weight: 600;
}

[data-theme="dark"] .auth-form h2 {
  color: var(--text-dark);
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

.label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

[data-theme="dark"] .form-group label {
  color: var(--text-dark);
}

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

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-light);
  background: var(--bg-light);
  color: var(--text-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: "Poppins", sans-serif;
  transition: all var(--transition);
}

[data-theme="dark"] .auth-form input[type="email"],
[data-theme="dark"] .auth-form input[type="password"],
[data-theme="dark"] .auth-form input[type="text"] {
  background: var(--bg-dark-secondary);
  color: var(--text-dark);
  border-color: var(--border-dark);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-form input.error {
  border-color: var(--error);
}

.auth-form input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-icon {
  position: absolute;
  right: 14px;
  font-size: 18px;
  display: none;
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.toggle-password:hover {
  opacity: 1;
}

.error-text {
  display: none;
  color: var(--error);
  font-size: 12px;
  margin-top: 6px;
}

.forgot-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  transition: opacity var(--transition);
}

.forgot-btn:hover {
  opacity: 0.8;
}

.forgot-password{
  text-align:right;
  margin-top:10px;
  margin-bottom:10px;
}

.forgot-password a{
  color:#4f8cff;
  text-decoration:none;
  font-size:14px;
  font-weight:500;
}

.forgot-password a:hover{
  text-decoration:underline;
}


/* Checkbox */
.form-group.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

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

.form-group.checkbox label {
  margin: 0;
  font-size: 14px;
  cursor: pointer;
}

/* Password Strength */
.password-strength {
  margin-top: 12px;
  display: none;
}

.strength-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

[data-theme="dark"] .strength-bar {
  background: var(--border-dark);
}

.strength-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 0;
  background: var(--error);
  transition: width var(--transition), background-color var(--transition);
}

.strength-text {
  font-size: 12px;
  color: var(--text-light-secondary);
}

[data-theme="dark"] .strength-text {
  color: var(--text-dark-secondary);
}

.password-requirements {
  font-size: 12px;
  color: var(--text-light-secondary);
  margin-bottom: 20px;
}

[data-theme="dark"] .password-requirements {
  color: var(--text-dark-secondary);
}

/* Buttons */
.auth-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 16px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.auth-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-text {
  transition: opacity var(--transition);
}

.btn-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.auth-btn:disabled .btn-text {
  opacity: 0;
}

.auth-btn:disabled .btn-loader {
  display: block;
}

/* Footer Text */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-light-secondary);
}

[data-theme="dark"] .form-footer {
  color: var(--text-dark-secondary);
}

.form-footer.text-center {
  text-align: center;
}

.switch-tab-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  transition: opacity var(--transition);
  padding: 0;
  margin-left: 4px;
}

.switch-tab-btn:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-light-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  margin-bottom: 16px;
  transition: all var(--transition);
  padding: 0;
}

[data-theme="dark"] .back-btn {
  color: var(--text-dark-secondary);
}

.back-btn:hover {
  color: var(--primary);
  gap: 4px;
}

/* Success Message */
.success-message {
  display: none;
  text-align: center;
  padding: 40px 20px;
  opacity: 0;
  animation: slideDown 0.3s ease-out forwards;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--success), #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 40px;
  animation: scaleIn 0.4s ease-out 0.2s both;
}

.success-message h3 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text-light);
}

[data-theme="dark"] .success-message h3 {
  color: var(--text-dark);
}

.success-message p {
  color: var(--text-light-secondary);
  font-size: 14px;
}

[data-theme="dark"] .success-message p {
  color: var(--text-dark-secondary);
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-left {
    min-height: 250px;
  }

  .left-content h1 {
    font-size: 36px;
  }

  .auth-right {
    padding: 40px 30px;
  }
}

@media (max-width: 600px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
    font-size: 20px;
    top: 16px;
    right: 16px;
  }

  .auth-right {
    padding: 30px 20px;
  }

  .auth-tabs {
    gap: 8px;
    margin-bottom: 24px;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .auth-form h2 {
    font-size: 20px;
    margin-bottom: 24px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .left-content h1 {
    font-size: 32px;
    margin-bottom: 6px;
  }

  .left-content p {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .features-list {
    gap: 8px;
  }

  .feature-item {
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  .auth-wrapper {
    padding: 0;
  }

  .auth-container {
    border-radius: 0;
  }

  .auth-right {
    padding: 24px 16px;
  }

  .auth-tabs {
    margin-bottom: 20px;
  }

  .auth-form h2 {
    font-size: 18px;
  }

  .left-content h1 {
    font-size: 28px;
  }
}
