/* ==========================================================================
   SAHALPLUS — AUTHENTICATION STYLES (UI / SIGN UP / LOGIN / PROVIDER ONBOARDING)
   Respects SahalPlus Design Tokens:
   Green (#70FF0B), Yellow (#FFD400), Light/Dark Themes, Inter/Outfit Fonts
   ========================================================================== */

/* Auth Page Container & Layout */
.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-main);
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Subtle background accent glow */
.auth-bg-ambient {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 450px;
  background: radial-gradient(circle, rgba(112, 255, 11, 0.08) 0%, rgba(255, 212, 0, 0.03) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .auth-bg-ambient {
  background: radial-gradient(circle, rgba(112, 255, 11, 0.12) 0%, rgba(255, 212, 0, 0.04) 45%, transparent 70%);
}

/* Top Navigation Bar */
.auth-header-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

.auth-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.auth-nav-back:hover {
  color: var(--text-heading);
  border-color: var(--brand-green);
  transform: translateX(-3px);
}

[dir="rtl"] .auth-nav-back:hover {
  transform: translateX(3px);
}

.auth-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Main Content Area */
.auth-main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 48px;
  position: relative;
  z-index: 5;
}

/* Authentication Card Container */
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-xl);
  position: relative;
  backdrop-filter: blur(16px);
  transition: all var(--transition-normal);
}

.auth-card-wide {
  max-width: 700px;
}

/* Top Right Mini SahalPlus Icon */
.auth-card-mini-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity var(--transition-fast);
}

[dir="rtl"] .auth-card-mini-icon {
  right: auto;
  left: 20px;
}

.auth-card-mini-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Header inside Auth Card */
.auth-card-header {
  text-align: center;
  margin-bottom: 22px;
  position: relative;
}

.auth-card-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.auth-card-logo-img {
  height: 36px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  transition: opacity var(--transition-fast);
}

.auth-card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 6px;
}

.auth-card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

/* Account Type Selector Cards (/sign-up) */
.account-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0;
}

.account-type-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 18px;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.account-type-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-green);
  box-shadow: 0 8px 20px rgba(112, 255, 11, 0.12);
  background: var(--bg-surface);
}

.account-type-card.featured {
  border-color: rgba(112, 255, 11, 0.4);
}

.account-type-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0E6B00;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

[data-theme="dark"] .account-type-icon-box {
  color: var(--brand-green);
  background: var(--bg-surface-elevated);
}

.account-type-card:hover .account-type-icon-box {
  background: var(--brand-green);
  color: #000000;
  transform: scale(1.05);
}

.account-type-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.account-type-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}

.account-type-action-btn {
  width: 100%;
  font-size: 0.82rem;
  padding: 8px 14px;
}

/* Social Login Button */
.auth-social-btn {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.auth-social-btn:hover {
  background: var(--bg-surface-alt);
  border-color: var(--brand-green);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.auth-social-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-divider span {
  padding: 0 14px;
}

/* Auth Form Controls */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-label-optional {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: none;
}

.auth-label-required::after {
  content: " *";
  color: #EF4444;
}

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

.auth-input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

[dir="rtl"] .auth-input-icon {
  left: auto;
  right: 12px;
}

.auth-input {
  width: 100%;
  height: 42px;
  padding: 8px 12px 8px 38px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

[dir="rtl"] .auth-input {
  padding: 8px 38px 8px 12px;
}

.auth-input:focus {
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  background: var(--bg-surface);
}

.auth-input.is-invalid {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.04);
}

.auth-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.auth-input-addon-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-subtle);
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
}

[dir="rtl"] .auth-input-addon-btn {
  right: auto;
  left: 10px;
}

.auth-input-addon-btn:hover {
  color: var(--text-heading);
}

.auth-feedback-msg {
  font-size: 0.75rem;
  color: #EF4444;
  margin-top: 3px;
  display: none;
}

.auth-feedback-msg.visible {
  display: block;
}

/* Password Strength Bar */
.password-strength-meter {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

.password-strength-seg {
  height: 3px;
  flex: 1;
  background: var(--border-light);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.password-strength-seg.weak {
  background-color: #EF4444;
}

.password-strength-seg.medium {
  background-color: var(--brand-yellow);
}

.password-strength-seg.strong {
  background-color: #10B981;
}

.password-strength-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-top: 3px;
  text-align: right;
}

/* Checkboxes & Legal Links */
.auth-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
  user-select: none;
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #10B981;
  border-radius: 4px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.auth-link {
  color: #0E6B00;
  font-weight: 600;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

[data-theme="dark"] .auth-link {
  color: var(--brand-green);
}

.auth-link:hover {
  color: var(--brand-yellow);
}

/* Auth Primary CTA */
.auth-submit-btn {
  width: 100%;
  height: 44px;
  font-size: 0.92rem;
  margin-top: 4px;
}

/* Auth Card Footer */
.auth-card-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Multi-Step Progress Indicator (Provider Signup) */
.provider-step-wizard {
  margin-bottom: 24px;
}

.wizard-steps-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 0 auto 10px;
  max-width: 580px;
}

.wizard-progress-track {
  position: absolute;
  top: 15px;
  left: 24px;
  right: 24px;
  height: 2.5px;
  background: var(--border-light);
  z-index: 1;
}

.wizard-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-yellow));
  transition: width var(--transition-smooth);
}

.wizard-step-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: default;
}

.wizard-step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-subtle);
  transition: all var(--transition-fast);
}

.wizard-step-node.active .wizard-step-circle {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #000000;
  box-shadow: 0 0 0 3px rgba(112, 255, 11, 0.25);
  font-weight: 800;
}

