/* ==========================================================
   WHALE OS — Authentication, Pending, & Blocked Views CSS
   ========================================================== */

.auth-container, .pending-container, .blocked-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: var(--space-5);
  font-family: 'Cairo', 'Inter', sans-serif;
  direction: rtl;
}

.auth-card {
  width: 100%;
  max-width: 1000px;
  background: #ffffff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 1px 3px rgba(2, 5, 32, 0.04), 0 20px 40px -10px rgba(2, 5, 32, 0.12);
  display: flex;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 5, 32, 0.06), 0 24px 48px -10px rgba(2, 5, 32, 0.15);
}

/* Split-Panel Authentication Screen Layout */
.auth-left-panel {
  width: 50%;
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-800) 100%);
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.auth-canvas, .auth-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.auth-left-content {
  position: relative;
  z-index: 2;
  padding: var(--space-8);
  color: #ffffff;
  pointer-events: none; /* allows mouse moves to pass to canvas */
  width: 100%;
  box-sizing: border-box;
}

.auth-left-title {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  letter-spacing: 2px;
  text-align: left; /* Slogan EXPLORE. LEARN. GROW. aligned left */
  direction: ltr;
  font-family: 'Outfit', sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.75) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: sloganFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-right-panel {
  width: 50%;
  padding: var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  box-sizing: border-box;
}

@media (max-width: 850px) {
  .auth-card {
    flex-direction: column;
    max-width: 520px;
  }
  .auth-left-panel {
    width: 100%;
    height: 200px;
    align-items: center;
  }
  .auth-left-content {
    padding: var(--space-4);
  }
  .auth-left-title {
    font-size: 28px;
    text-align: center;
  }
  .auth-right-panel {
    width: 100%;
    padding: var(--space-6) var(--space-5);
  }
}

.auth-logo-section {
  text-align: center;
  margin-bottom: var(--space-5);
}

.auth-logo {
  font-size: 54px;
  animation: float 4s ease-in-out infinite;
  display: inline-block;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--space-3) var(--space-4);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tab-btn.active {
  background: var(--surface);
  color: var(--blue-500);
  box-shadow: var(--shadow-sm);
}

/* Forms */
.auth-pane {
  display: none;
  animation: fadeIn 0.35s ease;
}

.auth-pane.active {
  display: block;
}

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

.auth-form-group {
  margin-bottom: var(--space-4);
  text-align: right;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

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

.auth-input-icon {
  position: absolute;
  left: var(--space-3) !important;
  right: auto !important;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  z-index: 3;
}

.auth-input-wrapper:has(.auth-select) .auth-input-icon,
.auth-input-wrapper:has(select) .auth-input-icon {
  left: 36px !important;
  right: auto !important;
}

.auth-input {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) 42px !important;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s ease;
  text-align: right;
  direction: rtl;
}

.auth-input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: var(--focus-ring);
}

.auth-select {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) 60px !important;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
  text-align: right;
  direction: rtl;
}

.auth-select:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: var(--focus-ring);
}

.auth-select option {
  background: #111827; /* Fallback dark bg */
  background-color: var(--surface) !important;
  color: var(--text-primary) !important;
  padding: var(--space-2);
}

.auth-select-arrow {
  position: absolute;
  left: var(--space-3) !important;
  right: auto !important;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 3;
}

/* User Type Flow Sections */
.auth-flow-fields {
  border-top: 1px dashed var(--border);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; overflow: hidden; }
  to { opacity: 1; max-height: 1000px; }
}

.auth-interests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.auth-checkbox-label:hover {
  background: var(--surface-hover);
}

.auth-checkbox-label input {
  accent-color: var(--blue-500);
  cursor: pointer;
}

.auth-textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  transition: all 0.2s ease;
}

.auth-textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: var(--focus-ring);
}

/* Button */
.auth-submit-btn {
  width: 100%;
  padding: var(--space-3);
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  border: none;
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: var(--space-4);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 93, 255, 0.25);
}

.auth-submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

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

/* Pending & Blocked Status Screens */
.status-card {
  width: 100%;
  max-width: 600px;
  background: #ffffff;
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-card, 16px);
  padding: var(--space-7) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-relate-card, 0 1px 3px rgba(2, 5, 32, 0.05), 0 10px 25px -5px rgba(2, 5, 32, 0.04));
}

