/* ===================================================================
   MULTI-RESTO BACKOFFICE - Authentication Pages
   =================================================================== */

/* ===== Auth Layout ===== */
.auth-layout {
  min-height: 100vh;
  display: flex;
}

.auth-sidebar {
  width: 45%;
  background: var(--brand-gradient);
  background: linear-gradient(135deg, #26A69A 0%, #00897B 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
}

.auth-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.auth-sidebar-content {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

.auth-brand-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.5rem;
}

.auth-brand-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.auth-headline {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 20px;
}

.auth-subheadline {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  max-width: 400px;
}

.auth-features {
  margin-top: 48px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.auth-feature-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.auth-feature-text {
  font-size: 1rem;
  font-weight: 500;
  color: white;
}

/* ===== Auth Main ===== */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-light);
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ===== Auth Form ===== */
.auth-form {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.auth-form-group {
  margin-bottom: 24px;
}

.auth-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-form-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-light);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form-input:hover {
  border-color: var(--gray-300);
  background: white;
}

.auth-form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(38, 166, 154, 0.08);
}

.auth-form-input::placeholder {
  color: var(--text-muted);
}

.auth-form-input-wrapper {
  position: relative;
}

.auth-form-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.auth-form-input-wrapper .auth-form-input {
  padding-left: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.auth-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.auth-checkbox-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-forgot-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  transition: color var(--transition-fast);
}

.auth-forgot-link:hover {
  color: var(--primary-dark);
}

.auth-submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(38, 166, 154, 0.25);
  position: relative;
  overflow: hidden;
}

.auth-submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 600ms ease;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(38, 166, 154, 0.35);
}

.auth-submit-btn:hover::before {
  transform: translateX(100%);
}

.auth-submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(38, 166, 154, 0.2);
}

.auth-submit-btn:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-divider-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ===== Auth Footer ===== */
.auth-footer {
  text-align: center;
  margin-top: 32px;
}

.auth-footer-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.auth-footer-link {
  font-weight: 600;
  color: var(--primary);
  transition: color var(--transition-fast);
}

.auth-footer-link:hover {
  color: var(--primary-dark);
}

/* ===== Auth Alert ===== */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  font-size: 0.875rem;
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .auth-sidebar {
    width: 40%;
    padding: 40px;
  }
  
  .auth-headline {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .auth-layout {
    flex-direction: column;
  }
  
  .auth-sidebar {
    width: 100%;
    padding: 40px 24px;
  }
  
  .auth-headline {
    font-size: 1.75rem;
  }
  
  .auth-features {
    display: none;
  }
  
  .auth-main {
    padding: 24px;
  }
  
  .auth-form {
    padding: 24px;
  }
}

/* ===== Welcome/Setup Flow ===== */
.welcome-layout {
  min-height: 100vh;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.welcome-container {
  width: 100%;
  max-width: 600px;
}

.welcome-header {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
}

.welcome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

.welcome-card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}

.welcome-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-light);
  padding: 6px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

.welcome-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.welcome-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ===== Space Selection ===== */
.space-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.space-option {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.space-option:hover {
  background: white;
  border-color: var(--gray-200);
}

.space-option.selected {
  background: rgba(38, 166, 154, 0.05);
  border-color: var(--primary);
}

.space-option-icon {
  width: 56px;
  height: 56px;
  background: white;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.space-option-icon img {
  width: 32px;
  height: 32px;
}

.space-option-content {
  flex: 1;
}

.space-option-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.space-option-description {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.space-option-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.space-option.selected .space-option-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ===== Loading Animation ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===== Background Light ===== */
.bg-light {
  background: var(--bg-base, #F8FAFC);
}

