/* Auth page - matches onboarding design exactly */

/* ===== AUTH PAGE STYLES ===== */

.auth-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  z-index: calc(var(--z-modal) + 50);
}

/* Auth brand - same as onboarding */
.auth-brand {
  position: fixed;
  top: 24px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: calc(var(--z-modal) + 52);
}

/* Language switcher - positioned next to brand */
.auth-brand .language-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.language-separator {
  width: 1px;
  height: 16px;
  background: var(--color-border-light);
}

.language-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.language-icon {
  font-size: 14px;
  color: var(--color-text-tertiary);
  margin-right: 6px;
  transition: color 0.2s ease;
}

.language-select {
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--color-text-tertiary);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 16px;
  min-width: 6px;
  font-weight: 400;
  transition: color 0.2s ease;
}

.language-select:focus,
.language-select:focus-visible,
.language-select:focus-within,
.language-select:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.language-switcher:hover .language-icon,
.language-switcher:hover .language-select {
  color: var(--color-text-secondary);
}

.language-chevron {
  position: absolute;
  right: 6px;
  font-size: 11px;
  color: var(--color-text-tertiary);
  pointer-events: none;
  transition: all 0.2s ease;
  transform-origin: center;
}

.language-switcher:hover .language-chevron {
  color: var(--color-text-secondary);
  transform: translateY(1px);
}

/* Arrow rotation animation when dropdown is opened */
.language-select:focus + .language-chevron {
  transform: rotate(180deg);
}

.language-select-wrapper:hover .language-select:focus + .language-chevron {
  transform: rotate(180deg) translateY(1px);
  color: #6b7280;
}

/* Alternative approach for better browser compatibility */
.language-select[data-open="true"] + .language-chevron {
  transform: rotate(180deg);
}

.auth-brand .brand-logo {
  width: 28px;
  height: 28px;
}

/* Dark mode: Make logo white */
[data-theme="dark"] .auth-brand .brand-logo {
  filter: brightness(0) invert(1);
}

.auth-brand .brand-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

/* Auth content - centered like onboarding */
.auth-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 48px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

/* Auth steps - same transitions as onboarding */
.auth-step {
  display: block;
  opacity: 1;
  transform: none;
  width: 100%;
}

/* Auth typography - consistent with onboarding */
.auth-container h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.auth-container .auth-description {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0 0 32px;
  line-height: 1.5;
  text-align: center;
  font-weight: 400;
}

/* Auth form styles */
.auth-form {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form input {
  width: 100%;
  padding: 16px 18px;
  font-size: 15px;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  border: 1.5px solid var(--color-border-light);
  border-radius: 12px;
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

/* Dark mode form inputs */
[data-theme="dark"] .auth-form input {
  background: var(--color-bg-secondary);
  border: 1.5px solid var(--color-border-medium);
}

.auth-form input::placeholder {
  color: var(--color-text-tertiary);
  font-weight: 400;
}

.auth-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(255, 1, 51, 0.06);
}

/* Auth container */
.auth-container {
  background: var(--color-surface-elevated);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--color-border-light);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  margin: 0 auto;
  overflow: hidden;
  box-sizing: border-box;
}

/* Dark mode auth container */
[data-theme="dark"] .auth-container {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-medium);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Auth buttons */
.auth-container .btn {
  width: 100%;
  margin-bottom: 16px;
  padding: 16px 36px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  outline: none;
  position: relative;
  overflow: hidden;
}

/* Google button - PRIMARY, more prominent with dark styling */
.btn-google {
  background: #1f1f1f !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  margin-bottom: 24px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-google:hover:not(:disabled) {
  background: #2a2a2a !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-google:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
  transition: all 0.1s ease;
}

/* Subtle email button - secondary styling */
.btn-subtle {
  background: rgba(255, 255, 255, 0.7) !important;
  color: var(--color-text-secondary) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  font-weight: 500;
}

.btn-subtle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: var(--color-text-primary) !important;
  transform: translateY(-1px);
}

.btn-subtle:active:not(:disabled) {
  transform: translateY(0);
  transition: all 0.1s ease;
}

