/* ===== Variables ===== */
:root {
  --primary: #FF6B35;
  --primary-light: #ff8a5c;
  --primary-dark: #e55a28;
  --secondary: #2D3436;
  --secondary-light: #3d4446;
  --accent: #00B894;
  --accent-light: #00d4a8;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --error: #ef4444;
  --error-light: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--secondary);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* ===== Auth Container ===== */
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ===== Left Branding Panel ===== */
.auth-branding {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, #1a1f20 50%, var(--secondary-light) 100%);
  padding: 3rem;
  overflow: hidden;
}

.branding-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.brand-logo i {
  font-size: 2rem;
  color: var(--primary);
  background: rgba(255, 107, 53, 0.15);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.brand-logo span {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.branding-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.branding-subtitle {
  font-size: 1.05rem;
  color: var(--gray-400);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.branding-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  color: var(--gray-300);
  font-size: 0.95rem;
  font-weight: 500;
}

.feature-item i {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 107, 53, 0.1);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

/* Decorative Circles */
.branding-decoration {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
}

.circle-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -100px;
}

.circle-2 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  bottom: -80px;
  left: -80px;
}

.circle-3 {
  width: 200px;
  height: 200px;
  background: var(--primary-light);
  bottom: 20%;
  right: 10%;
}

/* ===== Right Form Panel ===== */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--white);
  position: relative;
}

.form-wrapper {
  width: 100%;
  max-width: 440px;
  position: relative;
}

/* ===== Form Card ===== */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  animation: fadeSlideIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.form-card.hidden {
  display: none;
}

.form-card.fade-out {
  animation: fadeSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ===== Form Header ===== */
.form-header {
  margin-bottom: 2rem;
}

.form-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.form-header p {
  font-size: 0.95rem;
  color: var(--gray-500);
}

/* ===== Input Groups ===== */
.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--gray-400);
  font-size: 0.875rem;
  pointer-events: none;
  transition: var(--transition);
}

.input-wrapper input {
  width: 100%;
  padding: 0.8125rem 2.75rem 0.8125rem 2.75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--secondary);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.input-wrapper input::placeholder {
  color: var(--gray-400);
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon {
  color: var(--primary);
}

/* When input-icon is before the input */
.input-wrapper:has(input:focus) .input-icon {
  color: var(--primary);
}

.input-wrapper input.input-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===== Error Messages ===== */
.error-message {
  display: block;
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 0.375rem;
  min-height: 1rem;
  line-height: 1rem;
}

/* ===== Password Toggle ===== */
.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 0.9rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--gray-600);
}

/* ===== Form Options (Remember / Forgot) ===== */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
}

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

.forgot-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
}

.forgot-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== Primary Button ===== */
.btn-primary {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-loader {
  font-size: 1rem;
}

/* ===== Social Button ===== */
.btn-social {
  width: 100%;
  padding: 0.8125rem;
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}

.btn-social:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-social i {
  font-size: 1.125rem;
}

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

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.form-divider span {
  font-size: 0.8125rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* ===== Form Switch ===== */
.form-switch {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.form-switch a {
  font-weight: 700;
  color: var(--primary);
}

.form-switch a:hover {
  text-decoration: underline;
}

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

  .auth-branding {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
    padding: 2rem 1.5rem;
  }

  .form-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
  }
}

@media (max-width: 480px) {
  .form-card {
    padding: 1.5rem;
  }

  .form-header h2 {
    font-size: 1.5rem;
  }

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

/* ===== Glassmorphism on larger screens ===== */
@media (min-width: 1025px) {
  .auth-form-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
}