.status-badge {
  font-size: 64px;
  margin-bottom: var(--space-4);
  display: inline-block;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.status-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.status-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.pending-notes-card {
  background: rgba(255, 196, 0, 0.08);
  border: 1px solid rgba(255, 196, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  text-align: right;
}

.blocked-notes-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  text-align: right;
}

.status-notes-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.status-notes-content {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.whatsapp-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: #25d366;
  color: white;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.whatsapp-link-btn:hover {
  background: #20ba5a;
  transform: translateY(-2px);
}

.logout-link-btn {
  display: block;
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: 13.5px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.logout-link-btn:hover {
  color: var(--text-primary);
}

/* ==========================================================
   Multi-Step Wizard Styling
   ========================================================== */

.auth-step-progress {
  margin-bottom: var(--space-5);
  position: relative;
}

.step-progress-track {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.step-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 33.33%;
}

.step-indicators {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.step-indicator-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  text-align: center;
  position: relative;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  z-index: 2;
}

.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-indicator-item.active .step-num {
  background: var(--blue-500);
  color: #ffffff;
  border-color: var(--blue-500);
  box-shadow: 0 0 12px rgba(0, 93, 255, 0.4);
}

.step-indicator-item.active .step-label {
  color: var(--text-primary);
  font-weight: 700;
}

.auth-step-buttons {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.auth-step-btn {
  flex: 1;
  padding: var(--space-3);
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  border: none;
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 93, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-step-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.auth-step-btn.secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: none;
}

.auth-step-btn.secondary:hover {
  background: var(--surface-hover);
  filter: none;
}

.auth-register-step {
  animation: stepFadeIn 0.35s ease;
}

@keyframes stepFadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================
   Pending & Blocked Screen Layout Constraints
   ========================================================== */
body.status-restricted #dna-sidebar,
body.status-restricted .header-search-entry,
body.status-restricted .header-actions {
  display: none !important;
}

body.status-restricted .header-desktop {
  justify-content: center !important;
}

body.status-restricted .main-viewport {
  margin-right: 0 !important;
  margin-left: 0 !important;
  width: 100% !important;
}

/* ==========================================================
   Cascading Pills Selector Design (overlapping 3D cards)
   ========================================================== */
.cascading-pills-container {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  position: relative;
}

.pill-card {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: -6px; /* overlap effect */
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.pill-card:hover {
  transform: translateY(-2px) scale(1.02);
  z-index: 5;
  box-shadow: var(--shadow-md);
  background: var(--surface-hover);
}

.pill-card.active {
  background: var(--surface);
  border-color: var(--blue-500);
  color: var(--blue-500);
  transform: translateY(-4px) scale(1.04);
  z-index: 10;
  box-shadow: 0 10px 25px rgba(0, 93, 255, 0.15);
}

.pill-card.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--blue-500);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.pill-icon {
  font-size: 20px;
  margin-left: var(--space-3); /* RTL spacing */
}

.pill-text {
  font-size: 14px;
  font-weight: 600;
  flex-grow: 1;
  text-align: right;
}

.pill-checkmark {
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.pill-card.active .pill-checkmark {
  opacity: 1;
  color: var(--blue-500);
}

/* ==========================================================
   Gender Selector Cards & Avatar Previews
   ========================================================== */
.gender-selector-container {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.gender-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
}

.gender-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gender-card.active {
  background: var(--surface);
  border-color: var(--blue-500);
  box-shadow: 0 8px 20px rgba(0, 93, 255, 0.12);
}

.gender-card.active .gender-icon {
  transform: scale(1.15);
}

.gender-icon {
  font-size: 32px;
  margin-bottom: 6px;
  transition: transform 0.2s ease;
}

.gender-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Avatar Preview UI */
.avatar-preview-group {
  animation: fadeIn 0.4s ease;
}

.avatar-preview-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 10px;
}

.avatar-preview-img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--blue-500);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.avatar-preview-img.animate-pop {
  transform: scale(1.15) rotate(5deg);
}

.avatar-preview-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.avatar-assigned-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.avatar-randomize-btn {
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.avatar-randomize-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--blue-500);
  transform: scale(1.02);
}

/* ==========================================================
   Full-Screen Success Overlay Animation
   ========================================================== */
.auth-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  direction: rtl;
}

.auth-success-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.success-checkmark-wrapper {
  width: 100px;
  height: 100px;
  background: var(--blue-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin-bottom: 24px;
  box-shadow: 0 0 40px var(--blue-500);
  animation: successPulse 2s infinite, successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform: scale(0);
}

@keyframes successPop {
  to { transform: scale(1); }
}

@keyframes successPulse {
  0% { box-shadow: 0 0 20px rgba(0, 93, 255, 0.6); }
  50% { box-shadow: 0 0 45px rgba(0, 93, 255, 0.9); }
  100% { box-shadow: 0 0 20px rgba(0, 93, 255, 0.6); }
}

.success-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
  color: #ffffff;
}

.success-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  max-width: 400px;
  line-height: 1.6;
  padding: 0 20px;
}

/* Off-screen but layout-visible select overlay for automated testing compatibility */
.auth-select-hidden {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 100px !important;
  height: 30px !important;
  opacity: 0.01 !important;
  display: block !important;
  visibility: visible !important;
  pointer-events: none !important;
}

/* Forgot Password Modal & Reset Password Styles */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.auth-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 90%;
  max-width: 440px;
  padding: 30px;
  position: relative;
  box-shadow: var(--shadow-2xl);
  direction: rtl;
  text-align: right;
}

.auth-modal-close {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.auth-modal-close:hover {
  color: var(--red-500);
}

.auth-modal-title {
  margin-top: 0;
  font-size: 20px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  margin-bottom: 8px;
}

.auth-modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.forgot-pwd-link {
  transition: opacity 0.2s;
}

.forgot-pwd-link:hover {
  opacity: 0.8;
}