.wizard-step-node.completed .wizard-step-circle {
  background: #10B981;
  border-color: #10B981;
  color: #FFFFFF;
}

.wizard-step-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.wizard-step-node.active .wizard-step-label {
  color: var(--text-heading);
  font-weight: 700;
}

.wizard-step-node.completed .wizard-step-label {
  color: #10B981;
}

/* Service Multi-Select Grid (Step 1) */
.service-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0 22px;
}

.service-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-surface-alt);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
}

.service-select-card:hover {
  border-color: rgba(112, 255, 11, 0.6);
  background: var(--bg-surface);
  transform: translateY(-2px);
}

.service-select-card.selected {
  border-color: var(--brand-green);
  background: rgba(112, 255, 11, 0.08);
  box-shadow: 0 3px 10px rgba(112, 255, 11, 0.15);
}

[data-theme="dark"] .service-select-card.selected {
  background: rgba(112, 255, 11, 0.12);
}

.service-select-card input[type="radio"],
.service-select-card input[type="checkbox"] {
  position: absolute;
  top: 8px;
  right: 8px;
  accent-color: #10B981;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

[dir="rtl"] .service-select-card input[type="radio"],
[dir="rtl"] .service-select-card input[type="checkbox"] {
  right: auto;
  left: 8px;
}

.service-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10B981;
  font-size: 1.15rem;
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

[data-theme="dark"] .service-card-icon {
  color: var(--brand-green);
}

.service-select-card.selected .service-card-icon {
  background: var(--brand-green);
  color: #000000;
}

.service-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* Country Searchable Dropdown with Left Chevron */
.country-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.country-dropdown-toggle-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  z-index: 2;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.country-dropdown-toggle-btn:hover {
  color: var(--text-heading);
}

.country-dropdown-toggle-btn.open svg {
  transform: rotate(180deg);
}

[dir="rtl"] .country-dropdown-toggle-btn {
  left: auto;
  right: 10px;
}

.country-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  padding: 4px;
  overscroll-behavior: contain;
}

.country-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.country-dropdown-item:hover,
.country-dropdown-item.focused {
  background: var(--bg-surface-alt);
  color: var(--text-heading);
}

.country-dropdown-item.selected {
  background: rgba(112, 255, 11, 0.12);
  color: #0E6B00;
  font-weight: 700;
}

[data-theme="dark"] .country-dropdown-item.selected {
  color: var(--brand-green);
}

.country-dropdown-empty {
  padding: 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

/* Country / Region Tag Selector */
.region-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 40px;
  padding: 6px 10px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.region-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-heading);
  box-shadow: var(--shadow-xs);
}

.region-tag-remove {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
}

.region-tag-remove:hover {
  color: #EF4444;
}

/* File Upload Dropzone */
.file-upload-dropzone {
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  background: var(--bg-surface-alt);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.file-upload-dropzone:hover,
.file-upload-dropzone:focus-visible,
.file-upload-dropzone.drag-over {
  border-color: var(--brand-green);
  background: var(--bg-surface);
}

.file-upload-dropzone.has-file {
  border-style: solid;
  border-color: var(--brand-green);
  background: rgba(112, 255, 11, 0.04);
}

[data-theme="dark"] .file-upload-dropzone.has-file {
  background: rgba(112, 255, 11, 0.08);
}

.file-upload-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-green);
}

.file-upload-dropzone.has-file .file-upload-icon {
  background: var(--brand-green);
  color: #000000;
}

.file-upload-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 3px;
}

.file-upload-hint {
  font-size: 0.74rem;
  color: var(--text-subtle);
}

.file-upload-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.file-upload-preview-name {
  font-weight: 600;
  color: var(--text-heading);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-preview-size {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.file-upload-remove-btn {
  background: none;
  border: none;
  color: #EF4444;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}

.file-upload-remove-btn:hover {
  text-decoration: underline;
}

/* Step Wizard Navigation Buttons */
.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

/* Status Banner / Notice */
.status-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 212, 0, 0.08);
  border: 1px solid rgba(255, 212, 0, 0.3);
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.45;
  margin: 14px 0;
}

[data-theme="dark"] .status-info-banner {
  background: rgba(255, 212, 0, 0.1);
  border-color: rgba(255, 212, 0, 0.25);
}

.status-badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255, 212, 0, 0.15);
  border: 1px solid var(--brand-yellow);
  color: #B45309;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

[data-theme="dark"] .status-badge-pending {
  color: var(--brand-yellow);
}

/* Success / Pending State Screen */
.auth-status-screen {
  text-align: center;
  padding: 16px 0;
}

.auth-status-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.auth-status-icon-box.success {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 2px solid #10B981;
}

.auth-status-icon-box.pending {
  background: rgba(255, 212, 0, 0.15);
  color: #D97706;
  border: 2px solid var(--brand-yellow);
}

[data-theme="dark"] .auth-status-icon-box.pending {
  color: var(--brand-yellow);
}

/* Step Wizard Sections */
.wizard-step-panel {
  display: none;
}

.wizard-step-panel.active {
  display: block;
  animation: fadeInStep 0.3s ease-in-out;
}

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

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .auth-header-nav {
    padding: 12px 16px;
  }

  .auth-card {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }

  .auth-card-mini-icon {
    top: 16px;
    right: 16px;
    width: 22px;
    height: 22px;
  }

  [dir="rtl"] .auth-card-mini-icon {
    right: auto;
    left: 16px;
  }

  .account-type-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .service-checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wizard-steps-list {
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .wizard-step-label {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .auth-main-content {
    padding: 12px 12px 36px;
  }

  .auth-card {
    padding: 20px 14px;
  }

  .service-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .wizard-step-label {
    display: none;
  }
}
