/**
 * Custom Registration Modal Styles
 */

/* Modal Overlay */
.custom-registration-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-registration-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Modal Container */
.custom-registration-modal .modal-container {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

.apus-mfp-zoom-in .mfp-content {
  max-width: 95% !important;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Header */
.custom-registration-modal .modal-header {
  padding: 25px 30px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-registration-modal .modal-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

.custom-registration-modal .modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.custom-registration-modal .modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Modal Body */
.custom-registration-modal .modal-body {
  padding: 30px;
}

/* Step Indicators / Progress */
.multistep-progress {
  margin-bottom: 40px;
}

.multistep-progress .progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  position: relative;
}

.multistep-progress .progress-steps::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.progress-step .step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 8px;
  transition: all 0.3s;
}

.progress-step.active .step-number {
  background: var(--superio-theme-color, #1e40af);
  color: #fff;
}

.progress-step.completed .step-number {
  background: #10b981;
  color: #fff;
}

.progress-step .step-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.progress-step.active .step-label {
  color: var(--superio-theme-color, #1e40af);
}

.multistep-progress .progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.multistep-progress .progress-bar-fill {
  height: 100%;
  background: var(--superio-theme-color, #1e40af);
  transition: width 0.3s ease;
}

/* Legacy step indicators (keep for compatibility) */
.step-indicators {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.step-indicators::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.step-indicator {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 8px;
  transition: all 0.3s;
}

.step-indicator.active .step-number {
  background: #1e40af;
  color: #fff;
}

.step-indicator.completed .step-number {
  background: #10b981;
  color: #fff;
}

.step-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.step-indicator.active .step-label {
  color: #1e40af;
}

/* Form Steps */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.step-content {
  min-height: 300px;
}

.step-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.step-description {
  color: #6b7280;
  margin: 0 0 30px 0;
  font-size: 14px;
}

/* Form Groups */
.form-row {
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
}

.form-group {
  margin-bottom: 20px;
  flex: 1;
}

.form-group.col-half {
  flex: 1;
}

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

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.2s;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: #1e40af;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-control::placeholder {
  color: #9ca3af;
}

/* Select Styling */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 40px;
}

/* Password Field */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 45px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #6b7280;
  transition: color 0.2s;
}

.toggle-password:hover {
  color: #1f2937;
}

.toggle-password .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  cursor: pointer;
}

.checkbox-label a {
  color: #1e40af;
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

/* Field Errors */
.field-error {
  display: block;
  color: #dc2626;
  font-size: 13px;
  margin-top: 6px;
  min-height: 18px;
}

.form-control.error {
  border-color: #dc2626;
}

.form-control.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-border-box {
  border: 1px solid #dc2626 !important;
  padding: 10px;
  border-radius: 6px;
  background-color: #fff5f5;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  flex: 1;
}

.btn-prev {
  background: #f3f4f6;
  color: #374151;
}

.btn-prev:hover {
  background: #e5e7eb;
}

.btn-next,
.btn-submit {
  background: #1e40af;
  color: #fff;
}

.btn-next:hover,
.btn-submit:hover {
  background: #1e3a8a;
}

.btn-theme {
  background: #1e40af;
  color: #fff;
}

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

/* Messages */
.form-messages {
  padding: 15px;
  border-radius: 6px;
  margin-top: 20px;
}

.form-messages.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.form-messages.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #dc2626;
}

/* Loading State */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .custom-registration-modal .modal-container {
    width: 95%;
    max-height: 95vh;
  }

  .custom-registration-modal .modal-header {
    padding: 20px;
  }

  .custom-registration-modal .modal-body {
    padding: 20px;
  }

  .step-indicators {
    margin-bottom: 30px;
  }

  .step-label {
    font-size: 11px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-group.col-half {
    width: 100%;
  }

  .step-title {
    font-size: 18px;
  }
}

/* OTP Section (Hidden by default, ready for future) */
.otp-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.btn-resend-otp {
  background: none;
  border: none;
  color: #1e40af;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: 8px;
}

.btn-resend-otp:hover {
  color: #1e3a8a;
}

/* CMB2 Field Styles */
.custom-registration-modal .cmb-row {
  margin-bottom: 20px;
}

.custom-registration-modal .cmb-th {
  margin-bottom: 8px;
}

.custom-registration-modal .cmb-th label {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.custom-registration-modal .cmb-td {
  width: 100%;
}

.custom-registration-modal .cmb2-text-small,
.custom-registration-modal .regular-text,
.custom-registration-modal .cmb2_select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.2s;
  background: #fff;
}

.custom-registration-modal .cmb2-text-small:focus,
.custom-registration-modal .regular-text:focus,
.custom-registration-modal .cmb2_select:focus {
  outline: none;
  border-color: var(--superio-theme-color, #1e40af);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.custom-registration-modal .show_hide_password_wrapper {
  position: relative;
  display: block;
}

.custom-registration-modal .show_hide_password_wrapper input {
  padding-right: 45px;
}

.custom-registration-modal .show_hide_password_wrapper .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #6b7280;
}

/* Alert Messages */
.custom-registration-modal .alert {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  list-style: none;
}

.custom-registration-modal .alert-danger {
  background: #fee2e2;
  border: 1px solid #dc2626;
}

.custom-registration-modal .alert-info {
  background: #d1fae5;
  border: 1px solid #10b981;
}

.custom-registration-modal .message_line.danger {
  color: #991b1b;
}

.custom-registration-modal .message_line.info {
  color: #065f46;
}

/* Form Navigation */
.custom-registration-modal .form-navigation {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.custom-registration-modal .btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.custom-registration-modal .btn-secondary:hover {
  background: #e5e7eb;
}

/* Table Layout for CMB2 */
.custom-registration-modal .cmb-row.table-layout {
  display: block;
}

.custom-registration-modal .cmb-row.table-layout .cmb-th,
.custom-registration-modal .cmb-row.table-layout .cmb-td {
  display: block;
  width: 100%;
}

/* Required Asterisk */
.custom-registration-modal .required {
  color: #dc2626;
}