.auth-container .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Icon animation within buttons */
.auth-container .btn i {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-container .btn:hover:not(:disabled) i {
  transform: translateX(3px);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--color-text-tertiary);
  font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
  margin: 0 16px;
}

/* Error message */
.auth-form .error-message {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: left;
  order: 3.5;
}

/* Success message */
.auth-form .error-message.success-message {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #16A34A;
}

/* Password field slide animation - smooth slide out */
#password-group {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 0;
}

#password-group.show {
  max-height: 100px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 20px;
}

#password-group input {
  margin-top: 0;
}

/* Reset password link */
.reset-password-container {
  text-align: center;
  margin-top: 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.reset-password-container.show {
  opacity: 1;
  transform: translateY(0);
}

.reset-password-link {
  color: var(--color-text-tertiary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: color 0.2s ease;
  cursor: pointer;
}

.reset-password-link:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* Auth footer */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-link {
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: var(--color-primary);
}

.auth-separator {
  color: var(--color-text-quaternary);
}

/* Dark mode adjustments for auth */
[data-theme="dark"] .auth-form input {
  background: var(--color-surface);
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
}

[data-theme="dark"] .auth-form input::placeholder {
  color: var(--color-text-tertiary);
}

[data-theme="dark"] .auth-form input:focus {
  border-color: var(--color-primary);
}

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
  background: var(--color-border-light);
}

[data-theme="dark"] .auth-form .error-message {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.2);
}

[data-theme="dark"] .auth-form .error-message.success-message {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
  color: #10B981;
}

[data-theme="dark"] .auth-form .btn-secondary {
  background: var(--color-gray-800);
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .auth-form .btn-secondary:hover:not(:disabled) {
  background: var(--color-gray-700);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .auth-container {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode language switcher */
[data-theme="dark"] .language-separator {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .language-select-wrapper {
  background: transparent;
  border: none;
}

[data-theme="dark"] .language-switcher:hover .language-select-wrapper {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .language-icon,
[data-theme="dark"] .language-select {
  color: #9ca3af;
}

[data-theme="dark"] .language-select:focus,
[data-theme="dark"] .language-select:focus-visible,
[data-theme="dark"] .language-select:focus-within,
[data-theme="dark"] .language-select:active {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

[data-theme="dark"] .language-switcher:hover .language-icon,
[data-theme="dark"] .language-switcher:hover .language-select {
  color: #d1d5db;
}

[data-theme="dark"] .language-chevron {
  color: #6b7280;
}

[data-theme="dark"] .language-switcher:hover .language-chevron {
  color: #d1d5db;
}

/* Dark mode: Fix dropdown options visibility */
[data-theme="dark"] .language-select option {
  background: var(--color-gray-800);
  color: var(--color-text-primary);
}

[data-theme="dark"] .language-select {
  color-scheme: dark;
}

[data-theme="dark"] .btn-google {
  background: #2a2a2a !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .btn-google:hover:not(:disabled) {
  background: #363636 !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

[data-theme="dark"] .btn-subtle {
  background: rgba(60, 60, 60, 0.7) !important;
  color: var(--color-text-secondary) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .btn-subtle:hover:not(:disabled) {
  background: rgba(80, 80, 80, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--color-text-primary) !important;
}

[data-theme="dark"] .reset-password-link {
  color: var(--color-text-tertiary);
}

[data-theme="dark"] .reset-password-link:hover {
  color: var(--color-primary);
}

/* Dark theme background */
[data-theme="dark"] .auth-overlay {
  background: var(--color-gray-900);
}

@media (prefers-color-scheme: dark) {
  .auth-overlay {
    background: var(--color-gray-900);
  }

  .auth-container {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .btn-google {
    background: #2a2a2a !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
  }

  .btn-google:hover:not(:disabled) {
    background: #363636 !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
  }

  .btn-subtle {
    background: rgba(60, 60, 60, 0.7) !important;
    color: var(--color-text-secondary) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }

  .btn-subtle:hover:not(:disabled) {
    background: rgba(80, 80, 80, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: var(--color-text-primary) !important;
  }

  .reset-password-link {
    color: var(--color-text-tertiary);
  }

  .reset-password-link:hover {
    color: var(--color-primary);
  }
}

/* ===== END AUTH PAGE STYLES ===== */