/* Onboarding Module — Shared Styles
   Evalix-branded, glassmorphism theme matching index.html
   RTL Hebrew, mobile-first responsive */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  direction: rtl;
  position: relative;
  overflow-x: hidden;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  animation: bgFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes bgFloat {
  0%, 100% { opacity: 0.4; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.7; transform: scale(1.1) rotate(180deg); }
}

/* ============================================
   LAYOUT
   ============================================ */

.onboarding-wrapper {
  width: 100%;
  max-width: 680px;
  padding: 30px 20px;
  position: relative;
  z-index: 10;
}

.onboarding-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  padding: 40px 35px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================
   HEADER / BRANDING
   ============================================ */

.onboarding-header {
  text-align: center;
  margin-bottom: 30px;
}

.onboarding-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  margin: 0 auto 16px;
  display: block;
}

.onboarding-brand {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.onboarding-subtitle {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
}

.onboarding-title {
  font-size: 22px;
  font-weight: 700;
  color: #e0e7ff;
  margin-bottom: 8px;
  text-align: center;
}

.onboarding-desc {
  font-size: 14px;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ============================================
   STEP PROGRESS BAR
   ============================================ */

.step-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  direction: ltr; /* Progress bar reads left-to-right */
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.step-dot.completed {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.step-dot.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
  transform: scale(1.15);
}

.step-dot.pending {
  background: rgba(255, 255, 255, 0.08);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-line {
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
  flex-shrink: 1;
}

.step-line.completed {
  background: linear-gradient(90deg, #6366f1, #4f46e5);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

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

.form-group label {
  display: block;
  font-size: 14px;
  color: #cbd5e1;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group label .required {
  color: #f87171;
  margin-right: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 14px 16px;
  font-size: 15px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #e2e8f0;
  transition: all 0.3s ease;
  font-family: inherit;
  direction: rtl;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #64748b;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input.error,
.form-group select.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group .field-error {
  color: #fca5a5;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.form-group .field-error.show {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #a5b4fc;
  margin: 24px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
  padding: 16px 24px;
  font-size: 16px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary::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: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 14px 24px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.05);
  color: #a5b4fc;
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  font-weight: 500;
  font-family: inherit;
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
}

.btn-skip {
  padding: 12px 24px;
  font-size: 14px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-skip:hover {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-row .btn-primary {
  flex: 1;
}

/* ============================================
   FILE UPLOAD
   ============================================ */

.file-upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
}

.file-upload-area:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.05);
}

.file-upload-area.has-file {
  border-color: rgba(99, 102, 241, 0.4);
  border-style: solid;
}

.file-upload-area input[type="file"] {
  display: none;
}

.file-upload-label {
  color: #94a3b8;
  font-size: 13px;
}

.file-upload-label strong {
  color: #a5b4fc;
}

.file-preview {
  max-width: 100px;
  max-height: 60px;
  border-radius: 6px;
  margin-top: 8px;
  display: none;
}

.file-preview.show {
  display: inline-block;
}

.file-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ============================================
   MESSAGES
   ============================================ */

.error-message {
  color: #fca5a5;
  font-size: 14px;
  text-align: center;
  display: none;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-bottom: 16px;
}

.error-message.show {
  display: block;
  animation: shake 0.5s;
}

.success-message {
  color: #86efac;
  font-size: 14px;
  text-align: center;
  display: none;
  padding: 16px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.2);
  margin-bottom: 16px;
}

.success-message.show {
  display: block;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* ============================================
   TEAM MEMBER CARDS (Step 5)
   ============================================ */

.team-member-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.team-member-card .member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.team-member-card .member-name {
  color: #e0e7ff;
  font-weight: 600;
  font-size: 15px;
}

.team-member-card .member-role {
  color: #a5b4fc;
  font-size: 13px;
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 10px;
  border-radius: 20px;
}

.team-member-card .member-details {
  color: #94a3b8;
  font-size: 13px;
}

.team-member-card .temp-password {
  color: #fbbf24;
  font-size: 13px;
  font-family: monospace;
  background: rgba(251, 191, 36, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 6px;
  display: inline-block;
}

.btn-remove-member {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  width: auto;
}

/* ============================================
   SUMMARY (Step 6)
   ============================================ */

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  color: #94a3b8;
  font-size: 14px;
}

.summary-value {
  color: #e0e7ff;
  font-size: 14px;
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */

.onboarding-footer {
  margin-top: 24px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.back-to-login {
  display: inline-block;
  margin-top: 12px;
  color: #a5b4fc;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s ease;
}

.back-to-login:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .onboarding-wrapper {
    padding: 16px 12px;
  }

  .onboarding-card {
    padding: 28px 20px;
    border-radius: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .file-upload-grid {
    grid-template-columns: 1fr;
  }

  .btn-row {
    flex-direction: column;
  }

  .step-dot {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .step-line {
    width: 10px;
  }

  .onboarding-title {
    font-size: 20px;
  }
}
