 /* Root variables for brand consistency */
 :root {
    --primary-color: #0d2d5b;
    --primary-dark: #4570e6;
    --primary-light: #7da0ff;
    --success-color: #13deb9;
    --warning-color: #ffae1f;
    --danger-color: #fa896b;
    --dark-color: #2a3547;
    --light-color: #f6f9fc;
    --border-color: #e5eaef;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Enhanced wizard container */
  .wizard-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 600px; /* Increased max-width for more content */
    margin: 0 auto;
  }

  .wizard-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
  }

  .wizard-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
  }

  .wizard-header h2 {
    color: white;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
  }

  /* Enhanced step indicator */
  .step-indicator {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--light-color);
    border-bottom: 1px solid var(--border-color);
  }

  .step-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
  }

  .step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
  }

  .step-item.active .step-circle {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(93, 135, 255, 0.1);
  }

  .step-item.completed .step-circle {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
  }

  .step-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
  }

  .step-item.active .step-label,
  .step-item.completed .step-label {
    color: var(--dark-color);
    font-weight: 600;
  }

  /* Enhanced wizard step content */
  .wizard-content {
    padding: 2rem;
  }

  .wizard-step {
    display: none;
    animation: fadeIn 0.3s ease;
  }

  .wizard-step.active {
    display: block;
  }

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

  .step-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
  }

  .step-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Enhanced form styling */
  .form-group {
    margin-bottom: 1.5rem;
  }

  .form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 0.9rem;
  }

  .form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    -webkit-appearance: none; /* For Safari/Chrome */
    -moz-appearance: none; /* For Firefox */
    appearance: none; /* Standard syntax */
  }

  .form-select {
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 1rem center;
      background-size: 0.65em auto;
  }

  .form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 135, 255, 0.1);
  }

  .form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--danger-color);
  }

  .form-control.is-invalid:focus, .form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(250, 137, 107, 0.1);
  }

  .form-check {
      display: flex;
      align-items: center;
      margin-bottom: 1rem;
  }

  .form-check-input {
      width: 1.25rem;
      height: 1.25rem;
      margin-right: 0.75rem;
      flex-shrink: 0;
      border: 2px solid var(--border-color);
      border-radius: 4px;
      transition: var(--transition);
      cursor: pointer;
  }

  .form-check-input:checked {
      background-color: var(--primary-color);
      border-color: var(--primary-color);
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l5-5'/%3e%3c/svg%3e");
      background-size: 100% 100%;
      background-repeat: no-repeat;
      background-position: center;
  }

  .form-check-label {
      color: var(--dark-color);
      font-size: 1rem;
      cursor: pointer;
  }


  /* Enhanced password field with toggle */
  .password-field {
    position: relative;
  }

  .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
  }

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

  /* Enhanced password strength indicator */
  .password-strength {
    margin-top: 0.75rem;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  }

  .password-strength-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
  }

  .password-requirements {
    margin-top: 1rem;
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }

  .requirement {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: var(--transition);
  }

  .requirement::before {
    content: '○';
    margin-right: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
  }

  .requirement.met {
    color: var(--success-color);
    font-weight: 500;
  }

  .requirement.met::before {
    content: '✓';
    font-weight: bold;
  }

  /* Enhanced button styling */
  .btn {
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    min-width: 140px;
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(93, 135, 255, 0.3);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(93, 135, 255, 0.4);
  }

  .btn-primary:active {
    transform: translateY(0);
  }

  .btn-secondary {
    background: white;
    color: var(--dark-color);
    border: 2px solid var(--border-color);
  }

  .btn-secondary:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
  }

  .btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid transparent;
    font-weight: 400;
  }

  .btn-outline:hover {
    color: var(--primary-color);
    background: rgba(93, 135, 255, 0.05);
  }

  .btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: space-between;
  }

  .btn-group .btn {
    flex: 1;
  }

  .btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  /* Enhanced alert styling */
  .alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideDown 0.3s ease;
  }

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

  .alert-success {
    background: rgba(19, 222, 185, 0.1);
    border: 1px solid rgba(19, 222, 185, 0.3);
    color: #0d9b7a;
  }

  .alert-danger {
    background: rgba(250, 137, 107, 0.1);
    border: 1px solid rgba(250, 137, 107, 0.3);
    color: #d85945;
  }

  .alert strong {
    display: block;
    margin-bottom: 0.25rem;
  }

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

  /* Enhanced QR code section */
  .qr-code-section {
    background: var(--light-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
  }

  .qr-code-wrapper {
    background: white;
    display: inline-block;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
  }

  .qr-code-wrapper img {
    display: block;
    max-width: 200px;
    height: auto;
  }

  .secret-key {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    word-break: break-all;
    margin-top: 0.5rem;
  }

  /* OTP input styling */
  .otp-input {
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-family: 'Monaco', 'Consolas', monospace;
  }

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

  .btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
  }

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

  /* Success state modal overlay */
  .success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .success-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .success-modal {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
  }

  .success-overlay.active .success-modal {
    transform: scale(1);
  }

  .success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: successBounce 0.6s ease;
  }

  @keyframes successBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
  }

  .success-icon svg {
    width: 40px;
    height: 40px;
    color: white;
  }

  /* Responsive adjustments */
  @media (max-width: 576px) {
    .wizard-content {
      padding: 1.5rem;
    }
    
    .step-label {
      font-size: 0.75rem;
    }
    
    .step-circle {
      width: 40px;
      height: 40px;
    }
  }

  /* Dark theme adjustments */
  [data-bs-theme="dark"] .wizard-container {
    background: rgba(42, 53, 71, 0.98);
  }

  [data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select {
    background: #2a3547;
    border-color: #3a4556;
    color: white;
  }

  [data-bs-theme="dark"] .password-requirements,
  [data-bs-theme="dark"] .qr-code-section {
    background: #2a3547;
    border-color: #3a4556;
  }

  [data-bs-theme="dark"] .step-indicator {
    background: #2a3547;
    border-color: #3a4556;
  }

  [data-bs-theme="dark"] .step-circle {
    background: #3a4556;
    border-color: #4a5566;
  }

  [data-bs-theme="dark"] .qr-code-wrapper {
    background: #3a4556;
  }

  [data-bs-theme="dark"] .secret-key {
    background: #3a4556;
    border-color: #4a5566;
    color: #adb5bd;
  }

  [data-bs-theme="dark"] .form-check-input {
      border-color: #4a5566;
  }

  .conditional-section {
      display: none;
  }

  .iti{
      width: 100%;
  }

  /* Custom styles for Select2 height */
  .select2-container--bootstrap-5 .select2-selection--single,
  .select2-container--bootstrap-5 .select2-selection--multiple {
      min-height: 48px; /* Adjust as needed */
      padding: 0.75rem 1rem; /* Match existing form-control padding */
  }

  .select2-container--bootstrap-5 .select2-selection__arrow {
      height: 46px; /* Adjust arrow height to match */
  }

  .select2-container--bootstrap-5 .select2-selection__rendered {
      line-height: 30px; /* Adjust line-height to vertically align text */
  }

  /* Ensure progress bar transition */
  .progress-bar {
      transition: width 0.5s ease; /* Match original progress transition */
  }

  .step-progress-container {
      height: 4px;
      margin-top: -1.5rem;
      background-color: var(--border-color);
      border-radius: 0;
      width: calc(100% - 4rem); /* Match the content width of step-indicator */
      margin-left: auto;
      margin-right: auto;
  }