/* Aether Modern Minimalist Design System */

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

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0d1220;
  --card-bg: rgba(17, 24, 39, 0.65);
  --card-border: rgba(255, 255, 255, 0.07);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;
  --accent-start: #6366f1;
  --accent-end: #a855f7;
  --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  --accent-glow: rgba(99, 102, 241, 0.3);
  --error: #ef4444;
  --success: #10b981;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

/* Ambient Animated Background Blobs */
.bg-blobs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  mix-blend-mode: screen;
  animation: float 20s infinite alternate;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-start);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-end);
  bottom: -15%;
  right: -10%;
  animation-delay: -5s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: #3b82f6;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.08;
  animation: float 25s infinite alternate-reverse;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(40px, -60px) scale(1.1) rotate(180deg);
  }
  100% {
    transform: translate(-20px, 20px) scale(0.9) rotate(360deg);
  }
}

/* Auth Card */
.auth-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  z-index: 1;
}

.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
              0 1px 3px rgba(255, 255, 255, 0.05) inset;
  transition: var(--transition-smooth);
}

.auth-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 
              0 1px 3px rgba(255, 255, 255, 0.08) inset;
}

/* Header & Logo */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  margin-bottom: 16px;
}

.logo-icon {
  width: 24px;
  height: 24px;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Segmented Tab Controls */
.tab-group {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 14px;
  position: relative;
  margin-bottom: 32px;
}

.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: var(--transition-smooth);
  z-index: 0;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 0;
  cursor: pointer;
  z-index: 1;
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.tab-btn.active {
  color: var(--text-primary);
}

/* Form Slider Configuration */
.form-slider-wrapper {
  overflow: hidden;
  width: 100%;
}

.form-slider {
  display: flex;
  width: 200%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.auth-form {
  width: 50%;
  transition: opacity 0.4s ease;
}

.auth-form:not(.active) {
  opacity: 0;
  pointer-events: none;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Input Fields Styling */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

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

.input-wrapper input {
  width: 100%;
  padding: 13px 16px 13px 46px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-start);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-wrapper input:focus + svg.input-icon {
  color: var(--accent-start);
}

.password-toggle {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.password-toggle:hover {
  color: var(--text-secondary);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Terms / Options Checkbox */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  display: none;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  background: rgba(255, 255, 255, 0.02);
}

.checkbox-label input:checked + .custom-checkbox {
  background: var(--accent-gradient);
  border-color: transparent;
}

.checkbox-label input:checked + .custom-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

.custom-checkbox svg {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transform: scale(0.6);
  transition: var(--transition-smooth);
}

.forgot-link {
  color: var(--accent-start);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.forgot-link:hover {
  color: var(--accent-end);
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* Submit Buttons */
.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
}

.submit-btn:hover::before {
  left: 100%;
  transition: 0.7s ease-in-out;
}

/* Button Loading State */
.submit-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

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

.submit-btn.loading .btn-text {
  opacity: 0;
  transform: translateY(-5px);
}

.spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s infinite linear;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-smooth);
}

.submit-btn.loading .spinner {
  opacity: 1;
  transform: scale(1);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
  max-width: 400px;
  width: calc(100% - 48px);
}

.toast {
  background: rgba(13, 18, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateX(120%);
  animation: slideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
  position: relative;
  overflow: hidden;
}

@keyframes slideIn {
  to { transform: translateX(0); }
}

.toast.removing {
  animation: slideOut 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes slideOut {
  to { transform: translateX(120%); opacity: 0; }
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.info .toast-icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-start);
}

.toast.success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.toast.error .toast-icon {
  background: rgba(239, 68, 110, 0.15);
  color: var(--error);
}

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  margin-top: -2px;
  transition: var(--transition-smooth);
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent-gradient);
  width: 100%;
  transform-origin: left;
  animation: progress 5s linear forwards;
}

.toast.success .toast-progress {
  background: var(--success);
}

.toast.error .toast-progress {
  background: var(--error);
}

@keyframes progress {
  to { transform: scaleX(0); }
}

/* Footer / Branding */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Media Queries for Responsiveness */
@media (max-width: 480px) {
  .auth-card {
    padding: 30px 20px;
    border-radius: 20px;
  }
  
  .auth-header h1 {
    font-size: 1.5rem;
  }
  
  .toast-container {
    top: 16px;
    right: 16px;
    width: calc(100% - 32px);
  }
}
